Skip to content

Commit e076bd8

Browse files
Merge pull request #705 from Brain-up/issue_268
Issue_268_HEADER_links
2 parents 896c0ad + 4e6ef7c commit e076bd8

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

pages/header_page.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,25 @@ def click_on_auth_external_links_in_header(self):
437437
print(*opened_pages)
438438
return opened_pages
439439

440-
@allure.step("Click on the 'Telegram' link for authorized user")
440+
@allure.step("Click on the 'Telegram' link #1 for authorized user")
441441
def click_on_Telegram_link_auth1(self):
442442
self.element_is_present_and_clickable(self.locators1.LINK_TELEGRAM_AUTH).click()
443443
self.driver.switch_to.window(self.driver.window_handles[1])
444444
current_tab_url = self.get_current_tab_url()
445445
print(current_tab_url)
446+
self.driver.switch_to.window(self.driver.window_handles[0])
447+
print(self.get_current_tab_url())
448+
return current_tab_url
449+
450+
@allure.step("Click on the 'Telegram' link #2 for authorized user")
451+
def click_on_Telegram_link_auth2(self):
452+
self.click_more_button()
453+
self.element_is_present_and_clickable(self.locators1.LINK_TELEGRAM_AUTH2).click()
454+
self.driver.switch_to.window(self.driver.window_handles[1])
455+
current_tab_url = self.get_current_tab_url()
456+
print(current_tab_url)
457+
self.driver.switch_to.window(self.driver.window_handles[0])
458+
print(self.get_current_tab_url())
446459
return current_tab_url
447460

448461

tests/header_test.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,15 @@ def test_hpa_03_03_verify_auth_external_links_lead_to_proper_pages(self, driver,
361361
assert all(element in hPD.set_auth for element in opened_pages), \
362362
"Some of external links lead to incorrect pages after clicking"
363363

364-
@allure.title("""Verify if external Telegram link #1 in the Header for an authorized user
365-
leads to a correct page after click""")
366-
def test_hpa_03_03_01_verify_auth_Telegram_link1_navigation(self, driver, auto_test_user_authorized):
367-
page = hPage(driver)
368-
opened_page = page.click_on_Telegram_link_auth1()
369-
assert opened_page in hPD.set_auth, "The Telegram link leads to an incorrect page after clicking"
364+
@allure.title("""Verify if external Telegram links #1,2 in the Header for an authorized user
365+
lead to the correct page after click""")
366+
def test_hpa_03_03_01_verify_auth_telegram_links_navigation(self, driver, auto_test_user_authorized):
367+
page = hPage(driver)
368+
opened_page1 = page.click_on_Telegram_link_auth1()
369+
opened_page2 = page.click_on_Telegram_link_auth2()
370+
assert opened_page1 in hPD.set_auth, "The Telegram link #1 leads to an incorrect page after clicking"
371+
assert opened_page2 in hPD.set_auth, "The Telegram link #2 leads to an incorrect page after clicking"
372+
assert opened_page1 == opened_page2, "The Telegram links #1,2 are the same"
370373

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

0 commit comments

Comments
 (0)