diff --git a/pages/header_page.py b/pages/header_page.py index c5cebcc6d9..a9084e2d11 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -121,16 +121,24 @@ def get_direct_external_links_auth_list(self): for i in [3]: direct_external_links.append(direct_links[i]) att3 = [element.get_attribute("href") for element in direct_external_links] - print(*att3, len(att3), sep='\n') + # print(*att3, len(att3), sep='\n') return direct_external_links - @allure.step("""Get the list of links in the 'More' dropdown in the Header for an AUTHORIZED user""") + @allure.step("""Get the list of links in the 'More' dropdown in the Header for an AUTHORIZED user -- ACTUAL""") def get_dropdown_links_auth_list(self): dropdown_auth_links = self.elements_are_present(self.locators1.DROPDOWN_LINKS_AUTH) att1 = [element.get_attribute("href") for element in dropdown_auth_links] # print(*att1, len(att1), sep='\n') return dropdown_auth_links + @allure.step("""Get the list of the 'Telegram', 'Donate', 'GitHub' links (external links) + in the 'More' dropdown in the Header for AUTHORIZED user -- ACTUAL""") + def get_dropdown_external_links_auth_list(self): + links = self.get_dropdown_links_auth_list()[3:6] + att = [element.get_attribute("href") for element in links] + print(*att, len(att), sep='\n') + return links + @allure.step("Check the 'About', 'Telegram', 'Registration', 'Logo' links are visible for an unauthorized user") def check_direct_links_visibility_unauth(self): @@ -178,19 +186,11 @@ def get_list_of_internal_links_in_more(self): # return self.get_list_of_links_in_more()[2:] @allure.step("""Get the list of the 'Donate', 'GitHub' links (external links) - in the 'More' dropdown for every user -- FOR REVIEW""") + in the 'More' dropdown for an unauthorized user -- FOR REVIEW""") 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 -- FOR REVIEW""") - def get_list_of_external_links_in_more_auth(self): - links = self.get_list_of_links_in_more()[3:6] - att = [element.get_attribute("href") for element in links] - # print(*att, len(att), sep='\n') - return links - @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() @@ -552,7 +552,7 @@ def click_on_auth_external_links_in_header(self): # 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_auth()] + new_tabs = [link.click() for link in self.get_dropdown_external_links_auth_list()] 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 fed50aa87f..ca36b98c87 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -443,7 +443,7 @@ def test_hpa_03_03_08_verify_auth_audiometry_link_navigation(self, driver, auto_ for an authorized user""") def test_hpa_03_03_09_verify_auth_dropdown_external_links(self, driver, auto_test_user_authorized): page = hPage(driver) - external_links_in_dropdown = page.get_list_of_external_links_in_more_auth() + external_links_in_dropdown = page.get_dropdown_external_links_auth_list() assert external_links_in_dropdown, "External links are not collected in the list" @allure.title("""test_hpa.03.03.10 Verify if external Telegram link #2 in the Header's dropdown