Skip to content

Commit 467bafc

Browse files
Merge pull request #659 from Brain-up/issue_623
Issue_623_EXERCISES_WORDS_Family_RU_PAGE_structure
2 parents 478f96f + 4c23335 commit 467bafc

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

locators/exercises_ru_words_family_page_locators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ class ExercisesRuWordsFamilyPageLocators:
1919
PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*")
2020
PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*")
2121
PAGE_LIST1 = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a')
22+
PAGE_LIST2 = (By.XPATH, "//aside//button")

pages/exercises_ru_words_family_page.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,15 @@ def check_elements_visibility_on_14th_level(self):
134134

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

142139
@allure.step("Check the list1 is visible")
143140
def check_list1_visibility(self):
144141
return all(element.is_displayed() for element in self.get_list1_of_breadcrumbs_links())
142+
143+
@allure.step("Check the list2 on the 5th level of nesting is present on the page")
144+
def get_list2_of_group_links(self):
145+
elements = self.elements_are_present(self.locators.PAGE_LIST2)
146+
att = [element.get_attribute("title") for element in elements]
147+
print(*att, len(att), sep='\n')
148+
return elements

tests/exercises_ru_words_family_page_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,7 @@ def test_erwf_01_05_verify_page_structural_elements(self, driver, exercises_ru_w
8686
page = erwfPage(driver)
8787
list1_on_5th_level = page.get_list1_of_breadcrumbs_links()
8888
list1_visibility = page.check_list1_visibility()
89+
list2_on_5th_level = page.get_list2_of_group_links()
8990
assert list1_on_5th_level, "The list1 on the 5th level is absent on the page"
9091
assert list1_visibility, "The list1 on the 5th level is invisible"
92+
assert list2_on_5th_level, "The list2 on the 5th level is absent on the page"

0 commit comments

Comments
 (0)