Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ def click_on_direct_internal_links_in_header_auth(self):
return opened_pages

@allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs
for every user""")
def click_on_external_links_in_header(self):
for authorized user""")
def click_on_auth_external_links_in_header(self):
opened_pages = []
# Click on the 'Telegram' link
self.element_is_present_and_clickable(self.locators.LINK_TELEGRAM).click()
Expand All @@ -434,6 +434,26 @@ def click_on_external_links_in_header(self):
print(*opened_pages)
return opened_pages

@allure.step("Click on the 'More' button for every user")
def click_more_button(self):
return self.element_is_present_and_clickable(self.locators.MORE_BUTTON).click()

@allure.step("Click on the 'Telegram' link for unauthorized user")
def click_on_Telegram_link(self):
self.element_is_present_and_clickable(self.locators.LINK_TELEGRAM).click()
self.driver.switch_to.window(self.driver.window_handles[1])
return self.get_current_tab_url()

@allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs
for unauthorized user""")
def click_on_unauth_external_links_in_header(self):
opened_pages = []
# Click on the 'Telegram' link
opened_pages.append(self.click_on_Telegram_link()) # to be continued

print(*opened_pages)
return opened_pages

@allure.step("Click on the 'Logo' link for every user")
def click_on_logo_link(self):

Expand Down
4 changes: 2 additions & 2 deletions tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_hpu_03_02_verify_unauth_internal_links_lead_to_correct_pages(self, driv
def test_hpu_03_03_verify_unauth_external_links_lead_to_correct_pages(self, driver, main_page_open):
page = hPage(driver)
external_links_in_more = page.get_list_of_external_links_in_more()
opened_pages = page.click_on_external_links_in_header()
opened_pages = page.click_on_unauth_external_links_in_header()
assert external_links_in_more, "External links are not collected in the list"
assert all(element in hPD.set_unauth for element in opened_pages), \
"Some of external links lead to incorrect pages after clicking"
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_hpa_03_02_1_verify_auth_direct_internal_links_navigation(self, driver,
def test_hpa_03_03_verify_auth_external_links_lead_to_proper_pages(self, driver, auto_test_user_authorized):
page = hPage(driver)
external_links_in_more = page.get_list_of_external_links_in_more_auth()
opened_pages = page.click_on_external_links_in_header()
opened_pages = page.click_on_auth_external_links_in_header()
assert external_links_in_more, "External links are not collected in the list"
assert all(element in hPD.set_auth for element in opened_pages), \
"Some of external links lead to incorrect pages after clicking"
Expand Down
Loading