diff --git a/locators/exercises_ru_words_family_page_locators.py b/locators/exercises_ru_words_family_page_locators.py index bb1f0b0377..c3f96e267e 100644 --- a/locators/exercises_ru_words_family_page_locators.py +++ b/locators/exercises_ru_words_family_page_locators.py @@ -11,12 +11,13 @@ class ExercisesRuWordsFamilyPageLocators: PAGE_FIFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*") PAGE_SIXTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*") PAGE_SEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*") - PAGE_EIGHTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*") + PAGE_EIGHTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/a") PAGE_NINTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*") PAGE_TENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*") PAGE_ELEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*") PAGE_TWELFTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*") - PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*") + # PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*") + PAGE_THIRTEENTH_LEVEL_ELEMENTS = (By.XPATH, '//main//a/div') PAGE_FOURTEENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*/*/*/*/*/*/*/*") PAGE_LIST1_BREADCRUMBS = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a') PAGE_LIST2_SERIES = (By.XPATH, "//aside//button") diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index ed749dd21d..a3b66e7846 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -72,7 +72,10 @@ def check_elements_visibility_on_7th_level(self): @allure.step("Get structure of the 8th level of nesting on the page") def get_structure_of_8th_level(self): - return self.elements_are_present(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS) + elements = self.elements_are_present(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS) + tags = [element.tag_name for element in elements] + print(*tags, len(tags), sep='\n') + return elements @allure.step("Check if elements of the 8th level of nesting are visible") def check_elements_visibility_on_8th_level(self): @@ -83,7 +86,10 @@ def check_elements_invisibility_on_8th_level(self): @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) + elements = self.elements_are_present(self.locators.PAGE_NINTH_LEVEL_ELEMENTS) + tags = [element.tag_name for element in elements] + print(*tags, len(tags), sep='\n') + return elements @allure.step("Check if elements of the 9th level of nesting are visible") def check_elements_visibility_on_9th_level(self): @@ -91,7 +97,10 @@ def check_elements_visibility_on_9th_level(self): @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) + elements = self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS) + tags = [element.tag_name for element in elements] + print(*tags, len(tags), sep='\n') + return elements @allure.step("Check if elements of the 10th level of nesting are visible") def check_elements_visibility_on_10th_level(self): @@ -115,7 +124,10 @@ def check_elements_visibility_on_12th_level(self): @allure.step("Get structure of the 13th level of nesting on the page") def get_structure_of_13th_level(self): - return self.elements_are_present(self.locators.PAGE_THIRTEENTH_LEVEL_ELEMENTS) + elements = self.elements_are_present(self.locators.PAGE_THIRTEENTH_LEVEL_ELEMENTS) + tags = [element.tag_name for element in elements] + print(*tags, len(tags), sep='\n') + return elements @allure.step("Check if elements of the 13th level of nesting are visible") def check_elements_visibility_on_13th_level(self): diff --git a/tests/exercises_ru_words_family_page_test.py b/tests/exercises_ru_words_family_page_test.py index 9570dca85c..060c8f5902 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -55,11 +55,11 @@ def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises 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 not visibility_of_elements_on_8th_level, "8th-level elements are visible" + 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 visibility_of_elements_on_10th_level, "10th-level elements are invisible" + 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):