diff --git a/locators/exercises_ru_words_family_page_locators.py b/locators/exercises_ru_words_family_page_locators.py index 74292bb837..aa9490051d 100644 --- a/locators/exercises_ru_words_family_page_locators.py +++ b/locators/exercises_ru_words_family_page_locators.py @@ -20,3 +20,4 @@ class ExercisesRuWordsFamilyPageLocators: PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*") PAGE_LIST1 = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a') PAGE_LIST2 = (By.XPATH, "//aside//button") + PAGE_LIST3 = (By.XPATH, '//div[contains(@class, "series-page")]//a') diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index 6ac0538afb..2e54087145 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -141,12 +141,16 @@ 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 + def get_list2_of_series_links(self): + return self.elements_are_present(self.locators.PAGE_LIST2) @allure.step("Check the list2 is visible") def check_list2_visibility(self): - return all(element.is_displayed() for element in self.get_list2_of_group_links()) + return all(element.is_displayed() for element in self.get_list2_of_series_links()) + + @allure.step("Check the list3 on the 11th level of nesting is present on the page") + def get_list3_of_exercises_links(self): + elements = self.elements_are_present(self.locators.PAGE_LIST3) + 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 44046c728c..c63a06c5eb 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -86,9 +86,11 @@ 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() + list2_on_5th_level = page.get_list2_of_series_links() list2_visibility = page.check_list2_visibility() + list3_on_11th_level = page.get_list3_of_exercises_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" assert list2_visibility, "The list2 on the 5th level is invisible" + assert list3_on_11th_level, "The list3 on the 11th level is absent on the page"