Skip to content

Commit c6ff2a8

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 ed3f6a3 commit c6ff2a8

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
@@ -15,3 +15,4 @@ class ExercisesRuWordsFamilyPageLocators:
1515
PAGE_NINTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*")
1616
PAGE_TENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*")
1717
PAGE_ELEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*")
18+
PAGE_TWELFTH_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
@@ -99,11 +99,15 @@ def check_elements_visibility_on_10th_level(self):
9999

100100
@allure.step("Get structure of the 11th level of nesting on the page")
101101
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
102+
return self.elements_are_present(self.locators.PAGE_ELEVENTH_LEVEL_ELEMENTS)
106103

107104
@allure.step("Check if elements of the 11th level of nesting are visible")
108105
def check_elements_visibility_on_11th_level(self):
109106
return all(element.is_displayed() for element in self.get_structure_of_11th_level())
107+
108+
@allure.step("Get structure of the 12th level of nesting on the page")
109+
def get_structure_of_12th_level(self):
110+
elements = self.elements_are_present(self.locators.PAGE_TWELFTH_LEVEL_ELEMENTS)
111+
tags = [element.tag_name for element in elements]
112+
print(*tags, len(tags), sep='\n')
113+
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-11th levels of nesting on the page")
18+
@allure.title("Verify composition, visibility of elements on the 1st-12th 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()
@@ -39,6 +39,7 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises
3939
visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
4040
structure_of_11th_level = page.get_structure_of_11th_level()
4141
visibility_of_elements_on_11th_level = page.check_elements_visibility_on_11th_level()
42+
structure_of_12th_level = page.get_structure_of_12th_level()
4243
assert structure_of_1st_level, "The page is empty"
4344
assert visibility_of_elements_on_1st_level, "1th-level elements are invisible"
4445
assert structure_of_2nd_level, "Elements on the 2nd level are absent on the page"
@@ -60,3 +61,4 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises
6061
assert visibility_of_elements_on_10th_level, "10th-level elements are invisible"
6162
assert structure_of_11th_level, "Elements on the 11th level are absent on the page"
6263
assert visibility_of_elements_on_11th_level, "11th-level elements are invisible"
64+
assert structure_of_12th_level, "Elements on the 12th level are absent on the page"

0 commit comments

Comments
 (0)