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
14 changes: 10 additions & 4 deletions pages/groups_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,19 @@ def get_links_status_codes(self):
@allure.step("Click on links on the 'ru' local and thereby open corresponding web pages in the same tab")
def click_on_links_on_ru_local(self):
opened_pages = []
self.element_is_present_and_clickable(self.locators.PAGE_LINK1).click()
time.sleep(3)

link1 = self.element_is_present_and_clickable(self.locators.PAGE_LINK1)
current_url = self.driver.current_url
link1.click()
Wait(self.driver, 10).until(EC.url_changes(current_url))
opened_pages.append(self.get_current_tab_url())
self.element_is_present_and_clickable(self.locators1.LOGO_LINK).click()
self.element_is_present_and_clickable(self.locators.PAGE_LINK2).click()
time.sleep(3)
link2 = self.element_is_present_and_clickable(self.locators.PAGE_LINK2)
current_url = self.driver.current_url
link2.click()
Wait(self.driver, 10).until(EC.url_changes(current_url))
opened_pages.append(self.get_current_tab_url())

return opened_pages

@allure.step("Click on links on the 'en' local and thereby open corresponding web pages in the same tab")
Expand Down
3 changes: 2 additions & 1 deletion tests/groups_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def test_gp_03_04_verify_links_en(self, driver, groups_en_page_open):
def test_gp_03_05_verify_ru_links_lead_to_proper_pages(self, driver, groups_ru_page_open):
page = gPage(driver)
opened_pages = page.click_on_links_on_ru_local()
print(opened_pages) # Temporarily for refactoring
assert opened_pages, "Transitions to exercises pages have not performed"
assert all(element in gPD.pages_urls for element in opened_pages), \
"Some links lead to incorrect pages after clicking"
Expand All @@ -162,7 +163,7 @@ def test_gp_03_05_verify_ru_links_lead_to_proper_pages(self, driver, groups_ru_p
def test_gp_03_06_verify_en_links_lead_to_proper_pages(self, driver, groups_en_page_open):
page = gPage(driver)
opened_pages = page.click_on_links_on_en_local()
print(opened_pages) # Temporarily for refactoring
print(opened_pages) # Temporarily for refactoring
assert opened_pages, "Transitions to exercises pages have not performed"
assert all(element in gPD.pages_urls for element in opened_pages), \
"Some links lead to incorrect pages after clicking"
Expand Down
Loading