From a08a0a3b39d521dd5fe5cd12d4b9d131c05d556c Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Mon, 12 Jan 2026 08:06:16 +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 #623 --- pages/exercises_ru_words_family_page.py | 8 ++++++-- tests/exercises_ru_words_family_page_test.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index b5f14183e2..1024005264 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -81,6 +81,10 @@ def get_structure_of_9th_level(self): @allure.step("Get structure of the 10th level of nesting on the page") def get_structure_of_10th_level(self): elements = self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS) - tags = [element.tag_name for element in elements] - print(*tags, len(tags), sep='\n') + # tags = [element.tag_name for element in elements] + # print(*tags, len(tags), sep='\n') return elements + + @allure.step("Check if elements of the 10th level of nesting are visible") + def check_elements_visibility_on_10th_level(self): + return all(element.is_displayed() for element in self.get_structure_of_10th_level()) diff --git a/tests/exercises_ru_words_family_page_test.py b/tests/exercises_ru_words_family_page_test.py index 8ae8cc8cff..c029a82e50 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-8th levels of nesting on the page") + @allure.title("Verify composition, visibility of elements on the 1st-10th 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() @@ -34,6 +34,7 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises structure_of_8th_level = page.get_structure_of_8th_level() structure_of_9th_level = page.get_structure_of_9th_level() structure_of_10th_level = page.get_structure_of_10th_level() + visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_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" @@ -50,3 +51,4 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises assert structure_of_8th_level, "Elements on the 8th level are absent on the page" assert structure_of_9th_level, "Elements on the 9th level are absent on the page" assert structure_of_10th_level, "Elements on the 10th level are absent on the page" + assert visibility_of_elements_on_10th_level, "10th-level elements are invisible"