Актуализация тестов после перехода на новую версию приложения 1.25
parent
e81a039ff0
commit
9a5308bf7d
|
|
@ -152,11 +152,6 @@ class EventPanelComponent(BaseComponent):
|
||||||
|
|
||||||
self.user_button.check_visibility("User button is missing on event panel")
|
self.user_button.check_visibility("User button is missing on event panel")
|
||||||
|
|
||||||
def should_be_search_button(self) -> None:
|
|
||||||
"""Проверяет наличие кнопки поиска."""
|
|
||||||
|
|
||||||
self.search_button.check_visibility("Search button is missing on event panel")
|
|
||||||
|
|
||||||
def should_be_tab_buttons(self) -> None:
|
def should_be_tab_buttons(self) -> None:
|
||||||
"""Проверяет наличие блока tab-кнопок Состояния, Действия, События, Обслуживание, Системный журнал."""
|
"""Проверяет наличие блока tab-кнопок Состояния, Действия, События, Обслуживание, Системный журнал."""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class AddLocalUserModalWindow(ModalWindowComponent):
|
||||||
self.add_toolbar_button(locator_button_toolbar_close, "close")
|
self.add_toolbar_button(locator_button_toolbar_close, "close")
|
||||||
|
|
||||||
# Поле Имя
|
# Поле Имя
|
||||||
loc = f"{input_form_locator}/div[1]/{text_field_locator}"
|
loc = f"{input_form_locator}/div[2]/{text_field_locator}"
|
||||||
name_input = TextInput(page, self.page.locator(loc), "name_input")
|
name_input = TextInput(page, self.page.locator(loc), "name_input")
|
||||||
self.add_content_item("name_input", name_input)
|
self.add_content_item("name_input", name_input)
|
||||||
|
|
||||||
|
|
@ -83,22 +83,22 @@ class AddLocalUserModalWindow(ModalWindowComponent):
|
||||||
self.add_content_item("roles_list", DropdownList(page))
|
self.add_content_item("roles_list", DropdownList(page))
|
||||||
|
|
||||||
# Поле Пароль
|
# Поле Пароль
|
||||||
loc = f"{input_form_locator}/div[4]/{text_field_locator}"
|
loc = f"{input_form_locator}/div[5]/{text_field_locator}"
|
||||||
password_input = TextInput(page, self.page.locator(loc), "password_input")
|
password_input = TextInput(page, self.page.locator(loc), "password_input")
|
||||||
self.add_content_item("password_input", password_input)
|
self.add_content_item("password_input", password_input)
|
||||||
|
|
||||||
# Поле Комментарий
|
# Поле Комментарий
|
||||||
loc = f"{input_form_locator}/div[5]/{text_field_locator}"
|
loc = f"{input_form_locator}/div[6]/{text_field_locator}"
|
||||||
commentary_input = TextInput(page, self.page.locator(loc), "commentary_input")
|
commentary_input = TextInput(page, self.page.locator(loc), "commentary_input")
|
||||||
self.add_content_item("commentary_input", commentary_input)
|
self.add_content_item("commentary_input", commentary_input)
|
||||||
|
|
||||||
# Поле E-mail
|
# Поле E-mail
|
||||||
loc = f"{input_form_locator}/div[6]/{text_field_locator}"
|
loc = f"{input_form_locator}/div[7]/{text_field_locator}"
|
||||||
email_input = TextInput(page, self.page.locator(loc), "email_input")
|
email_input = TextInput(page, self.page.locator(loc), "email_input")
|
||||||
self.add_content_item("email_input", email_input)
|
self.add_content_item("email_input", email_input)
|
||||||
|
|
||||||
# Поле Номер для СМС
|
# Поле Номер для СМС
|
||||||
loc = f"{input_form_locator}/div[7]/{text_field_locator}"
|
loc = f"{input_form_locator}/div[8]/{text_field_locator}"
|
||||||
phone_input = TextInput(page, self.page.locator(loc), "phone_input")
|
phone_input = TextInput(page, self.page.locator(loc), "phone_input")
|
||||||
self.add_content_item("phone_input", phone_input)
|
self.add_content_item("phone_input", phone_input)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class EditUserModalWindow(ModalWindowComponent):
|
||||||
# Поле Имя
|
# Поле Имя
|
||||||
loc = (
|
loc = (
|
||||||
self.page.locator(input_form_locator)
|
self.page.locator(input_form_locator)
|
||||||
.locator("xpath=div[1]")
|
.locator("xpath=div[2]")
|
||||||
.locator(text_field_locator)
|
.locator(text_field_locator)
|
||||||
)
|
)
|
||||||
name_input = TextInput(page, loc, "name_input")
|
name_input = TextInput(page, loc, "name_input")
|
||||||
|
|
@ -69,7 +69,7 @@ class EditUserModalWindow(ModalWindowComponent):
|
||||||
# Поле Комментарий
|
# Поле Комментарий
|
||||||
loc = (
|
loc = (
|
||||||
self.page.locator(input_form_locator)
|
self.page.locator(input_form_locator)
|
||||||
.locator("xpath=div[4]")
|
.locator("xpath=div[5]")
|
||||||
.locator(text_field_locator)
|
.locator(text_field_locator)
|
||||||
)
|
)
|
||||||
commentary_input = TextInput(page, loc, "commentary_input")
|
commentary_input = TextInput(page, loc, "commentary_input")
|
||||||
|
|
@ -78,7 +78,7 @@ class EditUserModalWindow(ModalWindowComponent):
|
||||||
# Поле E-mail
|
# Поле E-mail
|
||||||
loc = (
|
loc = (
|
||||||
self.page.locator(input_form_locator)
|
self.page.locator(input_form_locator)
|
||||||
.locator("xpath=div[5]")
|
.locator("xpath=div[6]")
|
||||||
.locator(text_field_locator)
|
.locator(text_field_locator)
|
||||||
)
|
)
|
||||||
email_input = TextInput(page, loc, "email_input")
|
email_input = TextInput(page, loc, "email_input")
|
||||||
|
|
@ -87,7 +87,7 @@ class EditUserModalWindow(ModalWindowComponent):
|
||||||
# Поле Номер для СМС
|
# Поле Номер для СМС
|
||||||
loc = (
|
loc = (
|
||||||
self.page.locator(input_form_locator)
|
self.page.locator(input_form_locator)
|
||||||
.locator("xpath=div[6]")
|
.locator("xpath=div[7]")
|
||||||
.locator(text_field_locator)
|
.locator(text_field_locator)
|
||||||
)
|
)
|
||||||
phone_input = TextInput(page, loc, "phone_input")
|
phone_input = TextInput(page, loc, "phone_input")
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ class UserCard(BaseComponent):
|
||||||
"Expected text 'Время входа:' is missing in user card"
|
"Expected text 'Время входа:' is missing in user card"
|
||||||
)
|
)
|
||||||
session_time_str = self.session_time.get_text(0)
|
session_time_str = self.session_time.get_text(0)
|
||||||
assert session_time_str.find("Время сессии:") != -1, (
|
assert session_time_str.find("Время сеанса:") != -1, (
|
||||||
"Expected text 'Время сессии:' is missing in user card"
|
"Expected text 'Время сессии:' is missing in user card"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ class CurrentSessionsTab(BasePage):
|
||||||
expected_headers = [
|
expected_headers = [
|
||||||
'ID сеанса',
|
'ID сеанса',
|
||||||
'ID пользователя',
|
'ID пользователя',
|
||||||
'Время жизни',
|
'Время сеанса',
|
||||||
'Роль',
|
'Роль',
|
||||||
'Адрес'
|
'Адрес'
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,7 @@ class MainPage(BasePage):
|
||||||
|
|
||||||
return self.event_panel.check_expand_more_button()
|
return self.event_panel.check_expand_more_button()
|
||||||
|
|
||||||
|
|
||||||
def check_navigation_item_exists(self, item_name: str) -> bool:
|
def check_navigation_item_exists(self, item_name: str) -> bool:
|
||||||
"""Проверяет существование элемента в навигационной панели.
|
"""Проверяет существование элемента в навигационной панели.
|
||||||
|
|
||||||
|
|
@ -199,7 +200,6 @@ class MainPage(BasePage):
|
||||||
## to-do: кнопки галочки???
|
## to-do: кнопки галочки???
|
||||||
self.event_panel.should_be_tab_buttons()
|
self.event_panel.should_be_tab_buttons()
|
||||||
self.event_panel.should_be_event_buttons()
|
self.event_panel.should_be_event_buttons()
|
||||||
self.event_panel.should_be_search_button()
|
|
||||||
self.event_panel.should_be_user_button()
|
self.event_panel.should_be_user_button()
|
||||||
|
|
||||||
def should_be_navigation_panel(self) -> None:
|
def should_be_navigation_panel(self) -> None:
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,14 @@ class TestUserCard:
|
||||||
"""Фикстура для удаления тестового пользователя после теста."""
|
"""Фикстура для удаления тестового пользователя после теста."""
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
# Выход из системы текущего пользователя
|
# Выход из системы текущего пользователя
|
||||||
mp = MainPage(browser)
|
mp = MainPage(browser)
|
||||||
mp.wait_for_timeout(1000)
|
|
||||||
|
# Принудительное закрытике окна изменения пароля если оно все еще открыто
|
||||||
|
if mp.page.locator("div.v-dialog--active").is_visible():
|
||||||
|
mp.page.locator("div.v-dialog--active").get_by_role("button", name="Отменить").click()
|
||||||
|
|
||||||
mp.do_logout()
|
mp.do_logout()
|
||||||
|
|
||||||
# Авторизация администратором для очистки
|
# Авторизация администратором для очистки
|
||||||
|
|
@ -153,6 +158,7 @@ class TestUserCard:
|
||||||
change_password_window = user_card.click_change_password_button()
|
change_password_window = user_card.click_change_password_button()
|
||||||
change_password_window.check_content()
|
change_password_window.check_content()
|
||||||
|
|
||||||
|
# @pytest.mark.develop
|
||||||
def test_change_password_successful(self, browser: Page,
|
def test_change_password_successful(self, browser: Page,
|
||||||
create_user: None,
|
create_user: None,
|
||||||
cleanup_user: None) -> None:
|
cleanup_user: None) -> None:
|
||||||
|
|
@ -174,6 +180,7 @@ class TestUserCard:
|
||||||
is_changed, error = change_password_window.change_password(user_data["password"], user_data["new_password"])
|
is_changed, error = change_password_window.change_password(user_data["password"], user_data["new_password"])
|
||||||
assert is_changed, f"Unsucessful attempt to change password: {error}"
|
assert is_changed, f"Unsucessful attempt to change password: {error}"
|
||||||
|
|
||||||
|
# @pytest.mark.develop
|
||||||
def test_change_password_unsuccessful(self, browser: Page,
|
def test_change_password_unsuccessful(self, browser: Page,
|
||||||
create_user: None,
|
create_user: None,
|
||||||
cleanup_user: None) -> None:
|
cleanup_user: None) -> None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue