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
49 changes: 37 additions & 12 deletions pages/exercises_ru_words_family_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,67 @@ def check_presence_of_page_content(self):
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")
@allure.step("Get structure of the 1st level of nesting on the page -- FOR REVIEW")
def get_structure_of_1st_level(self):
return self.elements_are_present(self.locators.PAGE_FIRST_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 1st level of nesting are visible")
def check_elements_visibility_on_1st_level(self):
@allure.step("Check if elements of the 1st level of nesting are visible -- FOR REVIEW")
def check_elements_visibility_on_1st_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_1st_level())

@allure.step("Get structure of the 2nd level of nesting on the page")
@allure.step("Check if elements of the 1st level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_1st_level(self):
elements = self.elements_are_present(self.locators.PAGE_FIRST_LEVEL_ELEMENTS)
return all(element.is_displayed() for element in elements)

@allure.step("Get structure of the 2nd level of nesting on the page -- FOR REVIEW")
def get_structure_of_2nd_level(self):
return self.elements_are_present(self.locators.PAGE_SECOND_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 2nd level of nesting are visible")
def check_elements_visibility_on_2nd_level(self):
@allure.step("Check if elements of the 2nd level of nesting are visible -- FOR REVIEW")
def check_elements_visibility_on_2nd_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_2nd_level())

@allure.step("Get structure of the 3rd level of nesting on the page")
@allure.step("Check if elements of the 2nd level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_2nd_level(self):
elements = self.elements_are_present(self.locators.PAGE_SECOND_LEVEL_ELEMENTS)
return all(element.is_displayed() for element in elements)

@allure.step("Get structure of the 3rd level of nesting on the page -- FOR REVIEW")
def get_structure_of_3rd_level(self):
return self.elements_are_present(self.locators.PAGE_THIRD_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 3rd level of nesting are visible")
def check_elements_visibility_on_3rd_level(self):
@allure.step("Check if elements of the 3rd level of nesting are visible -- FOR REVIEW")
def check_elements_visibility_on_3rd_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_3rd_level())

@allure.step("Check if elements of the 3rd level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_3rd_level(self):
elements = self.elements_are_present(self.locators.PAGE_THIRD_LEVEL_ELEMENTS)
return all(element.is_displayed() for element in elements)

@allure.step("Get structure of the 4th level of nesting on the page")
def get_structure_of_4th_level(self):
return self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS)

@allure.step("Get structure of the 5th level of nesting on the page")
@allure.step("Check if elements of the 4th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_4th_level(self):
elements = self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS)
return all(element.is_displayed() for element in elements)

@allure.step("Get structure of the 5th level of nesting on the page -- FOR REVIEW")
def get_structure_of_5th_level(self):
return self.elements_are_present(self.locators.PAGE_FIFTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 5th level of nesting are visible")
def check_elements_visibility_on_5th_level(self):
@allure.step("Check if elements of the 5th level of nesting are visible -- FOR REVIEW")
def check_elements_visibility_on_5th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_5th_level())

@allure.step("Check if elements of the 5th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_5th_level(self):
elements = self.elements_are_present(self.locators.PAGE_FIFTH_LEVEL_ELEMENTS)
return all(element.is_displayed() for element in elements)

@allure.step("Get structure of the 6th level of nesting on the page")
def get_structure_of_6th_level(self):
return self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)
Expand Down
22 changes: 12 additions & 10 deletions tests/exercises_ru_words_family_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ def test_erwf_01_01_verify_page_presence_and_visibility(self, driver, exercises_
@allure.title("Verify composition, visibility of elements on the 1st-5th levels of nesting on the page")
def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):
page = erwfPage(driver)
structure_of_1st_level = page.get_structure_of_1st_level()
# structure_of_1st_level = page.get_structure_of_1st_level()
visibility_of_elements_on_1st_level = page.check_elements_visibility_on_1st_level()
structure_of_2nd_level = page.get_structure_of_2nd_level()
# structure_of_2nd_level = page.get_structure_of_2nd_level()
visibility_of_elements_on_2nd_level = page.check_elements_visibility_on_2nd_level()
structure_of_3rd_level = page.get_structure_of_3rd_level()
# structure_of_3rd_level = page.get_structure_of_3rd_level()
visibility_of_elements_on_3rd_level = page.check_elements_visibility_on_3rd_level()
structure_of_4th_level = page.get_structure_of_4th_level()
structure_of_5th_level = page.get_structure_of_5th_level()
# structure_of_4th_level = page.check_elements_visibility_on_4th_level()
visibility_of_elements_on_4th_level = page.check_elements_visibility_on_4th_level()
# structure_of_5th_level = page.get_structure_of_5th_level()
visibility_of_elements_on_5th_level = page.check_elements_visibility_on_5th_level()
assert structure_of_1st_level, "The page is empty"
# assert structure_of_1st_level, "The page is empty"
assert visibility_of_elements_on_1st_level, "1th-level elements are invisible"
assert structure_of_2nd_level, "Elements on the 2nd level are absent on the page"
# assert structure_of_2nd_level, "Elements on the 2nd level are absent on the page"
assert visibility_of_elements_on_2nd_level, "2nd-level elements are invisible"
assert structure_of_3rd_level, "Elements on the 3rd level are absent on the page"
# assert structure_of_3rd_level, "Elements on the 3rd level are absent on the page"
assert visibility_of_elements_on_3rd_level, "3rd-level elements are invisible"
assert structure_of_4th_level, "Elements on the 4th level are absent on the page"
assert structure_of_5th_level, "Elements on the 5th level are absent on the page"
# assert structure_of_4th_level, "Elements on the 4th level are absent on the page"
assert visibility_of_elements_on_4th_level, "3rd-level elements are invisible"
# assert structure_of_5th_level, "Elements on the 5th level are absent on the page"
assert visibility_of_elements_on_5th_level, "5th-level elements are invisible"

@allure.title("Verify composition, visibility of elements on the 6st-10th levels of nesting on the page")
Expand Down
Loading