diff --git a/locators/header_page_locators.py b/locators/header_page_locators.py index 4ec11c721f..b4b6dca3a7 100644 --- a/locators/header_page_locators.py +++ b/locators/header_page_locators.py @@ -55,6 +55,7 @@ class HeaderAuthorizedLocators: LINK_GROUPS_AUTH = (By.XPATH, "(//nav//a)[2]") LINK_GROUPS_AUTH2 = (By.XPATH, "(//nav//a)[6]") LINK_STATISTICS_AUTH = (By.XPATH, "(//nav//a)[3]") + LINK_STATISTICS_AUTH2 = (By.XPATH, "(//nav//a)[7]") LINK_PROFILE = (By.XPATH, "(//nav//a)[12]") LINK_TELEGRAM_AUTH = (By.XPATH, "(//nav//a)[5]") LINK_TELEGRAM_AUTH2 = (By.XPATH, "(//nav//a)[9]") diff --git a/pages/header_page.py b/pages/header_page.py index e1f47d5813..4f7caaf453 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -341,7 +341,7 @@ def get_links_href_unauth(self): @allure.step("Get attribute 'href' of links in the Header for an authorized user") def get_links_href_auth(self): att = [element.get_attribute("href") for element in self.get_list_of_links_auth()] - # print(*att, len(att), sep='\n') + print(*att, len(att), sep='\n') return att # return [element.get_attribute("href") for element in self.get_list_of_links_auth()] @@ -422,6 +422,14 @@ def click_on_Groups_link_auth2(self): self.click_more_button() self.element_is_present_and_clickable(self.locators1.LINK_GROUPS_AUTH2).click() current_tab_url = self.get_current_tab_url() + # print(current_tab_url) + return current_tab_url + + @allure.step("Click on the 'Statistics' link #2 for authorized user") + def click_on_Statistics_link_auth2(self): + self.click_more_button() + self.element_is_present_and_clickable(self.locators1.LINK_STATISTICS_AUTH2).click() + current_tab_url = self.get_current_tab_url() print(current_tab_url) return current_tab_url diff --git a/tests/header_test.py b/tests/header_test.py index 27818a1443..e73d9d1c64 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -331,9 +331,9 @@ def test_hpa_03_01_verify_auth_header_links(self, driver, auto_test_user_authori assert all(element in hPD.link_status_codes for element in link_status_codes), \ "Status codes of links mismatch valid values" - @pytest.mark.xfail - @allure.title("""Verify if internal links in the Header for an authorized user - lead to correct pages after click""") + @pytest.mark.skip + @allure.title("""test_hpa.03.02 Verify if internal links in the Header for an authorized user + lead to correct pages after clicking""") def test_hpa_03_02_verify_auth_internal_links_lead_to_proper_pages(self, driver, auto_test_user_authorized): page = hPage(driver) internal_links_in_more = page.get_list_of_internal_links_in_more() @@ -342,20 +342,27 @@ def test_hpa_03_02_verify_auth_internal_links_lead_to_proper_pages(self, driver, assert all(element in hPD.set_auth for element in opened_pages), \ "Some of internal links lead to incorrect pages after clicking" - @allure.title("""Verify if direct internal links in the Header for an authorized user - lead to correct pages after click""") + @allure.title("""test_hpa.03.02.01 Verify if direct internal links in the Header for an authorized user + lead to correct pages after clicking""") def test_hpa_03_02_01_verify_auth_direct_internal_links_navigation(self, driver, auto_test_user_authorized): page = hPage(driver) opened_pages = page.click_on_direct_internal_links_in_header_auth() assert all(element in hPD.set_auth for element in opened_pages), \ "Some of direct internal links lead to incorrect pages after clicking" - @allure.title("""Verify if internal 'Group' link #2 in the Header for an authorized user - leads to the correct page after click""") + @allure.title("""test_hpa.03.02.02 Verify if internal 'Groups' link #2 in the Header for an authorized user + leads to the correct page after clicking""") def test_hpa_03_02_02_verify_auth_groups_link2_navigation(self, driver, auto_test_user_authorized): page = hPage(driver) opened_page2 = page.click_on_Groups_link_auth2() - assert opened_page2 in hPD.set_auth, "The Group link #2 leads to an incorrect page after clicking" + assert opened_page2 in hPD.set_auth, "The Groups link #2 leads to an incorrect page after clicking" + + @allure.title("""test_hpa.03.02.03 Verify if internal 'Statistics' link #2 in the Header + for an authorized user leads to the correct page after clicking""") + def test_hpa_03_02_03_verify_auth_statistics_link2_navigation(self, driver, auto_test_user_authorized): + page = hPage(driver) + opened_page2 = page.click_on_Statistics_link_auth2() + assert opened_page2 in hPD.set_auth, "The Statistics link #2 leads to an incorrect page after clicking" @pytest.mark.skip("Unstable test environment") @allure.title("""Verify if external links in the Header for an authorized user