From 91df7365222ad6630555c3fd8692427475220885 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Tue, 21 Jul 2026 15:58:15 +0300 Subject: [PATCH] ref test_hpa_03.03 Verify links in the Header's dropdown for an authorized user update header_test.py, header_page.py #268 --- pages/header_page.py | 6 +++--- tests/header_test.py | 18 +++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pages/header_page.py b/pages/header_page.py index 200a46246b..c2f037eb9f 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -455,7 +455,7 @@ def click_on_About_link_auth2(self): return current_tab_url @allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs - for authorized user""") + for authorized user -- unusable till changing UI""") def click_on_auth_external_links_in_header(self): opened_pages = [] # Click on the 'Telegram' link @@ -467,8 +467,8 @@ def click_on_auth_external_links_in_header(self): new_tabs = [link.click() for link in self.get_list_of_external_links_in_more_auth()] print(len(new_tabs)) # Get the list of opened tabs urls - for i in range(1, len(new_tabs) + 2): - # for i in range(len(new_tabs)): + # for i in range(1, len(new_tabs) + 2): + for i in range(len(new_tabs)): self.driver.switch_to.window(self.driver.window_handles[i]) opened_pages.append(self.get_current_tab_url()) print(*opened_pages) diff --git a/tests/header_test.py b/tests/header_test.py index 002a0b8867..82362398b5 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -374,19 +374,15 @@ def test_hpa_03_02_04_verify_auth_about_link2_navigation(self, driver, auto_test opened_page2 = page.click_on_About_link_auth2() assert opened_page2 in hPD.set_auth, "The About link #2 leads to an incorrect page after clicking" - @pytest.mark.skip("Unstable test environment") - @allure.title("""Verify if external links in the Header for an authorized user - lead to correct pages after click""") - def test_hpa_03_03_verify_auth_external_links_lead_to_proper_pages(self, driver, auto_test_user_authorized): + @allure.title("""test_hpa.03.03 Verify the list of external links in the Header's dropdown + for an authorized user""") + def test_hpa_03_03_verify_auth_external_links_in_dropdown(self, driver, auto_test_user_authorized): page = hPage(driver) - external_links_in_more = page.get_list_of_external_links_in_more_auth() - opened_pages = page.click_on_auth_external_links_in_header() - assert external_links_in_more, "External links are not collected in the list" - assert all(element in hPD.set_auth for element in opened_pages), \ - "Some of external links lead to incorrect pages after clicking" + external_links_in_dropdown = page.get_list_of_external_links_in_more_auth() + assert external_links_in_dropdown, "External links are not collected in the list" - @allure.title("""test_hpa.03.03.01 Verify if external Telegram links #1,2 in the Header for an authorized user - lead to the correct page after clicking""") + @allure.title("""test_hpa.03.03.01 Verify if external Telegram links #1,2 in the Header + for an authorized user lead to the correct page after clicking""") def test_hpa_03_03_01_verify_auth_telegram_links_navigation(self, driver, auto_test_user_authorized): page = hPage(driver) opened_page1 = page.click_on_Telegram_link_auth1()