diff --git a/pages/header_page.py b/pages/header_page.py index de741d4681..292c0966fa 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -452,6 +452,15 @@ def click_on_Telegram_link(self): print(current_tab_url) return current_tab_url + @allure.step("Click on the 'GitHub' link for unauthorized user") + def click_on_GitHub_link(self): + self.click_more_button() + self.element_is_present_and_clickable(self.locators.LINK_GITHUB).click() + self.driver.switch_to.window(self.driver.window_handles[1]) + current_tab_url = self.get_current_tab_url() + print(current_tab_url) + return current_tab_url + @allure.step("Click on the 'Logo' link for every user") def click_on_logo_link(self): diff --git a/tests/header_test.py b/tests/header_test.py index be0e396408..84f91ea9bd 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -145,7 +145,14 @@ def test_hpu_03_03_verify_unauth_external_links_lead_to_correct_pages(self, driv def test_hpu_03_03_01_verify_unauth_Telegram_link_navigation(self, driver, main_page_open): page = hPage(driver) opened_page = page.click_on_Telegram_link() - assert opened_page in hPD.set_unauth, "The Telegram link leads to incorrect page after clicking" + assert opened_page in hPD.set_unauth, "The Telegram link leads to an incorrect page after clicking" + + @allure.title("""Verify if external GitHub link in the Header for an unauthorized user + leads to a correct page after click""") + def test_hpu_03_03_02_verify_unauth_GitHub_link_navigation(self, driver, main_page_open): + page = hPage(driver) + opened_page = page.click_on_GitHub_link() + assert opened_page in hPD.set_unauth, "The GitHub link leads to an incorrect page after clicking" @allure.title("""Verify that the 'Logo' link on the Start Unauthorized Page doesn't refresh the current page or lead to other pages after clicking""")