Skip to content

Commit 8d1d2a2

Browse files
ref test_erwf_01.02 Verify page structure and visibility
update exercises_ru_words_family_page_test.py, exercises_ru_words_family_page.py, exercises_ru_words_family_page_locators.py #623
1 parent 6c25003 commit 8d1d2a2

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

locators/exercises_ru_words_family_page_locators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ class ExercisesRuWordsFamilyPageLocators:
1414
PAGE_EIGHTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*")
1515
PAGE_NINTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*")
1616
PAGE_TENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*")
17+
PAGE_ELEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*")

pages/exercises_ru_words_family_page.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,15 @@ def check_elements_visibility_on_9th_level(self):
9191

9292
@allure.step("Get structure of the 10th level of nesting on the page")
9393
def get_structure_of_10th_level(self):
94-
elements = self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)
95-
# tags = [element.tag_name for element in elements]
96-
# print(*tags, len(tags), sep='\n')
97-
return elements
94+
return self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)
9895

9996
@allure.step("Check if elements of the 10th level of nesting are visible")
10097
def check_elements_visibility_on_10th_level(self):
10198
return all(element.is_displayed() for element in self.get_structure_of_10th_level())
99+
100+
@allure.step("Get structure of the 11th level of nesting on the page")
101+
def get_structure_of_11th_level(self):
102+
elements = self.elements_are_present(self.locators.PAGE_ELEVENTH_LEVEL_ELEMENTS)
103+
tags = [element.tag_name for element in elements]
104+
print(*tags, len(tags), sep='\n')
105+
return elements

tests/exercises_ru_words_family_page_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_erwf_01_01_verify_page_presence_and_visibility(self, driver, exercises_
1515
assert page_content_presence, "The page content is absent in DOM"
1616
assert page_content_visibility, "The page content is invisible"
1717

18-
@allure.title("Verify composition, visibility of elements on the 1st-10th levels of nesting on the page")
18+
@allure.title("Verify composition, visibility of elements on the 1st-11th levels of nesting on the page")
1919
def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):
2020
page = erwfPage(driver)
2121
structure_of_1st_level = page.get_structure_of_1st_level()
@@ -37,6 +37,7 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises
3737
visibility_of_elements_on_9th_level = page.check_elements_visibility_on_9th_level()
3838
structure_of_10th_level = page.get_structure_of_10th_level()
3939
visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
40+
structure_of_11th_level = page.get_structure_of_11th_level()
4041
assert structure_of_1st_level, "The page is empty"
4142
assert visibility_of_elements_on_1st_level, "1th-level elements are invisible"
4243
assert structure_of_2nd_level, "Elements on the 2nd level are absent on the page"
@@ -56,3 +57,4 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises
5657
assert not visibility_of_elements_on_9th_level, "9th-level elements are visible"
5758
assert structure_of_10th_level, "Elements on the 10th level are absent on the page"
5859
assert visibility_of_elements_on_10th_level, "10th-level elements are invisible"
60+
assert structure_of_11th_level, "Elements on the 11th level are absent on the page"

0 commit comments

Comments
 (0)