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: 11 additions & 13 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,26 +434,24 @@ def click_on_auth_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)
opened_pages.append(self.click_on_Telegram_link())
# Click on the 'GitHub' link
opened_pages.append(self.click_on_GitHub_link()) # to be continued
return opened_pages

@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])
current_tab_url = self.get_current_tab_url()
print(current_tab_url)
return current_tab_url

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

Expand Down
8 changes: 8 additions & 0 deletions tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def test_hpu_03_02_verify_unauth_internal_links_lead_to_correct_pages(self, driv
assert all(element in hPD.set_unauth for element in opened_pages), \
"Some of internal links lead to incorrect pages after clicking"

@pytest.mark.skip("Unstable test environment")
@allure.title("""Verify if external links in the Header for an unauthorized user
lead to correct pages after click""")
def test_hpu_03_03_verify_unauth_external_links_lead_to_correct_pages(self, driver, main_page_open):
Expand All @@ -139,6 +140,13 @@ def test_hpu_03_03_verify_unauth_external_links_lead_to_correct_pages(self, driv
assert all(element in hPD.set_unauth for element in opened_pages), \
"Some of external links lead to incorrect pages after clicking"

@allure.title("""Verify if external Telegram link in the Header for an unauthorized user
leads to a correct page after click""")
def test_hpu_03_03_01_verify_unauth_Telegram_link_navigation(self, driver, main_page_open):
page = hPage(driver)
opened_page = page.click_on_Telegram_link()
assert opened_page in hPD.set_unauth, "The Telegram link leads to incorrect page after clicking"

@allure.title("""Verify that the 'Logo' link on the Start Unauthorized Page
doesn't refresh the current page or lead to other pages after clicking""")
def test_hpu_03_04_verify_click_unauth_logo_link(self, driver, main_page_open):
Expand Down
Loading