diff --git a/pages/header_page.py b/pages/header_page.py index 7fdf47a42e..de741d4681 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -434,26 +434,24 @@ def click_on_auth_external_links_in_header(self): print(*opened_pages) return opened_pages - @allure.step("Click on the 'More' button for every user") - def click_more_button(self): - return self.element_is_present_and_clickable(self.locators.MORE_BUTTON).click() - - @allure.step("Click on the 'Telegram' link for unauthorized user") - def click_on_Telegram_link(self): - self.element_is_present_and_clickable(self.locators.LINK_TELEGRAM).click() - self.driver.switch_to.window(self.driver.window_handles[1]) - return self.get_current_tab_url() - @allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs for unauthorized user""") def click_on_unauth_external_links_in_header(self): opened_pages = [] # Click on the 'Telegram' link - opened_pages.append(self.click_on_Telegram_link()) # to be continued - - print(*opened_pages) + opened_pages.append(self.click_on_Telegram_link()) + # Click on the 'GitHub' link + opened_pages.append(self.click_on_GitHub_link()) # to be continued return opened_pages + @allure.step("Click on the 'Telegram' link for unauthorized user") + def click_on_Telegram_link(self): + self.element_is_present_and_clickable(self.locators.LINK_TELEGRAM).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 63002ce559..be0e396408 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -129,6 +129,7 @@ def test_hpu_03_02_verify_unauth_internal_links_lead_to_correct_pages(self, driv assert all(element in hPD.set_unauth for element in opened_pages), \ "Some of internal links lead to incorrect pages after clicking" + @pytest.mark.skip("Unstable test environment") @allure.title("""Verify if external links in the Header for an unauthorized user lead to correct pages after click""") def test_hpu_03_03_verify_unauth_external_links_lead_to_correct_pages(self, driver, main_page_open): @@ -139,6 +140,13 @@ def test_hpu_03_03_verify_unauth_external_links_lead_to_correct_pages(self, driv assert all(element in hPD.set_unauth for element in opened_pages), \ "Some of external links lead to incorrect pages after clicking" + @allure.title("""Verify if external Telegram link in the Header for an unauthorized user + leads to a correct page after click""") + 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" + @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""") def test_hpu_03_04_verify_click_unauth_logo_link(self, driver, main_page_open):