From 378978d774d92662536a8ff370e7374d899950c2 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Sat, 12 Sep 2026 19:22:06 +0300 Subject: [PATCH 1/2] ref test_erwf_01.03 Verify page visibility update exercises_ru_words_family_page_test.py, exercises_ru_words_family_page.py #623 --- pages/exercises_ru_words_family_page.py | 43 ++++++++++---------- tests/exercises_ru_words_family_page_test.py | 16 +------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index 80a5bc6457..0b5abb3cb3 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -4,6 +4,7 @@ import allure from pages.base_page import BasePage from locators.exercises_ru_words_family_page_locators import ExercisesRuWordsFamilyPageLocators +from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait as Wait @@ -64,50 +65,48 @@ def check_elements_visibility_on_6th_level1(self): @allure.step("Check if elements of the 6th level of nesting are visible -- ACTUAL") def check_elements_visibility_on_6th_level(self): - elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS) - Wait(self.driver, 10).until(lambda d: all(element.is_displayed() for element in elements)) + Wait(self.driver, 20).until( + EC.visibility_of_all_elements_located(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)) return True @allure.step("Get structure of the 7th level of nesting on the page -- for REVIEW") def get_structure_of_7th_level(self): return self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS) - @allure.step("Check if elements of the 7th level of nesting are visible -- for REVIEW") - def check_elements_visibility_on_7th_level1(self): - return all(element.is_displayed() for element in self.get_structure_of_7th_level()) - @allure.step("Check if elements of the 7th level of nesting are visible -- ACTUAL") def check_elements_visibility_on_7th_level(self): - elements = self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS) - Wait(self.driver, 10).until(lambda d: all(element.is_displayed() for element in elements)) + Wait(self.driver, 20).until( + EC.visibility_of_all_elements_located(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)) return True - @allure.step("Get structure of the 8th level of nesting on the page") + @allure.step("Get structure of the 8th level of nesting on the page -- for REVIEW") def get_structure_of_8th_level(self): return self.elements_are_present(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS) - @allure.step("Check if elements of the 8th level of nesting are visible") - def check_elements_visibility_on_8th_level(self): + @allure.step("Check if elements of the 8th level of nesting are visible -- for REVIEW") + def check_elements_visibility_on_8th_level1(self): return all(element.is_displayed() for element in self.get_structure_of_8th_level()) def check_elements_invisibility_on_8th_level(self): return all(not el.is_displayed() for el in self.driver.find_elements(*self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS)) - @allure.step("Get structure of the 9th level of nesting on the page") - def get_structure_of_9th_level(self): - return self.elements_are_present(self.locators.PAGE_NINTH_LEVEL_ELEMENTS) + @allure.step("Check if elements of the 8th level of nesting are visible -- ACTUAL") + def check_elements_visibility_on_8th_level(self): + Wait(self.driver, 20).until( + EC.visibility_of_all_elements_located(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS)) + return True - @allure.step("Check if elements of the 9th level of nesting are visible") + @allure.step("Check if elements of the 9th level of nesting are visible -- " + "NOT USED due to the ineffectiveness of unification") def check_elements_visibility_on_9th_level(self): - return all(element.is_displayed() for element in self.get_structure_of_9th_level()) - - @allure.step("Get structure of the 10th level of nesting on the page") - def get_structure_of_10th_level(self): - return self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS) + Wait(self.driver).until(EC.visibility_of_all_elements_located(self.locators.PAGE_NINTH_LEVEL_ELEMENTS)) + return True - @allure.step("Check if elements of the 10th level of nesting are visible") + @allure.step("Check if elements of the 10th level of nesting are visible -- " + "NOT USED due to the ineffectiveness of unification") def check_elements_visibility_on_10th_level(self): - return all(element.is_displayed() for element in self.get_structure_of_10th_level()) + Wait(self.driver).until(EC.visibility_of_all_elements_located(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)) + return True @allure.step("Get structure of the 11th level of nesting on the page") def get_structure_of_11th_level(self): diff --git a/tests/exercises_ru_words_family_page_test.py b/tests/exercises_ru_words_family_page_test.py index 1012586e5e..02fd7ff08a 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -27,29 +27,15 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises assert visibility_of_elements_on_3rd_level, "3rd-level elements are invisible" assert visibility_of_elements_on_4th_level, "4th-level elements are invisible" - @allure.title("Verify composition, visibility of elements on the 6st-10th levels of nesting on the page") + @allure.title("Verify composition, visibility of elements on the 6st-8th levels of nesting on the page") def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open): page = erwfPage(driver) - # structure_of_6th_level = page.get_structure_of_6th_level() visibility_of_elements_on_6th_level = page.check_elements_visibility_on_6th_level() - # structure_of_7th_level = page.get_structure_of_7th_level() visibility_of_elements_on_7th_level = page.check_elements_visibility_on_7th_level() - structure_of_8th_level = page.get_structure_of_8th_level() visibility_of_elements_on_8th_level = page.check_elements_visibility_on_8th_level() - structure_of_9th_level = page.get_structure_of_9th_level() - visibility_of_elements_on_9th_level = page.check_elements_visibility_on_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_6th_level, "Elements on the 6th level are absent on the page" assert visibility_of_elements_on_6th_level, "6th-level elements are invisible" - # assert structure_of_7th_level, "Elements on the 7th level are absent on the page" assert visibility_of_elements_on_7th_level, "7th-level elements are invisible" - assert structure_of_8th_level, "Elements on the 8th level are absent on the page" assert visibility_of_elements_on_8th_level, "8th-level elements are invisible" - assert structure_of_9th_level, "Elements on the 9th level are absent on the page" - assert not visibility_of_elements_on_9th_level, "9th-level elements are visible" - assert structure_of_10th_level, "Elements on the 10th level are absent on the page" - assert not visibility_of_elements_on_10th_level, "10th-level elements are visible" @allure.title("Verify composition, visibility of elements on the 11st-14th levels of nesting on the page") def test_erwf_01_04_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open): From 6ed28ce3fa3fc107edffef974d5dd7ef75063bf0 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Sat, 12 Sep 2026 19:24:31 +0300 Subject: [PATCH 2/2] ref test_erwf_01.03 Verify page visibility update exercises_ru_words_family_page_test.py, exercises_ru_words_family_page.py #623 --- pages/exercises_ru_words_family_page.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index 0b5abb3cb3..7d9ba8da09 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -99,13 +99,13 @@ def check_elements_visibility_on_8th_level(self): @allure.step("Check if elements of the 9th level of nesting are visible -- " "NOT USED due to the ineffectiveness of unification") def check_elements_visibility_on_9th_level(self): - Wait(self.driver).until(EC.visibility_of_all_elements_located(self.locators.PAGE_NINTH_LEVEL_ELEMENTS)) + Wait(self.driver, 5).until(EC.visibility_of_all_elements_located(self.locators.PAGE_NINTH_LEVEL_ELEMENTS)) return True @allure.step("Check if elements of the 10th level of nesting are visible -- " "NOT USED due to the ineffectiveness of unification") def check_elements_visibility_on_10th_level(self): - Wait(self.driver).until(EC.visibility_of_all_elements_located(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)) + Wait(self.driver, 5).until(EC.visibility_of_all_elements_located(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)) return True @allure.step("Get structure of the 11th level of nesting on the page")