Актуализация тестов после перехода на версию 1.29
parent
3a09e0d602
commit
4e39172bc7
|
|
@ -51,14 +51,14 @@ class BaseComponent:
|
|||
|
||||
fields_locators = {}
|
||||
|
||||
layouts = container_locator.locator("div.layout")
|
||||
layouts = container_locator.locator("div.layout > div.flex").locator("..")
|
||||
|
||||
for i in range(layouts.count()):
|
||||
layout = layouts.nth(i)
|
||||
flex_containers = layout.locator("div.flex")
|
||||
|
||||
# Обрабатываем пары контейнеров
|
||||
for j in range(0, flex_containers.count() - 1):
|
||||
for j in range(0, flex_containers.count() - 1, 2):
|
||||
label_container = flex_containers.nth(j)
|
||||
input_container = flex_containers.nth(j + 1)
|
||||
|
||||
|
|
@ -72,7 +72,9 @@ class BaseComponent:
|
|||
"input, textarea, select"
|
||||
).count() > 0
|
||||
|
||||
if has_input:
|
||||
not_found = fields_locators.get(label_text) is None
|
||||
|
||||
if has_input and not_found:
|
||||
fields_locators[label_text] = input_container
|
||||
|
||||
return fields_locators
|
||||
|
|
|
|||
|
|
@ -82,7 +82,12 @@ class DropdownList(BaseComponent):
|
|||
|
||||
loc = self.get_locator(locator)
|
||||
texts = loc.all_inner_texts()
|
||||
return texts[0].splitlines()
|
||||
if len(texts) == 1 and texts[0].find("\n") != -1:
|
||||
names = list(texts[0].splitlines())
|
||||
else:
|
||||
names = list(texts)
|
||||
|
||||
return names
|
||||
|
||||
def get_selected_combobox_value(self, combobox_locator: str | Locator,
|
||||
value_locator: str | Locator = None) -> str:
|
||||
|
|
|
|||
|
|
@ -158,12 +158,12 @@ class EventPanelComponent(BaseComponent):
|
|||
"""Возвращает текущее положение панели событий относительно страницы: "top", "center","bottom"."""
|
||||
|
||||
style_attr = self.page.locator(EventPanelLocators.AREA_EVENTS).get_attribute("style")
|
||||
position = "bottom"
|
||||
position = "top"
|
||||
|
||||
if style_attr.find("display: none;") == -1:
|
||||
height = style_attr.replace("height: ","").replace(";", "")
|
||||
height = style_attr.replace("position: relative;","").replace("height: ","").replace(";", "").lstrip()
|
||||
if height == "100%":
|
||||
position = "top"
|
||||
position = "bottom"
|
||||
else:
|
||||
position = "center"
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,12 @@ class AddUserModalWindow(ModalWindowComponent):
|
|||
self.add_toolbar_button(locator_button_toolbar_close, "close")
|
||||
|
||||
elements_locators = self.get_input_fields_locators(page.locator(input_form_locator))
|
||||
# print(elements_locators)
|
||||
|
||||
# Поле Тип авторизации
|
||||
loc = elements_locators.get("Тип авторизации")
|
||||
if loc:
|
||||
auth_type_selector = SelectionBarComponent(page, loc.get_by_role("combobox"))
|
||||
auth_type_loc = elements_locators.get("Тип авторизации")
|
||||
if auth_type_loc:
|
||||
auth_type_selector = SelectionBarComponent(page, auth_type_loc.get_by_role("combobox").first)
|
||||
self.add_content_item("auth_type_selector", auth_type_selector)
|
||||
|
||||
# Поле Имя
|
||||
|
|
@ -352,13 +353,12 @@ class AddUserModalWindow(ModalWindowComponent):
|
|||
Форма для создания keycloack пользователя имеет тот же набор полей.
|
||||
"""
|
||||
|
||||
expected_auth_types = ['local', 'LDAP', 'keycloack']
|
||||
expected_auth_types = ['local', 'LDAP', 'keycloak']
|
||||
expected_roles = ['$collector', 'Администратор',
|
||||
'Специалист информационной безопасности',
|
||||
'Контактное лицо', 'Оператор']
|
||||
|
||||
menu_locator = self.page.locator(ModalWindowLocators.MENU_ACTIVE_INPUT_FORM)
|
||||
items_locator = menu_locator.locator(ModalWindowLocators.MENU_ACTIVE_ITEMS)
|
||||
|
||||
self.check_by_window_title()
|
||||
|
||||
|
|
@ -387,7 +387,7 @@ class AddUserModalWindow(ModalWindowComponent):
|
|||
continue
|
||||
assert current_auth_type == 'local', "Default Auth Type value should be 'local'"
|
||||
|
||||
actual_auth_types = item.get_available_options(items_locator)
|
||||
actual_auth_types = item.get_available_options()
|
||||
assert actual_auth_types == expected_auth_types, \
|
||||
f"Actual auth types {actual_auth_types} are not equal expected values {expected_auth_types}."
|
||||
elif name == "role_input":
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ class SendTestEmailModalWindow(ModalWindowComponent):
|
|||
self.add_toolbar_button(toolbar_button_close_locator, "close")
|
||||
|
||||
# Поле ввода адреса
|
||||
elements_locators = self.get_input_fields_locators(window_locator)
|
||||
loc = elements_locators.get("E-mail").locator("div.v-text-field__slot > input")
|
||||
loc = window_locator.locator("//input[@data-testid='E_MAIL_CARD__text-field_text__email']")
|
||||
email_input = TextInput(page, loc, "email_input")
|
||||
self.add_content_item("email_input", email_input)
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class SelectionBarComponent(BaseComponent):
|
|||
|
||||
# При нажатии на панель появляется выпадающий список с параметрами фильтрации для выбора
|
||||
self.selected_values_list = DropdownList(self.page)
|
||||
print(self.selection_bar_locator)
|
||||
|
||||
# Действия:
|
||||
def clear_selections(self) -> None:
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class EventPanelLocators:
|
|||
CONTAINER_SYSTEM_LOG_EVENTS (str): контейнера с событиями Системного журнала.
|
||||
"""
|
||||
|
||||
AREA_EVENTS = "#app > div.application--wrap > div > div:nth-child(3)"
|
||||
AREA_EVENTS = "#app > div.application--wrap > div > div:nth-child(1)"
|
||||
|
||||
BUTTON_EXPAND_LESS = "//button[contains(@data-testid, 'BASELINE__btn__toolbar_close')]"
|
||||
BUTTON_EXPAND_MORE = "//button[contains(@data-testid, 'BASELINE__btn__toolbar_open')]"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class SelectionBarLocators:
|
|||
|
||||
# Локаторы для элементов выпадающего списка
|
||||
LISTBOX = "//div[@role='list']"
|
||||
LIST_ITEMS = "//div[@role='list']//div[@role='listitem']"
|
||||
LIST_ITEMS = "//div[contains(@class, 'menuable__content__active')]//div[@role='list']//div[@role='listitem']"
|
||||
|
||||
# Локатор для родительского контейнера поля ввода
|
||||
INPUT_PARENT_CONTAINER = "xpath=./ancestor::div[contains(@class, 'v-input')]"
|
||||
|
|
|
|||
|
|
@ -83,11 +83,6 @@ class TestUsersTabAddUser:
|
|||
ut.open_add_user_window()
|
||||
ut.check_add_user_window_content()
|
||||
|
||||
# skip as unsupported
|
||||
# ut.transform_to_add_AD_user_window()
|
||||
# ut.check_add_AD_user_window_content()
|
||||
# ut.close_add_AD_user_window()
|
||||
|
||||
ut.close_add_user_window()
|
||||
|
||||
# @pytest.mark.develop
|
||||
|
|
|
|||
Loading…
Reference in New Issue