From b37a3d43c4e82452f6dee928024c0ace686801b1 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Wed, 12 Aug 2026 13:19:24 +0300 Subject: [PATCH] add test_hpa_03.03.05 Verify Specialists link in the Header's dropdown for an authorized user update header_test.py, header_page.py, header_page_locators.py #268 --- locators/header_page_locators.py | 1 + pages/header_page.py | 39 ++++++++++++++++++++------------ tests/header_test.py | 4 +++- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/locators/header_page_locators.py b/locators/header_page_locators.py index d73730afbb..0346275fcf 100644 --- a/locators/header_page_locators.py +++ b/locators/header_page_locators.py @@ -57,6 +57,7 @@ class HeaderAuthorizedLocators: 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_SPECIALISTS_AUTH = (By.XPATH, "(//nav//a)[13]") LINK_STATISTICS_AUTH1 = (By.XPATH, "(//nav//a)[3]") LINK_STATISTICS_AUTH2 = (By.XPATH, "(//nav//a)[7]") LINK_STATISTICS_AUTH3 = (By.XPATH, "(//nav//a)[17]") diff --git a/pages/header_page.py b/pages/header_page.py index 1ba6c955cd..034f313fa3 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -7,7 +7,6 @@ from locators.header_page_locators import (HeaderUnauthorizedLocators, HeaderAuthorizedLocators, StartPagesLocators) - class HeaderPage(BasePage): locators = HeaderUnauthorizedLocators locators1 = HeaderAuthorizedLocators @@ -430,13 +429,13 @@ def click_on_direct_internal_links_in_header_auth(self): current_url = self.get_current_tab_url() opened_pages.append(current_url) - # Click on the 'Groups' link + # Click on the 'Groups' link #1 self.element_is_present_and_clickable(self.locators1.LINK_GROUPS_AUTH).click() Wait(self.driver, 10).until(EC.url_changes(current_url)) current_url = self.get_current_tab_url() opened_pages.append(current_url) - # Click on the 'About' link + # Click on the 'About' link #1 self.element_is_present_and_clickable(self.locators1.LINK_ABOUT_AUTH1).click() Wait(self.driver, 10).until(EC.url_changes(current_url)) current_url = self.get_current_tab_url() @@ -475,33 +474,43 @@ def click_on_direct_external_links_in_header_auth(self): 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 + current_url = self.get_current_tab_url() + print(current_url) + return current_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 + current_url = self.get_current_tab_url() + print(current_url) + return current_url @allure.step("Click on the 'About' link #2 for AUTHORIZED user") def click_on_About_link_auth2(self): self.click_more_button() self.element_is_present_and_clickable(self.locators1.LINK_ABOUT_AUTH2).click() - current_tab_url = self.get_current_tab_url() - # print(current_tab_url) - return current_tab_url + current_url = self.get_current_tab_url() + print(current_url) + return current_url @allure.step("Click on the 'Contacts' link for AUTHORIZED user -- ACTUAL") def click_on_Contacts_link_auth(self): self.click_more_button() self.element_is_present_and_clickable(self.locators1.LINK_CONTACTS_AUTH).click() - current_tab_url = self.get_current_tab_url() - print(current_tab_url) - return current_tab_url + current_url = self.get_current_tab_url() + print(current_url) + return current_url + + @allure.step("Click on the 'Specialists' link for AUTHORIZED user -- ACTUAL") + def click_on_Specialists_link_auth(self): + current_url = self.get_current_tab_url() + self.click_more_button() + self.element_is_present_and_clickable(self.locators1.LINK_SPECIALISTS_AUTH).click() + Wait(self.driver, 10).until(EC.url_changes(current_url)) + current_url = self.get_current_tab_url() + print(current_url) + return current_url @allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs for AUTHORIZED user -- unusable till changing UI""") diff --git a/tests/header_test.py b/tests/header_test.py index 80e79cddcf..f963550681 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -414,7 +414,9 @@ def test_hpa_03_03_04_verify_auth_contacts_link_navigation(self, driver, auto_te @allure.title("""test_hpa.03.03.05 Verify if internal Specialists link in the Header's dropdown for an authorized user leads to the correct page after clicking""") def test_hpa_03_03_05_verify_auth_specialists_link_navigation(self, driver, auto_test_user_authorized): - pass + page = hPage(driver) + opened_page = page.click_on_Specialists_link_auth() + assert opened_page in hPD.set_auth, "The Specialists link leads to an incorrect page after clicking" @allure.title("""test_hpa.03.03.06 Verify if internal Our Team link in the Header's dropdown for an authorized user leads to the correct page after clicking""")