diff --git a/locators/exercises_ru_words_page_locators.py b/locators/exercises_ru_words_page_locators.py index e258c2bcd4..d92133b7cc 100644 --- a/locators/exercises_ru_words_page_locators.py +++ b/locators/exercises_ru_words_page_locators.py @@ -16,6 +16,7 @@ class ExercisesRuWordsPageLocators: PAGE_LIST2 = (By.XPATH, "//aside//li") PAGE_LIST3 = (By.XPATH, '//div[contains(@class, "series-page")]//a') # PAGE_LIST3 = (By.XPATH, "//main//div/a") + CARD_IMAGES_LIST4 = (By.XPATH, '//div[contains(@style, "svg")]') class HeaderLocators: diff --git a/pages/exercises_ru_words_page.py b/pages/exercises_ru_words_page.py index 136f4c7930..a93789d0cf 100644 --- a/pages/exercises_ru_words_page.py +++ b/pages/exercises_ru_words_page.py @@ -99,9 +99,9 @@ def check_elements_visibility_on_7th_level(self): def check_list1_presence(self): elements = self.elements_are_present(self.locators.PAGE_LIST1) # tags = [element.tag_name for element in elements] - tags = [element.text for element in elements] - print(tags) - print(len(tags)) + tags_text = [element.text for element in elements] + print(tags_text) + print(len(tags_text)) return elements @allure.step("Check the list1 is visible") @@ -112,9 +112,9 @@ def check_list1_visibility(self): def check_list2_presence(self): elements = self.elements_are_present(self.locators.PAGE_LIST2) # tags = [element.tag_name for element in elements] - tags = [element.text for element in elements] - print(tags) - print(len(tags)) + tags_text = [element.text for element in elements] + print(tags_text) + print(len(tags_text)) return elements @allure.step("Check the list2 is visible") @@ -125,15 +125,28 @@ def check_list2_visibility(self): def check_list3_presence(self): elements = self.elements_are_present(self.locators.PAGE_LIST3) # tags = [element.tag_name for element in elements] - tags = [element.text for element in elements] - print(tags) - print(len(tags)) + tags_text = [element.text for element in elements] + print(tags_text) + print(len(tags_text)) return elements @allure.step("Check the list3 is visible") def check_list3_visibility(self): return self.element_is_visible(self.locators.PAGE_LIST3) + @allure.step("Check the list4 on the 6th level of nesting is present on the page") + def check_list4_presence(self): + elements = self.elements_are_present(self.locators.CARD_IMAGES_LIST4) + # tags = [element.tag_name for element in elements] + style = [element.get_attribute("style") for element in elements] + print(*style, sep='\n') + print(len(style)) + return elements + + @allure.step("Check the list4 is visible") + def check_list4_visibility(self): + return self.element_is_visible(self.locators.CARD_IMAGES_LIST4) + # Checking text on the tab&page @allure.step("Get value of the title of the tab") def get_value_of_tab_title(self): diff --git a/tests/exercises_ru_words_page_test.py b/tests/exercises_ru_words_page_test.py index fab3e32be7..e4bfd1504d 100644 --- a/tests/exercises_ru_words_page_test.py +++ b/tests/exercises_ru_words_page_test.py @@ -57,12 +57,16 @@ def test_erw_01_03_verify_page_structural_elements(self, driver, exercises_ru_wo list2_visibility = page.check_list2_visibility() list3_on_5th_level = page.check_list3_presence() list3_visibility = page.check_list3_visibility() + list4_on_6th_level = page.check_list4_presence() + list4_visibility = page.check_list4_visibility() assert list1_on_4th_level, "The list1 on the 4th level is absent on the page" assert list1_visibility, "The list1 on the 4th level is invisible" assert list2_on_4th_level, "The list2 on the 4th level is absent on the page" assert list2_visibility, "The list2 on the 4th 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" class TestGroupsPageText: @allure.title("Verify value of the title of the tab")