Skip to content

Commit 711dcd0

Browse files
Merge pull request #710 from Brain-up/issue_268
Issue_268_HEADER_links
2 parents 9704c9b + a0c87c3 commit 711dcd0

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

‎pages/header_page.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,7 @@ def click_on_Telegram_link_auth1(self):
466466
self.element_is_present_and_clickable(self.locators1.LINK_TELEGRAM_AUTH).click()
467467
self.driver.switch_to.window(self.driver.window_handles[1])
468468
current_tab_url = self.get_current_tab_url()
469-
print(current_tab_url)
470469
self.driver.switch_to.window(self.driver.window_handles[0])
471-
print(self.get_current_tab_url())
472470
return current_tab_url
473471

474472
@allure.step("Click on the 'Telegram' link #2 for authorized user")
@@ -477,9 +475,7 @@ def click_on_Telegram_link_auth2(self):
477475
self.element_is_present_and_clickable(self.locators1.LINK_TELEGRAM_AUTH2).click()
478476
self.driver.switch_to.window(self.driver.window_handles[1])
479477
current_tab_url = self.get_current_tab_url()
480-
print(current_tab_url)
481478
self.driver.switch_to.window(self.driver.window_handles[0])
482-
print(self.get_current_tab_url())
483479
return current_tab_url
484480

485481
@allure.step("Click on the 'Donate' link for authorized user")
@@ -488,6 +484,15 @@ def click_on_Donate_link_auth(self):
488484
self.element_is_present_and_clickable(self.locators1.LINK_DONATE_AUTH).click()
489485
self.driver.switch_to.window(self.driver.window_handles[1])
490486
current_tab_url = self.get_current_tab_url()
487+
self.driver.switch_to.window(self.driver.window_handles[0])
488+
return current_tab_url
489+
490+
@allure.step("Click on the 'GitHub' link for authorized user")
491+
def click_on_GitHub_link_auth(self):
492+
self.click_more_button()
493+
self.element_is_present_and_clickable(self.locators1.LINK_GITHUB_AUTH).click()
494+
self.driver.switch_to.window(self.driver.window_handles[1])
495+
current_tab_url = self.get_current_tab_url()
491496
print(current_tab_url)
492497
self.driver.switch_to.window(self.driver.window_handles[0])
493498
print(self.get_current_tab_url())

‎tests/header_test.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ def test_hpa_03_03_verify_auth_external_links_lead_to_proper_pages(self, driver,
382382
assert all(element in hPD.set_auth for element in opened_pages), \
383383
"Some of external links lead to incorrect pages after clicking"
384384

385-
@allure.title("""Verify if external Telegram links #1,2 in the Header for an authorized user
386-
lead to the correct page after click""")
385+
@allure.title("""test_hpa.03.03.01 Verify if external Telegram links #1,2 in the Header for an authorized user
386+
lead to the correct page after clicking""")
387387
def test_hpa_03_03_01_verify_auth_telegram_links_navigation(self, driver, auto_test_user_authorized):
388388
page = hPage(driver)
389389
opened_page1 = page.click_on_Telegram_link_auth1()
@@ -392,13 +392,20 @@ def test_hpa_03_03_01_verify_auth_telegram_links_navigation(self, driver, auto_t
392392
assert opened_page2 in hPD.set_auth, "The Telegram link #2 leads to an incorrect page after clicking"
393393
assert opened_page1 == opened_page2, "The Telegram links #1,2 are the same"
394394

395-
@allure.title("""Verify if external Donate link in the Header for an authorized user
396-
leads to the correct page after click""")
395+
@allure.title("""test_hpa.03.03.02 Verify if external Donate link in the Header for an authorized user
396+
leads to the correct page after clicking""")
397397
def test_hpa_03_03_02_verify_auth_donate_link_navigation(self, driver, auto_test_user_authorized):
398398
page = hPage(driver)
399399
opened_page = page.click_on_Donate_link_auth()
400400
assert opened_page in hPD.set_auth, "The Donate link leads to an incorrect page after clicking"
401401

402+
@allure.title("""test_hpa.03.03.03 Verify if external GitHub link in the Header for an authorized user
403+
leads to the correct page after clicking""")
404+
def test_hpa_03_03_03_verify_auth_github_link_navigation(self, driver, auto_test_user_authorized):
405+
page = hPage(driver)
406+
opened_page = page.click_on_GitHub_link_auth()
407+
assert opened_page in hPD.set_auth, "The GitHub link leads to an incorrect page after clicking"
408+
402409
@allure.title("""Verify that the Logo link on the Start Authorized Page
403410
refreshes the current page and doesn't lead to other pages after clicking""")
404411
def test_hpa_03_04_verify_click_auth_logo_link(self, driver, auto_test_user_authorized):

0 commit comments

Comments
 (0)