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
15 changes: 3 additions & 12 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,12 @@ def click_on_group_links(self):

@allure.step("Click on subgroup link 'Family' and thereby open corresponding web pages in the same tab")
def click_on_subgroup_link_family(self):
opened_pages = []
self.element_is_present_and_clickable(self.locators.PAGE_LIST3_1).click()
time.sleep(1)
opened_pages.append(self.get_current_tab_url())
opened_page = self.get_current_tab_url()
self.driver.back()
# self.element_is_present_and_clickable(self.locators.PAGE_LIST3_2).click()
opened_pages.append(self.get_current_tab_url())
# self.driver.back()
print(*opened_pages, sep='\n')
return opened_pages
print(opened_page)
return opened_page

@allure.step("""Click on subgroup links 'Beloved Home', 'Food', 'Clothes'
and thereby open corresponding web pages in the same tab""")
Expand All @@ -256,20 +252,15 @@ def click_on_subgroup_link_beloved_home_food_clothes(self):
opened_pages.append(self.get_current_tab_url())
self.driver.back()
time.sleep(1)
opened_pages.append(self.get_current_tab_url())
self.element_is_present_and_clickable(self.locators.PAGE_LIST3_3).click()
time.sleep(1)
opened_pages.append(self.get_current_tab_url())
self.driver.back()
time.sleep(1)
opened_pages.append(self.get_current_tab_url())
self.element_is_present_and_clickable(self.locators.PAGE_LIST3_4).click()
time.sleep(1)
opened_pages.append(self.get_current_tab_url())
self.driver.back()
time.sleep(1)
opened_pages.append(self.get_current_tab_url())
print(*opened_pages, sep='\n')
return opened_pages


10 changes: 7 additions & 3 deletions tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,14 @@ def test_erw_03_05_verify_group_links_lead_to_correct_pages(self, driver, exerci
assert all(page in ExRuWoPaData.group_link_urls for page in opened_pages), \
"Some group links lead to incorrect pages after clicking"

@allure.title("Verify if subgroup links lead to correct pages after clicking")
@allure.title("Verify if subgroup links 1-4 lead to correct pages after clicking")
def test_erw_03_06_verify_subgroup_links_lead_to_correct_pages(self, driver, exercises_ru_words_page_open):
page = ExercisesRuWordsPage(driver)
opened_pages1 = page.click_on_subgroup_link_family()
opened_page1 = page.click_on_subgroup_link_family()
opened_pages2_4 = page.click_on_subgroup_link_beloved_home_food_clothes()
assert opened_pages1, "Transition to the page has not performed"
assert opened_page1, "Transition to the page has not performed"
assert opened_page1 in ExRuWoPaData.subgroup_link_urls, \
"The first subgroup link leads to incorrect page after clicking"
assert opened_pages2_4, "Transitions to pages have not performed"
assert all(page in ExRuWoPaData.subgroup_link_urls for page in opened_pages2_4), \
"Some subgroup links lead to incorrect pages after clicking"
Loading