From 5f55fa2f9ac96a88bee8aa5d85cd0d197526fbfe Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Sun, 5 Jul 2026 16:31:25 +0300 Subject: [PATCH] add test_hpa_03.02.04_verify_auth_About2_link_navigation update header_test.py, header_page.py, header_page_locators.py #268 --- locators/header_page_locators.py | 1 + pages/header_page.py | 10 +++++++++- tests/header_test.py | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/locators/header_page_locators.py b/locators/header_page_locators.py index b4b6dca3a7..4f53c8951d 100644 --- a/locators/header_page_locators.py +++ b/locators/header_page_locators.py @@ -50,6 +50,7 @@ class HeaderAuthorizedLocators: HEADER_ICONS = (By.XPATH, "//nav//*[name()='svg']") HEADPHONE_ICON = (By.XPATH, "(//nav//*[name()='svg'])[2]") LINK_ABOUT_AUTH = (By.XPATH, "(//nav//a)[4]") + LINK_ABOUT_AUTH2 = (By.XPATH, "(//nav//a)[8]") LINK_DONATE_AUTH = (By.XPATH, "(//nav//a)[10]") LINK_GITHUB_AUTH = (By.XPATH, "(//nav//a)[11]") LINK_GROUPS_AUTH = (By.XPATH, "(//nav//a)[2]") diff --git a/pages/header_page.py b/pages/header_page.py index 4f7caaf453..104b49e81a 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -413,7 +413,7 @@ def click_on_direct_internal_links_in_header_auth(self): Wait(self.driver, 10).until(EC.url_changes(current_url)) current_url = self.get_current_tab_url() opened_pages.append(current_url) # to be continued - print(opened_pages) + # print(opened_pages) return opened_pages @@ -430,6 +430,14 @@ def click_on_Statistics_link_auth2(self): self.click_more_button() self.element_is_present_and_clickable(self.locators1.LINK_STATISTICS_AUTH2).click() current_tab_url = self.get_current_tab_url() + # print(current_tab_url) + return current_tab_url + + @allure.step("Click on the 'About' link #2 for authorized user") + def click_on_About_link_auth2(self): + self.click_more_button() + self.element_is_present_and_clickable(self.locators1.LINK_ABOUT_AUTH2).click() + current_tab_url = self.get_current_tab_url() print(current_tab_url) return current_tab_url diff --git a/tests/header_test.py b/tests/header_test.py index e73d9d1c64..4c2955ec62 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -364,6 +364,13 @@ def test_hpa_03_02_03_verify_auth_statistics_link2_navigation(self, driver, auto opened_page2 = page.click_on_Statistics_link_auth2() assert opened_page2 in hPD.set_auth, "The Statistics link #2 leads to an incorrect page after clicking" + @allure.title("""test_hpa.03.02.04 Verify if internal 'About' link #2 in the Header + for an authorized user leads to the correct page after clicking""") + def test_hpa_03_02_04_verify_auth_about_link2_navigation(self, driver, auto_test_user_authorized): + page = hPage(driver) + 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""")