From 4c233350ad079ae605396aca386789a9bdaaab9c Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Thu, 19 Feb 2026 23:34:24 +0300 Subject: [PATCH] ref test_erwf_01.05 Verify 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 --- 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 | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/locators/exercises_ru_words_family_page_locators.py b/locators/exercises_ru_words_family_page_locators.py index bc17f950f6..74292bb837 100644 --- a/locators/exercises_ru_words_family_page_locators.py +++ b/locators/exercises_ru_words_family_page_locators.py @@ -19,3 +19,4 @@ class ExercisesRuWordsFamilyPageLocators: PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*") PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*") PAGE_LIST1 = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a') + PAGE_LIST2 = (By.XPATH, "//aside//button") diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index c2a781ed9a..95ea6b437f 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -134,11 +134,15 @@ def check_elements_visibility_on_14th_level(self): @allure.step("Check the list1 on the 5th level of nesting is present on the page") def get_list1_of_breadcrumbs_links(self): - elements = self.elements_are_present(self.locators.PAGE_LIST1) - att = [element.get_attribute("href") for element in elements] - print(*att, len(att), sep='\n') - return elements + return self.elements_are_present(self.locators.PAGE_LIST1) @allure.step("Check the list1 is visible") def check_list1_visibility(self): return all(element.is_displayed() for element in self.get_list1_of_breadcrumbs_links()) + + @allure.step("Check the list2 on the 5th level of nesting is present on the page") + def get_list2_of_group_links(self): + elements = self.elements_are_present(self.locators.PAGE_LIST2) + att = [element.get_attribute("title") for element in elements] + print(*att, len(att), 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 3637879177..2be27c726c 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -86,5 +86,7 @@ def test_erwf_01_05_verify_page_structural_elements(self, driver, exercises_ru_w page = erwfPage(driver) list1_on_5th_level = page.get_list1_of_breadcrumbs_links() list1_visibility = page.check_list1_visibility() + list2_on_5th_level = page.get_list2_of_group_links() assert list1_on_5th_level, "The list1 on the 5th level is absent on the page" assert list1_visibility, "The list1 on the 5th level is invisible" + assert list2_on_5th_level, "The list2 on the 5th level is absent on the page"