Skip to content

Commit e214e0c

Browse files
Merge pull request #661 from Brain-up/issue_623
Issue_623_EXERCISES_WORDS_Family_RU_PAGE_structure
2 parents bfe0442 + 06ed2c7 commit e214e0c

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

locators/exercises_ru_words_family_page_locators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ class ExercisesRuWordsFamilyPageLocators:
2020
PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*")
2121
PAGE_LIST1 = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a')
2222
PAGE_LIST2 = (By.XPATH, "//aside//button")
23+
PAGE_LIST3 = (By.XPATH, '//div[contains(@class, "series-page")]//a')

pages/exercises_ru_words_family_page.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,16 @@ def check_list1_visibility(self):
141141
return all(element.is_displayed() for element in self.get_list1_of_breadcrumbs_links())
142142

143143
@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
144+
def get_list2_of_series_links(self):
145+
return self.elements_are_present(self.locators.PAGE_LIST2)
149146

150147
@allure.step("Check the list2 is visible")
151148
def check_list2_visibility(self):
152-
return all(element.is_displayed() for element in self.get_list2_of_group_links())
149+
return all(element.is_displayed() for element in self.get_list2_of_series_links())
150+
151+
@allure.step("Check the list3 on the 11th level of nesting is present on the page")
152+
def get_list3_of_exercises_links(self):
153+
elements = self.elements_are_present(self.locators.PAGE_LIST3)
154+
att = [element.get_attribute("title") for element in elements]
155+
print(*att, len(att), sep='\n')
156+
return elements

tests/exercises_ru_words_family_page_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ 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()
89+
list2_on_5th_level = page.get_list2_of_series_links()
9090
list2_visibility = page.check_list2_visibility()
91+
list3_on_11th_level = page.get_list3_of_exercises_links()
9192
assert list1_on_5th_level, "The list1 on the 5th level is absent on the page"
9293
assert list1_visibility, "The list1 on the 5th level is invisible"
9394
assert list2_on_5th_level, "The list2 on the 5th level is absent on the page"
9495
assert list2_visibility, "The list2 on the 5th level is invisible"
96+
assert list3_on_11th_level, "The list3 on the 11th level is absent on the page"

0 commit comments

Comments
 (0)