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
1 change: 1 addition & 0 deletions locators/exercises_ru_words_family_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

class ExercisesRuWordsFamilyPageLocators:
PAGE_CONTENT = (By.TAG_NAME, "main")
PAGE_FIRST_LEVEL_ELEMENTS = (By.XPATH, "//main/*")
7 changes: 7 additions & 0 deletions pages/exercises_ru_words_family_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ def check_presence_of_page_content(self):
@allure.step("Check if page content is visible on the page")
def check_visibility_of_page_content(self):
return self.element_is_visible(self.locators.PAGE_CONTENT)

@allure.step("Get structure of the 1st level of nesting on the page")
def get_structure_of_1st_level(self):
elements = self.elements_are_present(self.locators.PAGE_FIRST_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
print(*tags, sep='\n')
return elements
6 changes: 6 additions & 0 deletions tests/exercises_ru_words_family_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ def test_erwf_01_01_verify_page_presence_and_visibility(self, driver, exercises_
page_content_visibility = page.check_visibility_of_page_content()
assert page_content_presence, "The page content is absent in DOM"
assert page_content_visibility, "The page content is invisible"

@allure.title("Verify composition of elements on the 1st level of nesting on the page")
def test_erwf_01_02_verify_page_structure(self, driver, exercises_ru_words_family_page_open):
page = erwfPage(driver)
structure_of_1st_level = page.get_structure_of_1st_level()
assert structure_of_1st_level, "The page is empty"