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
1 change: 1 addition & 0 deletions locators/exercises_ru_words_family_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ class ExercisesRuWordsFamilyPageLocators:
PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*")
PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*")
PAGE_LIST1 = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a')
PAGE_LIST2 = (By.XPATH, "//aside//button")
12 changes: 8 additions & 4 deletions pages/exercises_ru_words_family_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,15 @@ def check_elements_visibility_on_14th_level(self):

@allure.step("Check the list1 on the 5th level of nesting is present on the page")
def get_list1_of_breadcrumbs_links(self):
elements = self.elements_are_present(self.locators.PAGE_LIST1)
att = [element.get_attribute("href") for element in elements]
print(*att, len(att), sep='\n')
return elements
return self.elements_are_present(self.locators.PAGE_LIST1)

@allure.step("Check the list1 is visible")
def check_list1_visibility(self):
return all(element.is_displayed() for element in self.get_list1_of_breadcrumbs_links())

@allure.step("Check the list2 on the 5th level of nesting is present on the page")
def get_list2_of_group_links(self):
elements = self.elements_are_present(self.locators.PAGE_LIST2)
att = [element.get_attribute("title") for element in elements]
print(*att, len(att), sep='\n')
return elements
2 changes: 2 additions & 0 deletions tests/exercises_ru_words_family_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@ def test_erwf_01_05_verify_page_structural_elements(self, driver, exercises_ru_w
page = erwfPage(driver)
list1_on_5th_level = page.get_list1_of_breadcrumbs_links()
list1_visibility = page.check_list1_visibility()
list2_on_5th_level = page.get_list2_of_group_links()
assert list1_on_5th_level, "The list1 on the 5th level is absent on the page"
assert list1_visibility, "The list1 on the 5th level is invisible"
assert list2_on_5th_level, "The list2 on the 5th level is absent on the page"