From 036f86efadbe3f646c600b8d5d4902fda9ae7a70 Mon Sep 17 00:00:00 2001 From: nsubbot Date: Mon, 23 Mar 2026 15:20:25 +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=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D1=8B=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D1=8B=20=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components_derived/selection_bar_component.py | 5 ++-- locators/selection_bar_locators.py | 1 + .../test_actions_events_container.py | 26 ++++++++++--------- .../test_audit_events_container.py | 9 ++++--- .../test_audit_events_container_security.py | 11 +++++--- .../event_panel/test_events_tab_container.py | 13 ++++++---- .../test_maintenance_events_container.py | 16 +++++++----- .../test_system_log_events_container.py | 11 +++++--- 8 files changed, 56 insertions(+), 36 deletions(-) diff --git a/components_derived/selection_bar_component.py b/components_derived/selection_bar_component.py index 686a85e..c5f5741 100644 --- a/components_derived/selection_bar_component.py +++ b/components_derived/selection_bar_component.py @@ -76,7 +76,7 @@ class SelectionBarComponent(BaseComponent): options = self.selected_values_list.get_item_names( SelectionBarLocators.LIST_ITEMS ) - + # Закрываем список (кликаем вне его) self.page.mouse.click(10, 10) self.wait_for_timeout(500) @@ -153,7 +153,8 @@ class SelectionBarComponent(BaseComponent): self.selection_bar_locator.click(force=True) # Ждем появления выпадающего списка - self.wait_for_timeout(1500) + self.page.locator(SelectionBarLocators.LIST_ACTIVE).wait_for() + # self.wait_for_timeout(1500) def select_value(self, name: str) -> None: """Выбор значения из списка""" diff --git a/locators/selection_bar_locators.py b/locators/selection_bar_locators.py index 001e994..4c488c3 100644 --- a/locators/selection_bar_locators.py +++ b/locators/selection_bar_locators.py @@ -19,6 +19,7 @@ class SelectionBarLocators: PARAMETERS_SELECTED = "div.v-select__selections" # Локаторы для элементов выпадающего списка + LIST_ACTIVE = "//div[contains(@class, 'menuable__content__active')]" LISTBOX = "//div[@role='list']" LIST_ITEMS = "//div[contains(@class, 'menuable__content__active')]//div[@role='list']//div[@role='listitem']" diff --git a/tests/e2e/event_panel/test_actions_events_container.py b/tests/e2e/event_panel/test_actions_events_container.py index fad6bee..5cdd153 100644 --- a/tests/e2e/event_panel/test_actions_events_container.py +++ b/tests/e2e/event_panel/test_actions_events_container.py @@ -53,23 +53,25 @@ class TestActionsEventsContainer: # Получение количества строк в таблице Реальное время rows_count = actions_events_container.get_events_table_rows_count() - # Проверка выделения строк - actions_events_container.check_events_table_row_highlighting(0) - 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)) + if rows_count != 0: + # Проверка выделения строк + actions_events_container.check_events_table_row_highlighting(0) + 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() # Получение количества строк в таблице Архив rows_count = actions_events_container.get_events_table_rows_count() - # Проверка выделения строк - actions_events_container.check_events_table_row_highlighting(0) - 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)) + if rows_count != 0: + # Проверка выделения строк + actions_events_container.check_events_table_row_highlighting(0) + 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 def test_events_table_scrolling(self, browser: Page): diff --git a/tests/e2e/event_panel/test_audit_events_container.py b/tests/e2e/event_panel/test_audit_events_container.py index 5b3c9f3..db6a14c 100644 --- a/tests/e2e/event_panel/test_audit_events_container.py +++ b/tests/e2e/event_panel/test_audit_events_container.py @@ -52,10 +52,13 @@ class TestAuditEventsContainer: # Получение количества строк в таблице rows_count = audit_events_container.get_events_table_rows_count() + if rows_count != 0: # Проверка выделения строк - audit_events_container.check_events_table_row_highlighting(0) - audit_events_container.check_events_table_row_highlighting(rows_count - 1) - audit_events_container.check_events_table_row_highlighting(int(rows_count / 2)) + audit_events_container.check_events_table_row_highlighting(0) + if rows_count > 1: + audit_events_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + audit_events_container.check_events_table_row_highlighting(int(rows_count / 2)) def test_events_table_scrolling(self, browser: Page): """Проверяет возможность скроллинга таблицы событий. diff --git a/tests/e2e/event_panel/test_audit_events_container_security.py b/tests/e2e/event_panel/test_audit_events_container_security.py index e506acb..44ac2c8 100644 --- a/tests/e2e/event_panel/test_audit_events_container_security.py +++ b/tests/e2e/event_panel/test_audit_events_container_security.py @@ -103,10 +103,13 @@ class TestAuditEventsContainerSecurity: # Получение количества строк в таблице rows_count = security_events_container.get_events_table_rows_count() - # Проверка выделения строк - security_events_container.check_events_table_row_highlighting(0) - security_events_container.check_events_table_row_highlighting(rows_count - 1) - security_events_container.check_events_table_row_highlighting(int(rows_count / 2)) + if rows_count != 0: + # Проверка выделения строк + security_events_container.check_events_table_row_highlighting(0) + if rows_count > 1: + security_events_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + security_events_container.check_events_table_row_highlighting(int(rows_count / 2)) # Выход из системы текущего пользователя mp.do_logout() diff --git a/tests/e2e/event_panel/test_events_tab_container.py b/tests/e2e/event_panel/test_events_tab_container.py index 6d53750..969e399 100644 --- a/tests/e2e/event_panel/test_events_tab_container.py +++ b/tests/e2e/event_panel/test_events_tab_container.py @@ -34,7 +34,7 @@ class TestEventsTabContainer: events_tab_container = mp.click_events_panel_events_tab() events_tab_container.check_content() - @pytest.mark.skip(reason="Отсутствуют данные для вывода в таблицу событий") + #@pytest.mark.skip(reason="Отсутствуют данные для вывода в таблицу событий") def test_events_table_row_highlighting(self, browser: Page): """Проверяет выделение строк в таблице событий. @@ -53,10 +53,13 @@ class TestEventsTabContainer: # Получение количества строк в таблице rows_count = events_tab_container.get_events_table_rows_count() - # Проверка выделения строк - events_tab_container.check_events_table_row_highlighting(0) - events_tab_container.check_events_table_row_highlighting(rows_count - 1) - events_tab_container.check_events_table_row_highlighting(int(rows_count / 2)) + if rows_count != 0: + # Проверка выделения строк + events_tab_container.check_events_table_row_highlighting(0) + if rows_count > 1: + events_tab_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + events_tab_container.check_events_table_row_highlighting(int(rows_count / 2)) @pytest.mark.skip(reason="Отсутствуют данные для вывода в таблицу событий") def test_events_table_scrolling(self, browser: Page): diff --git a/tests/e2e/event_panel/test_maintenance_events_container.py b/tests/e2e/event_panel/test_maintenance_events_container.py index 8a0ea69..aba0f34 100644 --- a/tests/e2e/event_panel/test_maintenance_events_container.py +++ b/tests/e2e/event_panel/test_maintenance_events_container.py @@ -34,7 +34,6 @@ class TestMaintenanceEventsContainer: maintenance_events_container = mp.click_events_panel_maintenance_tab() maintenance_events_container.check_content() - @pytest.mark.skip(reason="Отсутствуют данные для вывода в таблицу событий") def test_events_table_row_highlighting(self, browser: Page): """Проверяет выделение строк в таблице событий. @@ -52,11 +51,13 @@ class TestMaintenanceEventsContainer: # Получение количества строк в таблице rows_count = maintenance_events_container.get_events_table_rows_count() - - # Проверка выделения строк - maintenance_events_container.check_events_table_row_highlighting(0) - maintenance_events_container.check_events_table_row_highlighting(rows_count - 1) - maintenance_events_container.check_events_table_row_highlighting(int(rows_count / 2)) + if rows_count != 0: + # Проверка выделения строк + maintenance_events_container.check_events_table_row_highlighting(0) + if rows_count > 1: + maintenance_events_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + maintenance_events_container.check_events_table_row_highlighting(int(rows_count / 2)) @pytest.mark.skip(reason="Отсутствуют данные для вывода в таблицу событий") def test_events_table_scrolling(self, browser: Page): @@ -74,6 +75,9 @@ class TestMaintenanceEventsContainer: maintenance_events_container = mp.click_events_panel_maintenance_tab() + # Получение количества строк в таблице + # rows_count = maintenance_events_container.get_events_table_rows_count() + events_panel_position = mp.get_events_panel_position() # Проверка, что панель с таблицей открыта diff --git a/tests/e2e/event_panel/test_system_log_events_container.py b/tests/e2e/event_panel/test_system_log_events_container.py index 223fa2e..06c4d8d 100644 --- a/tests/e2e/event_panel/test_system_log_events_container.py +++ b/tests/e2e/event_panel/test_system_log_events_container.py @@ -55,10 +55,13 @@ class TestSystemLogEventsContainer: # Получение количества строк в таблице rows_count = system_log_events_container.get_events_table_rows_count() - # Проверка выделения строк - system_log_events_container.check_events_table_row_highlighting(0) - system_log_events_container.check_events_table_row_highlighting(rows_count - 1) - system_log_events_container.check_events_table_row_highlighting(int(rows_count / 2)) + if rows_count != 0: + # Проверка выделения строк + system_log_events_container.check_events_table_row_highlighting(0) + if rows_count > 1: + system_log_events_container.check_events_table_row_highlighting(rows_count - 1) + if rows_count > 3: + system_log_events_container.check_events_table_row_highlighting(int(rows_count / 2)) def test_events_table_scrolling(self, browser: Page): """Проверяет возможность скроллинга таблицы событий.