diff --git a/locators/header_page_locators.py b/locators/header_page_locators.py index a3b3ed91b1..4ec11c721f 100644 --- a/locators/header_page_locators.py +++ b/locators/header_page_locators.py @@ -53,6 +53,7 @@ class HeaderAuthorizedLocators: LINK_DONATE_AUTH = (By.XPATH, "(//nav//a)[10]") LINK_GITHUB_AUTH = (By.XPATH, "(//nav//a)[11]") 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_PROFILE = (By.XPATH, "(//nav//a)[12]") LINK_TELEGRAM_AUTH = (By.XPATH, "(//nav//a)[5]") diff --git a/pages/header_page.py b/pages/header_page.py index 0259f0fbf6..e1f47d5813 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -417,6 +417,14 @@ def click_on_direct_internal_links_in_header_auth(self): return opened_pages + @allure.step("Click on the 'Groups' link #2 for authorized user") + 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 external links in the Header and thereby open corresponding web pages on new tabs for authorized user""") def click_on_auth_external_links_in_header(self): diff --git a/test_data/header_data.py b/test_data/header_data.py index 158e7c33ea..6afcc5e0a0 100644 --- a/test_data/header_data.py +++ b/test_data/header_data.py @@ -53,8 +53,9 @@ class HeaderData: s11 = "https://github.com/Brain-up/brn" # dropdown s12 = "https://opencollective.com/brainup" # dropdown s13 = "https://t.me/BrainUpUsers" #, # dropdown + s14 = f"{s}groups" - set_auth = (s, s0, s1, s2, s3, s4, s5, s6, s7, s9, s10, s11, s12, s13) + set_auth = (s, s0, s1, s2, s3, s4, s5, s6, s7, s9, s10, s11, s12, s13, s14) set_unauth = (s, s1, s2, s3, s8, s9, s10, s11, s12, s13) link_status_codes = (200,) diff --git a/tests/header_test.py b/tests/header_test.py index 3d532abb87..27818a1443 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -344,12 +344,19 @@ def test_hpa_03_02_verify_auth_internal_links_lead_to_proper_pages(self, driver, @allure.title("""Verify if direct internal links in the Header for an authorized user lead to correct pages after click""") - def test_hpa_03_02_1_verify_auth_direct_internal_links_navigation(self, driver, auto_test_user_authorized): + 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""") + 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" + @pytest.mark.skip("Unstable test environment") @allure.title("""Verify if external links in the Header for an authorized user lead to correct pages after click""")