From c162aa7a73bba6d0572ce97aaa9a06f027295baf Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Mon, 29 Dec 2025 11:27:29 +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 | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index be2cf8d814..6412be70c7 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -57,6 +57,10 @@ def check_elements_visibility_on_5th_level(self): @allure.step("Get structure of the 6th level of nesting on the page") def get_structure_of_6th_level(self): elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS) - tags = [element.tag_name for element in elements] - print(*tags, sep='\n') + # tags = [element.tag_name for element in elements] + # print(*tags, sep='\n') return elements + + @allure.step("Check if elements of the 6th level of nesting are visible") + def check_elements_visibility_on_6th_level(self): + return all(element.is_displayed() for element in self.get_structure_of_6th_level()) diff --git a/tests/exercises_ru_words_family_page_test.py b/tests/exercises_ru_words_family_page_test.py index d1a015cd00..0c6f213cf6 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -28,6 +28,7 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises structure_of_5th_level = page.get_structure_of_5th_level() visibility_of_elements_on_5th_level = page.check_elements_visibility_on_5th_level() structure_of_6th_level = page.get_structure_of_6th_level() + visibility_of_elements_on_6th_level = page.check_elements_visibility_on_6th_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" @@ -38,3 +39,4 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises assert structure_of_5th_level, "Elements on the 5th level are absent on the page" assert visibility_of_elements_on_5th_level, "5th-level elements are invisible" assert structure_of_6th_level, "Elements on the 6th level are absent on the page" + assert visibility_of_elements_on_6th_level, "6th-level elements are invisible"