diff --git a/locators/header_page_locators.py b/locators/header_page_locators.py index e42586814b..74824f81a4 100644 --- a/locators/header_page_locators.py +++ b/locators/header_page_locators.py @@ -65,6 +65,7 @@ class HeaderAuthorizedLocators: LINK_PROFILE_AUTH = (By.XPATH, "(//nav//a)[18]") LINK_TELEGRAM_AUTH1 = (By.XPATH, "(//nav//a)[5]") LINK_TELEGRAM_AUTH2 = (By.XPATH, "(//nav//a)[9]") + LINK_USED_RESOURCES_AUTH = (By.XPATH, "(//nav//a)[15]") LOGO_IMAGE_AUTH = (By.XPATH, "(//nav//*[name()='svg'])[1]") LOGOUT_BUTTON = (By.XPATH, "//button[@data-test-logout-button]") LOGOUT_ICON = (By.XPATH, "(//nav//*[name()='svg'])[3]") diff --git a/pages/header_page.py b/pages/header_page.py index c926a7f33b..7c97d58b64 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -522,6 +522,16 @@ def click_on_Contributors_link_auth(self): print(current_url) return current_url + @allure.step("Click on the 'Used Resources' link for AUTHORIZED user -- ACTUAL") + def click_on_Used_Resources_link_auth(self): + current_url = self.get_current_tab_url() + self.click_more_button() + self.element_is_present_and_clickable(self.locators1.LINK_USED_RESOURCES_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""") def click_on_auth_external_links_in_header(self): diff --git a/pages/used_resources_page.py b/pages/used_resources_page.py index fc1e49669f..7ac7121a05 100644 --- a/pages/used_resources_page.py +++ b/pages/used_resources_page.py @@ -95,7 +95,7 @@ def get_links_status_codes_detail(self): for link_href in links_href: link_status_code = requests.head(link_href).status_code - print(f'For the link: {link_href}, \nstatus code: {link_status_code}') + # print(f'For the link: {link_href}, \nstatus code: {link_status_code}') status_codes.append(link_status_code) return status_codes diff --git a/tests/header_test.py b/tests/header_test.py index 116b4134fa..49ab9d9b04 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -428,7 +428,9 @@ def test_hpa_03_03_06_verify_auth_contributors_link_navigation(self, driver, aut @allure.title("""test_hpa.03.03.07 Verify if internal Used Resources link in the Header's dropdown for an authorized user leads to the correct page after clicking""") def test_hpa_03_03_07_verify_auth_used_resources_link_navigation(self, driver, auto_test_user_authorized): - pass + page = hPage(driver) + opened_page = page.click_on_Used_Resources_link_auth() + assert opened_page in hPD.set_auth, "The Used Resources link leads to an incorrect page after clicking" @allure.title("""test_hpa.03.03.08 Verify if internal Audiometry link in the Header's dropdown for an authorized user leads to the correct page after clicking""") diff --git a/tests/used_resources_page_test.py b/tests/used_resources_page_test.py index b6ba13d0f9..b4f5129147 100644 --- a/tests/used_resources_page_test.py +++ b/tests/used_resources_page_test.py @@ -74,7 +74,6 @@ def test_ur_03_01_verify_links_in_sections(self, driver, used_resources_page_ope links_visibility = page.check_links_visibility() links_clickability = page.check_links_clickability() links_href = page.get_links_href() - # link_status_codes1 = page.get_links_status_codes() link_status_codes = page.get_links_status_codes_detail() assert links_presence, "Links are absent on the page" assert links_visibility, "Links are invisible"