diff --git a/locators/header_page_locators.py b/locators/header_page_locators.py index d7e525ad94..a3b3ed91b1 100644 --- a/locators/header_page_locators.py +++ b/locators/header_page_locators.py @@ -50,8 +50,8 @@ 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_DONATE_AUTH = (By.XPATH, "(//nav//a)[11]") - LINK_GITHUB_AUTH = (By.XPATH, "(//nav//a)[10]") + LINK_DONATE_AUTH = (By.XPATH, "(//nav//a)[10]") + LINK_GITHUB_AUTH = (By.XPATH, "(//nav//a)[11]") LINK_GROUPS_AUTH = (By.XPATH, "(//nav//a)[2]") LINK_STATISTICS_AUTH = (By.XPATH, "(//nav//a)[3]") LINK_PROFILE = (By.XPATH, "(//nav//a)[12]") diff --git a/pages/header_page.py b/pages/header_page.py index 5f128ad17c..0259f0fbf6 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -458,7 +458,16 @@ def click_on_Telegram_link_auth2(self): print(self.get_current_tab_url()) return current_tab_url - + @allure.step("Click on the 'Donate' link for authorized user") + def click_on_Donate_link_auth(self): + self.click_more_button() + self.element_is_present_and_clickable(self.locators1.LINK_DONATE_AUTH).click() + self.driver.switch_to.window(self.driver.window_handles[1]) + current_tab_url = self.get_current_tab_url() + print(current_tab_url) + self.driver.switch_to.window(self.driver.window_handles[0]) + print(self.get_current_tab_url()) + return current_tab_url @allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs for unauthorized user""") diff --git a/tests/header_test.py b/tests/header_test.py index 65c34e88b2..3d532abb87 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -371,6 +371,13 @@ def test_hpa_03_03_01_verify_auth_telegram_links_navigation(self, driver, auto_t assert opened_page2 in hPD.set_auth, "The Telegram link #2 leads to an incorrect page after clicking" assert opened_page1 == opened_page2, "The Telegram links #1,2 are the same" + @allure.title("""Verify if external Donate link in the Header for an authorized user + leads to the correct page after click""") + def test_hpa_03_03_02_verify_auth_donate_link_navigation(self, driver, auto_test_user_authorized): + page = hPage(driver) + opened_page = page.click_on_Donate_link_auth() + assert opened_page in hPD.set_auth, "The Donate link leads to an incorrect page after clicking" + @allure.title("""Verify that the Logo link on the Start Authorized Page refreshes the current page and doesn't lead to other pages after clicking""") def test_hpa_03_04_verify_click_auth_logo_link(self, driver, auto_test_user_authorized):