diff --git a/locators/exercises_ru_words_page_locators.py b/locators/exercises_ru_words_page_locators.py index fa97fe1e58..b4b872eb03 100644 --- a/locators/exercises_ru_words_page_locators.py +++ b/locators/exercises_ru_words_page_locators.py @@ -9,3 +9,4 @@ class ExercisesRuWordsPageLocators: PAGE_THIRD_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*") PAGE_FOURTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*") PAGE_FIFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*") + PAGE_SIXTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*") diff --git a/pages/exercises_ru_words_page.py b/pages/exercises_ru_words_page.py index ce08169e19..1caf3812cf 100644 --- a/pages/exercises_ru_words_page.py +++ b/pages/exercises_ru_words_page.py @@ -70,3 +70,14 @@ def get_structure_of_5th_level(self): @allure.step("Check if elements of the 5th level of nesting are visible") def check_elements_visibility_on_5th_level(self): return all(element.is_displayed() for element in self.get_structure_of_5th_level()) + + @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) + 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_page_test.py b/tests/exercises_ru_words_page_test.py index 73be994210..8da273178c 100644 --- a/tests/exercises_ru_words_page_test.py +++ b/tests/exercises_ru_words_page_test.py @@ -14,7 +14,7 @@ def test_erw_01_01_verify_page_presence_and_visibility(self, driver, exercises_r assert page_content_presence, "The page content is absent in DOM" assert page_content_visibility, "The page content is invisible" - @allure.title("Verify composition, visibility of elements on the 1st-4th levels of nesting on the page") + @allure.title("Verify composition, visibility of elements on the 1st-6th levels of nesting on the page") def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_ru_words_page_open): page = ExercisesRuWordsPage(driver) structure_of_1st_level = page.get_structure_of_1st_level() @@ -27,6 +27,8 @@ def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_ visibility_of_elements_on_4th_level = page.check_elements_visibility_on_4th_level() 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" @@ -37,3 +39,5 @@ def test_erw_01_02_verify_page_structure_and_visibility(self, driver, exercises_ assert visibility_of_elements_on_4th_level, "4th-level elements are invisible" 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"