Skip to content

Commit 35c9e4d

Browse files
ref test_hpa_03_03_verify_unauth_external_links_lead_to_proper_pages
update header_page.py, header_test.py #268
1 parent cebb293 commit 35c9e4d

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

pages/header_page.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ def get_list_of_external_links_in_more(self):
146146
# return self.get_list_of_links_in_more()[4:6]
147147
return self.get_list_of_links_in_more()[:3]
148148

149+
@allure.step("""Get the list of the 'Donate', 'GitHub' links (external links)
150+
in the 'More' dropdown for authorized user""")
151+
def get_list_of_external_links_in_more_auth(self):
152+
return self.get_list_of_links_in_more()[4:7]
153+
# return self.get_list_of_links_in_more()[:3]
154+
149155
@allure.step("Get the general list of internal links in the Header for an unauthorized user""")
150156
def get_list_of_internal_links(self):
151157
links = self.get_list_of_links_unauth()
@@ -414,10 +420,11 @@ def click_on_external_links_in_header(self):
414420
opened_pages = []
415421
# Click on the 'Telegram' link
416422
self.element_is_present_and_clickable(self.locators.LINK_TELEGRAM).click()
423+
417424
# Click on the 'GitHub', 'Donate' links
418425
self.click_more_button()
419426

420-
new_tabs = [link.click() for link in self.get_list_of_external_links_in_more()]
427+
new_tabs = [link.click() for link in self.get_list_of_external_links_in_more_auth()]
421428
print(len(new_tabs))
422429
# Get the list of opened tabs urls
423430
# for i in range(1, len(new_tabs) + 2):

tests/header_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ def test_hpa_03_02_1_verify_auth_direct_internal_links_navigation(self, driver,
330330
lead to correct pages after click""")
331331
def test_hpa_03_03_verify_auth_external_links_lead_to_proper_pages(self, driver, auto_test_user_authorized):
332332
page = hPage(driver)
333-
external_links_in_more = page.get_list_of_external_links_in_more()
334-
# opened_pages = page.click_on_external_links_in_header()
333+
external_links_in_more = page.get_list_of_external_links_in_more_auth()
334+
opened_pages = page.click_on_external_links_in_header()
335335
assert external_links_in_more, "External links are not collected in the list"
336-
# assert all(element in hPD.set_auth for element in opened_pages), \
337-
# "Some of external links lead to incorrect pages after clicking"
336+
assert all(element in hPD.set_auth for element in opened_pages), \
337+
"Some of external links lead to incorrect pages after clicking"
338338

339339
@allure.title("""Verify that the Logo link on the Start Authorized Page
340340
refreshes the current page and doesn't lead to other pages after clicking""")

0 commit comments

Comments
 (0)