diff --git a/pages/header_page.py b/pages/header_page.py index bc6cf6f352..ce72e18230 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -146,6 +146,12 @@ def get_list_of_external_links_in_more(self): # return self.get_list_of_links_in_more()[4:6] return self.get_list_of_links_in_more()[:3] + @allure.step("""Get the list of the 'Donate', 'GitHub' links (external links) + in the 'More' dropdown for authorized user""") + def get_list_of_external_links_in_more_auth(self): + return self.get_list_of_links_in_more()[4:7] + # return self.get_list_of_links_in_more()[:3] + @allure.step("Get the general list of internal links in the Header for an unauthorized user""") def get_list_of_internal_links(self): links = self.get_list_of_links_unauth() @@ -414,10 +420,11 @@ def click_on_external_links_in_header(self): opened_pages = [] # Click on the 'Telegram' link self.element_is_present_and_clickable(self.locators.LINK_TELEGRAM).click() + # Click on the 'GitHub', 'Donate' links self.click_more_button() - new_tabs = [link.click() for link in self.get_list_of_external_links_in_more()] + 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): diff --git a/tests/header_test.py b/tests/header_test.py index 0506545889..1962af0705 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -330,11 +330,11 @@ def test_hpa_03_02_1_verify_auth_direct_internal_links_navigation(self, driver, 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): page = hPage(driver) - external_links_in_more = page.get_list_of_external_links_in_more() - # opened_pages = page.click_on_external_links_in_header() + external_links_in_more = page.get_list_of_external_links_in_more_auth() + opened_pages = page.click_on_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" + assert all(element in hPD.set_auth for element in opened_pages), \ + "Some of external links lead to incorrect pages 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""")