diff --git a/pages/used_resources_page.py b/pages/used_resources_page.py index b9f5a59a50..dc3c33d15d 100644 --- a/pages/used_resources_page.py +++ b/pages/used_resources_page.py @@ -113,13 +113,19 @@ def click_on_links(self): def get_list_of_icons(self): return self.elements_are_present(self.locators.SECTION_ICONS) - @allure.step("Check all icons in sections are visible") + @allure.step("Check all icons on the page are visible") def check_icons_visibility(self): - return all(icon.is_displayed() for icon in self.get_list_of_icons()) + visible_icons = self.get_list_of_icons()[2:] + print(len(visible_icons)) + return all(icon.is_displayed() for icon in visible_icons) + # return all(icon.is_displayed() for icon in self.get_list_of_icons()) - @allure.step("Get attribute 'xmlns' of icons in sections") + @allure.step("Get attribute 'xmlns' of icons on the page") def get_icons_xmlns(self): - return [icon.get_attribute('xmlns') for icon in self.get_list_of_icons()] + icons_xmlns = [icon.get_attribute('xmlns') for icon in self.get_list_of_icons()[2:]] + print(*icons_xmlns, len(icons_xmlns), sep='\n') + return icons_xmlns + # return [icon.get_attribute('xmlns') for icon in self.get_list_of_icons()] @allure.step("Get the list of sizes of icons") def get_icons_sizes(self): diff --git a/tests/used_resources_page_test.py b/tests/used_resources_page_test.py index 853a982692..7caf1e8374 100644 --- a/tests/used_resources_page_test.py +++ b/tests/used_resources_page_test.py @@ -92,17 +92,17 @@ def test_ur_03_02_verify_links_lead_to_the_correct_pages(self, driver, used_reso "Links in the sections lead to incorrect pages after clicking" class TestURPageIcons: - @allure.title("Verify presence, visibility and attributes of icons in sections") + @allure.title("Verify presence, visibility and attributes of icons on the page") def test_ur_04_01_verify_icons_in_sections(self, driver, used_resources_page_open): page = urPage(driver) icons_presence = page.get_list_of_icons() icons_visibility = page.check_icons_visibility() icons_xmlns = page.get_icons_xmlns() assert icons_presence, "Icons in sections are absent" - assert icons_visibility, "Icons in sections are invisible" - assert icons_xmlns, "The 'xmlns' attribute value of icons in sections are empty" + assert icons_visibility, "Icons on the page are invisible" + assert icons_xmlns, "The 'xmlns' attribute value of icons on the page are empty" assert all(element == urPD.icons_xmlns for element in icons_xmlns), \ - "The 'xmlns' attribute value of some icons is empty or invalid" + "The 'xmlns' attribute value of some icons on the page is empty or invalid" @allure.title("Verify sizes of icons in sections") def test_ur_04_02_verify_icons_sizes(self, driver, used_resources_page_open):