Skip to content

Commit 3f6ca40

Browse files
add test_hpa_03.03.07 Verifying Used Resources link for authorized user
update header_test.py, header_page.py, header_page_locators.py, used_resources_page_test.py, used_resources_page.py #268
1 parent 4ec5192 commit 3f6ca40

5 files changed

Lines changed: 15 additions & 3 deletions

File tree

locators/header_page_locators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class HeaderAuthorizedLocators:
6565
LINK_PROFILE_AUTH = (By.XPATH, "(//nav//a)[18]")
6666
LINK_TELEGRAM_AUTH1 = (By.XPATH, "(//nav//a)[5]")
6767
LINK_TELEGRAM_AUTH2 = (By.XPATH, "(//nav//a)[9]")
68+
LINK_USED_RESOURCES_AUTH = (By.XPATH, "(//nav//a)[15]")
6869
LOGO_IMAGE_AUTH = (By.XPATH, "(//nav//*[name()='svg'])[1]")
6970
LOGOUT_BUTTON = (By.XPATH, "//button[@data-test-logout-button]")
7071
LOGOUT_ICON = (By.XPATH, "(//nav//*[name()='svg'])[3]")

pages/header_page.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,16 @@ def click_on_Contributors_link_auth(self):
522522
print(current_url)
523523
return current_url
524524

525+
@allure.step("Click on the 'Used Resources' link for AUTHORIZED user -- ACTUAL")
526+
def click_on_Used_Resources_link_auth(self):
527+
current_url = self.get_current_tab_url()
528+
self.click_more_button()
529+
self.element_is_present_and_clickable(self.locators1.LINK_USED_RESOURCES_AUTH).click()
530+
Wait(self.driver, 10).until(EC.url_changes(current_url))
531+
current_url = self.get_current_tab_url()
532+
print(current_url)
533+
return current_url
534+
525535
@allure.step("""Click on external links in the Header
526536
and thereby open corresponding web pages on new tabs for AUTHORIZED user -- unusable till changing UI""")
527537
def click_on_auth_external_links_in_header(self):

pages/used_resources_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def get_links_status_codes_detail(self):
9595

9696
for link_href in links_href:
9797
link_status_code = requests.head(link_href).status_code
98-
print(f'For the link: {link_href}, \nstatus code: {link_status_code}')
98+
# print(f'For the link: {link_href}, \nstatus code: {link_status_code}')
9999
status_codes.append(link_status_code)
100100
return status_codes
101101

tests/header_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,9 @@ def test_hpa_03_03_06_verify_auth_contributors_link_navigation(self, driver, aut
428428
@allure.title("""test_hpa.03.03.07 Verify if internal Used Resources link in the Header's dropdown
429429
for an authorized user leads to the correct page after clicking""")
430430
def test_hpa_03_03_07_verify_auth_used_resources_link_navigation(self, driver, auto_test_user_authorized):
431-
pass
431+
page = hPage(driver)
432+
opened_page = page.click_on_Used_Resources_link_auth()
433+
assert opened_page in hPD.set_auth, "The Used Resources link leads to an incorrect page after clicking"
432434

433435
@allure.title("""test_hpa.03.03.08 Verify if internal Audiometry link in the Header's dropdown
434436
for an authorized user leads to the correct page after clicking""")

tests/used_resources_page_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def test_ur_03_01_verify_links_in_sections(self, driver, used_resources_page_ope
7474
links_visibility = page.check_links_visibility()
7575
links_clickability = page.check_links_clickability()
7676
links_href = page.get_links_href()
77-
# link_status_codes1 = page.get_links_status_codes()
7877
link_status_codes = page.get_links_status_codes_detail()
7978
assert links_presence, "Links are absent on the page"
8079
assert links_visibility, "Links are invisible"

0 commit comments

Comments
 (0)