Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pages/used_resources_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions tests/used_resources_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading