diff --git a/locators/exercises_ru_similar_phrases_page_locators.py b/locators/exercises_ru_similar_phrases_page_locators.py index 436661146b..29cf91f087 100644 --- a/locators/exercises_ru_similar_phrases_page_locators.py +++ b/locators/exercises_ru_similar_phrases_page_locators.py @@ -14,3 +14,4 @@ class ExercisesRuSimilarPhrasesPageLocators: 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') + CARD_IMAGES_LIST4 = (By.XPATH, '//div[contains(@style, "svg")]') diff --git a/pages/exercises_ru_similar_phrases_page.py b/pages/exercises_ru_similar_phrases_page.py index f58fcd2122..56cb30fd95 100644 --- a/pages/exercises_ru_similar_phrases_page.py +++ b/pages/exercises_ru_similar_phrases_page.py @@ -125,3 +125,14 @@ def get_list3_of_subgroup_links(self): @allure.step("Check the list3 is visible") def check_list3_visibility(self): return all(element.is_displayed() for element in self.get_list3_of_subgroup_links()) + + @allure.step("Check the list4 on the 6th level of nesting is present on the page") + def get_list4_of_links(self): + elements = self.elements_are_present(self.locators.CARD_IMAGES_LIST4) + tags = [element.tag_name for element in elements] + print(*tags) + return elements + + @allure.step("Check the list4 is visible") + def check_list4_visibility(self): + return all(element.is_displayed() for element in self.get_list4_of_links()) diff --git a/tests/exercises_ru_similar_phrases_page_test.py b/tests/exercises_ru_similar_phrases_page_test.py index 7cef0404ed..67c76f842f 100644 --- a/tests/exercises_ru_similar_phrases_page_test.py +++ b/tests/exercises_ru_similar_phrases_page_test.py @@ -55,9 +55,13 @@ def test_ersp_01_03_verify_page_structural_elements(self, driver, exercises_ru_s list2_visibility = page.check_list2_visibility() list3_on_5th_level = page.get_list3_of_subgroup_links() list3_visibility = page.check_list3_visibility() + list4_on_6th_level = page.get_list4_of_links() + list4_visibility = page.check_list4_visibility() 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_5th_level, "The list3 on the 5th level is absent on the page" assert list3_visibility, "The list3 on the 5th level is invisible" + assert list4_on_6th_level, "The list4 on the 6th level is absent on the page" + assert list4_visibility, "The list4 on the 6th level is invisible"