From c6ff2a833e495378bb961e83d302502afd8a3aeb Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Thu, 22 Jan 2026 11:21:22 +0300 Subject: [PATCH] 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 --- locators/exercises_ru_words_family_page_locators.py | 1 + pages/exercises_ru_words_family_page.py | 12 ++++++++---- tests/exercises_ru_words_family_page_test.py | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/locators/exercises_ru_words_family_page_locators.py b/locators/exercises_ru_words_family_page_locators.py index 331726edd7..e0ef082ab8 100644 --- a/locators/exercises_ru_words_family_page_locators.py +++ b/locators/exercises_ru_words_family_page_locators.py @@ -15,3 +15,4 @@ class ExercisesRuWordsFamilyPageLocators: PAGE_NINTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*") PAGE_TENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*") PAGE_ELEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*") + PAGE_TWELFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*") diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index 70b34cc3a7..16cefcea10 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -99,11 +99,15 @@ def check_elements_visibility_on_10th_level(self): @allure.step("Get structure of the 11th level of nesting on the page") def get_structure_of_11th_level(self): - elements = self.elements_are_present(self.locators.PAGE_ELEVENTH_LEVEL_ELEMENTS) - # tags = [element.tag_name for element in elements] - # print(*tags, len(tags), sep='\n') - return elements + return self.elements_are_present(self.locators.PAGE_ELEVENTH_LEVEL_ELEMENTS) @allure.step("Check if elements of the 11th level of nesting are visible") def check_elements_visibility_on_11th_level(self): return all(element.is_displayed() for element in self.get_structure_of_11th_level()) + + @allure.step("Get structure of the 12th level of nesting on the page") + def get_structure_of_12th_level(self): + elements = self.elements_are_present(self.locators.PAGE_TWELFTH_LEVEL_ELEMENTS) + tags = [element.tag_name for element in elements] + print(*tags, len(tags), sep='\n') + return elements diff --git a/tests/exercises_ru_words_family_page_test.py b/tests/exercises_ru_words_family_page_test.py index 906a0aa424..6f32a92735 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -15,7 +15,7 @@ def test_erwf_01_01_verify_page_presence_and_visibility(self, driver, exercises_ assert page_content_presence, "The page content is absent in DOM" assert page_content_visibility, "The page content is invisible" - @allure.title("Verify composition, visibility of elements on the 1st-11th levels of nesting on the page") + @allure.title("Verify composition, visibility of elements on the 1st-12th levels of nesting on the page") def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open): page = erwfPage(driver) 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 visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level() structure_of_11th_level = page.get_structure_of_11th_level() visibility_of_elements_on_11th_level = page.check_elements_visibility_on_11th_level() + structure_of_12th_level = page.get_structure_of_12th_level() assert structure_of_1st_level, "The page is empty" assert visibility_of_elements_on_1st_level, "1th-level elements are invisible" 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 assert visibility_of_elements_on_10th_level, "10th-level elements are invisible" assert structure_of_11th_level, "Elements on the 11th level are absent on the page" assert visibility_of_elements_on_11th_level, "11th-level elements are invisible" + assert structure_of_12th_level, "Elements on the 12th level are absent on the page"