Skip to content

Commit fde7560

Browse files
ref test_erwf_01.03, test_erwf_01.04 Update data for verifying page structural elements
update exercises_ru_words_family_page_test.py, exercises_ru_words_family_page.py, exercises_ru_words_family_page_locators.py #623
1 parent 7e1125f commit fde7560

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

locators/exercises_ru_words_family_page_locators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ class ExercisesRuWordsFamilyPageLocators:
1111
PAGE_FIFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*")
1212
PAGE_SIXTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*")
1313
PAGE_SEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*")
14-
PAGE_EIGHTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*")
14+
PAGE_EIGHTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/a")
1515
PAGE_NINTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*")
1616
PAGE_TENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*")
1717
PAGE_ELEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*")
1818
PAGE_TWELFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*")
19-
PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*")
19+
# PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*")
20+
PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, '//main//a/div')
2021
PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*")
2122
PAGE_LIST1_BREADCRUMBS = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a')
2223
PAGE_LIST2_SERIES = (By.XPATH, "//aside//button")

pages/exercises_ru_words_family_page.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ def check_elements_visibility_on_7th_level(self):
7272

7373
@allure.step("Get structure of the 8th level of nesting on the page")
7474
def get_structure_of_8th_level(self):
75-
return self.elements_are_present(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS)
75+
elements = self.elements_are_present(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS)
76+
tags = [element.tag_name for element in elements]
77+
print(*tags, len(tags), sep='\n')
78+
return elements
7679

7780
@allure.step("Check if elements of the 8th level of nesting are visible")
7881
def check_elements_visibility_on_8th_level(self):
@@ -83,15 +86,21 @@ def check_elements_invisibility_on_8th_level(self):
8386

8487
@allure.step("Get structure of the 9th level of nesting on the page")
8588
def get_structure_of_9th_level(self):
86-
return self.elements_are_present(self.locators.PAGE_NINTH_LEVEL_ELEMENTS)
89+
elements = self.elements_are_present(self.locators.PAGE_NINTH_LEVEL_ELEMENTS)
90+
tags = [element.tag_name for element in elements]
91+
print(*tags, len(tags), sep='\n')
92+
return elements
8793

8894
@allure.step("Check if elements of the 9th level of nesting are visible")
8995
def check_elements_visibility_on_9th_level(self):
9096
return all(element.is_displayed() for element in self.get_structure_of_9th_level())
9197

9298
@allure.step("Get structure of the 10th level of nesting on the page")
9399
def get_structure_of_10th_level(self):
94-
return self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)
100+
elements = self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)
101+
tags = [element.tag_name for element in elements]
102+
print(*tags, len(tags), sep='\n')
103+
return elements
95104

96105
@allure.step("Check if elements of the 10th level of nesting are visible")
97106
def check_elements_visibility_on_10th_level(self):
@@ -115,7 +124,10 @@ def check_elements_visibility_on_12th_level(self):
115124

116125
@allure.step("Get structure of the 13th level of nesting on the page")
117126
def get_structure_of_13th_level(self):
118-
return self.elements_are_present(self.locators.PAGE_THIRTEENTH_LEVEL_ELEMENTS)
127+
elements = self.elements_are_present(self.locators.PAGE_THIRTEENTH_LEVEL_ELEMENTS)
128+
tags = [element.tag_name for element in elements]
129+
print(*tags, len(tags), sep='\n')
130+
return elements
119131

120132
@allure.step("Check if elements of the 13th level of nesting are visible")
121133
def check_elements_visibility_on_13th_level(self):

tests/exercises_ru_words_family_page_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises
5555
assert structure_of_7th_level, "Elements on the 7th level are absent on the page"
5656
assert visibility_of_elements_on_7th_level, "7th-level elements are invisible"
5757
assert structure_of_8th_level, "Elements on the 8th level are absent on the page"
58-
assert not visibility_of_elements_on_8th_level, "8th-level elements are visible"
58+
assert visibility_of_elements_on_8th_level, "8th-level elements are invisible"
5959
assert structure_of_9th_level, "Elements on the 9th level are absent on the page"
6060
assert not visibility_of_elements_on_9th_level, "9th-level elements are visible"
6161
assert structure_of_10th_level, "Elements on the 10th level are absent on the page"
62-
assert visibility_of_elements_on_10th_level, "10th-level elements are invisible"
62+
assert not visibility_of_elements_on_10th_level, "10th-level elements are visible"
6363

6464
@allure.title("Verify composition, visibility of elements on the 11st-14th levels of nesting on the page")
6565
def test_erwf_01_04_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):

0 commit comments

Comments
 (0)