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
17 changes: 17 additions & 0 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,23 @@ def click_on_subgroup_link_beloved_home_food_clothes(self):
print(*opened_pages, sep='\n')
return opened_pages

@allure.step("""Click on subgroup links and thereby open corresponding web pages in the same tab""")
def click_on_subgroup_links(self):
subgroup_locators = [self.locators.PAGE_LIST3_1, self.locators.PAGE_LIST3_2,
self.locators.PAGE_LIST3_3, self.locators.PAGE_LIST3_4]
group_page_url = self.get_current_tab_url()
opened_pages = []

for link_locator in subgroup_locators:
self.element_is_clickable(link_locator).click()
Wait(self.driver, self.timeout).until(EC.url_changes(group_page_url))
opened_pages.append(self.get_current_tab_url())
self.driver.back()
Wait(self.driver, self.timeout).until(EC.url_to_be(group_page_url))

print(*opened_pages, sep='\n')
return opened_pages

# Checking images on the page
@allure.step("Get the list of attribute 'style' values of images in links")
def get_links_style(self):
Expand Down
13 changes: 4 additions & 9 deletions tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,11 @@ def test_erw_03_05_verify_group_links_navigation(self, driver, exercises_ru_word
assert all(element in erwPD.group_link_urls for element in opened_pages), "Links lead to incorrect pages"

@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):
def test_erw_03_06_verify_subgroup_links_navigation(self, driver, exercises_ru_words_page_open):
page = erwPage(driver)
opened_page1 = page.click_on_subgroup_link_family()
opened_pages2_4 = page.click_on_subgroup_link_beloved_home_food_clothes()
assert opened_page1, "Transition to the page has not performed"
assert opened_page1 in erwPD.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(element in erwPD.subgroup_link_urls for element in opened_pages2_4), \
"Some subgroup links lead to incorrect pages after clicking"
opened_pages = page.click_on_subgroup_links()
assert opened_pages, "Transitions to pages have not performed"
assert all(element in erwPD.subgroup_link_urls for element in opened_pages), "Links lead to incorrect pages"

class TestExRuWordsPageImages:
@allure.title("Verify attributes of images in links on the page")
Expand Down
Loading