From abf1a89bc324d891b56feb441a21c9cc1cbdc5b8 Mon Sep 17 00:00:00 2001 From: nsubbot Date: Wed, 25 Feb 2026 09:07:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=BA=D1=82=D1=83=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=82=D0=B5=D1=81=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D1=85=D0=BE=D0=B4=D0=B0=20=D0=BD=D0=B0=20=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=81=D0=B8=D1=8E=201.33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container_maintenance_events.py | 2 -- .../test_actions_events_container.py | 29 +++++++++++-------- tests/e2e/users/test_user_card.py | 7 +++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/components_derived/container_maintenance_events.py b/components_derived/container_maintenance_events.py index 0e6103e..cbcd81f 100644 --- a/components_derived/container_maintenance_events.py +++ b/components_derived/container_maintenance_events.py @@ -37,7 +37,6 @@ class MaintenanceEventsContainer(EventsContainerComponent): self.add_tab_to_toolbar(toolbar_locator.locator(EventPanelLocators.CSV_TOOLBAR_BUTTON), "export_to_csv_button") events_filter = self.get_events_filter() - events_filter.add_filtering_parameter("filter_date", "Дата") events_filter.add_filtering_parameter("filter_event_name", "Наименование события") events_filter.add_filtering_parameter("filter_type", "Тип") events_filter.add_filtering_parameter("filter_status", "Состояние") @@ -76,7 +75,6 @@ class MaintenanceEventsContainer(EventsContainerComponent): events_filter = self.click_filter_button() events_filter.check_content() - events_filter.should_be_filtering_parameter("Дата") events_filter.should_be_filtering_parameter("Наименование события") events_filter.should_be_filtering_parameter("Тип") events_filter.should_be_filtering_parameter("Состояние") diff --git a/tests/e2e/event_panel/test_actions_events_container.py b/tests/e2e/event_panel/test_actions_events_container.py index 0920343..fad6bee 100644 --- a/tests/e2e/event_panel/test_actions_events_container.py +++ b/tests/e2e/event_panel/test_actions_events_container.py @@ -55,8 +55,10 @@ class TestActionsEventsContainer: # Проверка выделения строк actions_events_container.check_events_table_row_highlighting(0) - actions_events_container.check_events_table_row_highlighting(rows_count - 1) - actions_events_container.check_events_table_row_highlighting(int(rows_count / 2)) + if rows_count > 1: + actions_events_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + actions_events_container.check_events_table_row_highlighting(int(rows_count / 2)) actions_events_container.click_archive_button() # Получение количества строк в таблице Архив @@ -64,12 +66,14 @@ class TestActionsEventsContainer: # Проверка выделения строк actions_events_container.check_events_table_row_highlighting(0) - actions_events_container.check_events_table_row_highlighting(rows_count - 1) - actions_events_container.check_events_table_row_highlighting(int(rows_count / 2)) + if rows_count > 1: + actions_events_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + actions_events_container.check_events_table_row_highlighting(int(rows_count / 2)) - # @pytest.mark.develop + @pytest.mark.develop def test_events_table_scrolling(self, browser: Page): - """Проверяет возможность скроллинга таблицы событий. + """Проверяет возможность скроллинга таблицы событий на примере таблицы Архив. Args: browser: Экземпляр страницы Playwright. @@ -82,18 +86,19 @@ class TestActionsEventsContainer: mp.should_be_event_panel() actions_events_container = mp.click_events_panel_actions_tab() + actions_events_container.click_archive_button() events_panel_position = mp.get_events_panel_position() # Проверка, что панель с таблицей открыта - assert events_panel_position != "bottom", "Panel with system log events should be opened" + assert events_panel_position != "bottom", "Panel with actions events should be opened" is_scrollable = actions_events_container.check_events_table_verticall_scrolling() # Убеждаемся, что панель открыта наполовину и проверяем скроллинг assert events_panel_position == "center",\ - "Panel with system log events should be located on the main page center" - assert is_scrollable, "System log events table should be scrollable" + "Panel with actions events should be located on the main page center" + assert is_scrollable, "Actions events table should be scrollable" # Скроллинг вниз actions_events_container.scroll_events_table_down() @@ -117,10 +122,10 @@ class TestActionsEventsContainer: events_panel_position = mp.get_events_panel_position() assert events_panel_position == "top",\ - "Panel with system log events should be located on the main page top" + "Panel with actions events should be located on the main page top" is_scrollable = actions_events_container.check_events_table_verticall_scrolling() - assert is_scrollable, "System log events table should be scrollable in the full window" + assert is_scrollable, "Actions events table should be scrollable in the full window" # Скроллинг вниз actions_events_container.scroll_events_table_down() @@ -239,7 +244,7 @@ class TestActionsEventsContainer: # convert2timestamp=True) # assert is_descending_order, "Column data should be in descending order" - @pytest.mark.develop + # @pytest.mark.develop def test_real_time_events_table_pagination(self, browser: Page): """Проверяет возможность пагинации таблицы событий. diff --git a/tests/e2e/users/test_user_card.py b/tests/e2e/users/test_user_card.py index d0a2420..a1bef2e 100644 --- a/tests/e2e/users/test_user_card.py +++ b/tests/e2e/users/test_user_card.py @@ -10,7 +10,7 @@ from pages.users_tab import UsersTab from pages.main_page import MainPage from pages.login_page import LoginPage -user_data = {"name": "TestUserForChangePwd", "role": "Администратор", "password": "qwerty1234567", "new_password": "ytrewq7654321"} +user_data = {"name": "TestUserForChangePwd", "role": "Оператор", "password": "qwerty1234567", "new_password": "ytrewq7654321"} # @pytest.mark.smoke class TestUserCard: @@ -81,6 +81,7 @@ class TestUserCard: mp_admin = MainPage(browser) mp_admin.click_main_navigation_panel_item("Настройки") mp_admin.click_subpanel_item("Пользователи") + mp.wait_for_timeout(1000) ut = UsersTab(browser) ut.open_edit_user_page_by_user(user_data["name"], user_data["role"]) @@ -180,7 +181,7 @@ class TestUserCard: 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}" - @pytest.mark.develop + # @pytest.mark.develop def test_change_password_unsuccessful(self, browser: Page, create_user: None, cleanup_user: None) -> None: @@ -209,6 +210,7 @@ class TestUserCard: change_password_window.check_error_message("Пароли не совпадают") change_password_window.click_cancel_button() + mp.wait_for_timeout(1000) # Используется неправильный старый пароль user_card = mp.click_user_button() @@ -217,6 +219,7 @@ class TestUserCard: is_changed, _ = change_password_window.change_password("123456789123", user_data["new_password"]) assert not is_changed, "Sucessful attempt to change password for incorrect old password" change_password_window.click_cancel_button() + mp.wait_for_timeout(1000) # Пустое поле ввода пароля на примере поля ввода старого пароля