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
68 changes: 36 additions & 32 deletions pages/exercises_ru_words_family_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,18 @@ def check_elements_visibility_on_5th_level(self):
Wait(self.driver, 10).until(lambda d: all(element.is_displayed() for element in elements))
return True

@allure.step("Get structure of the 6th level of nesting on the page -- for REVIEW")
def get_structure_of_6th_level(self):
return self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 6th level of nesting are visible -- for REVIEW")
def check_elements_visibility_on_6th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_6th_level())

@allure.step("Check if elements of the 6th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_6th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS))
return True

@allure.step("Get structure of the 7th level of nesting on the page -- for REVIEW")
def get_structure_of_7th_level(self):
return self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 7th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_7th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS))
return True

@allure.step("Get structure of the 8th level of nesting on the page -- for REVIEW")
def get_structure_of_8th_level(self):
return self.elements_are_present(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 8th level of nesting are visible -- for REVIEW")
def check_elements_visibility_on_8th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_8th_level())

def check_elements_invisibility_on_8th_level(self):
return all(not el.is_displayed() for el in self.driver.find_elements(*self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS))

Expand All @@ -108,41 +88,65 @@ def check_elements_visibility_on_10th_level(self):
Wait(self.driver, 5).until(EC.visibility_of_all_elements_located(self.locators.PAGE_TENTH_LEVEL_ELEMENTS))
return True

@allure.step("Get structure of the 11th level of nesting on the page")
@allure.step("Get structure of the 11th level of nesting on the page -- for REVIEW")
def get_structure_of_11th_level(self):
return self.elements_are_present(self.locators.PAGE_ELEVENTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 11th level of nesting are visible")
def check_elements_visibility_on_11th_level(self):
@allure.step("Check if elements of the 11th level of nesting are visible -- for REVIEW")
def check_elements_visibility_on_11th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_11th_level())

@allure.step("Get structure of the 12th level of nesting on the page")
@allure.step("Check if elements of the 11th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_11th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_ELEVENTH_LEVEL_ELEMENTS))
return True

@allure.step("Get structure of the 12th level of nesting on the page -- for REVIEW")
def get_structure_of_12th_level(self):
return self.elements_are_present(self.locators.PAGE_TWELFTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 12th level of nesting are visible")
def check_elements_visibility_on_12th_level(self):
@allure.step("Check if elements of the 12th level of nesting are visible -- for REVIEW")
def check_elements_visibility_on_12th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_12th_level())

@allure.step("Get structure of the 13th level of nesting on the page")
@allure.step("Check if elements of the 12th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_12th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_TWELFTH_LEVEL_ELEMENTS))
return True

@allure.step("Get structure of the 13th level of nesting on the page -- for REVIEW")
def get_structure_of_13th_level(self):
return self.elements_are_present(self.locators.PAGE_THIRTEENTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 13th level of nesting are visible")
def check_elements_visibility_on_13th_level(self):
@allure.step("Check if elements of the 13th level of nesting are visible -- for REVIEW")
def check_elements_visibility_on_13th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_13th_level())

@allure.step("Get structure of the 14th level of nesting on the page")
@allure.step("Check if elements of the 13th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_13th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_THIRTEENTH_LEVEL_ELEMENTS))
return True

@allure.step("Get structure of the 14th level of nesting on the page -- for REVIEW")
def get_structure_of_14th_level(self):
elements = self.elements_are_present(self.locators.PAGE_FOURTEENTH_LEVEL_ELEMENTS)
# tags = [element.tag_name for element in elements]
# print(*tags, len(tags), sep='\n')
return elements

@allure.step("Check if elements of the 14th level of nesting are visible")
def check_elements_visibility_on_14th_level(self):
@allure.step("Check if elements of the 14th level of nesting are visible -- for REVIEW")
def check_elements_visibility_on_14th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_14th_level())

@allure.step("Check if elements of the 14th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_14th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_FOURTEENTH_LEVEL_ELEMENTS))
return True

@allure.step("Check the list1 on the 5th level of nesting is present on the page")
def get_list1_of_breadcrumbs_links(self):
return self.elements_are_present(self.locators.PAGE_LIST1_BREADCRUMBS)
Expand Down
16 changes: 4 additions & 12 deletions tests/exercises_ru_words_family_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,13 @@ def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises
@allure.title("Verify composition, visibility of elements on the 11st-14th levels of nesting on the page")
def test_erwf_01_04_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):
page = erwfPage(driver)
structure_of_11th_level = page.get_structure_of_11th_level()
# visibility_of_elements_on_11th_level = page.check_elements_visibility_on_11th_level()
structure_of_12th_level = page.get_structure_of_12th_level()
# visibility_of_elements_on_12th_level = page.check_elements_visibility_on_12th_level()
structure_of_13th_level = page.get_structure_of_13th_level()
visibility_of_elements_on_11th_level = page.check_elements_visibility_on_11th_level()
visibility_of_elements_on_12th_level = page.check_elements_visibility_on_12th_level()
visibility_of_elements_on_13th_level = page.check_elements_visibility_on_13th_level()
structure_of_14th_level = page.get_structure_of_14th_level()
visibility_of_elements_on_14th_level = page.check_elements_visibility_on_14th_level()
assert structure_of_11th_level, "Elements on the 11th level are absent on the page"
# assert visibility_of_elements_on_11th_level, "11th-level elements are invisible"
assert structure_of_12th_level, "Elements on the 12th level are absent on the page"
# assert visibility_of_elements_on_12th_level, "12th-level elements are invisible"
assert structure_of_13th_level, "Elements on the 13th level are absent on the page"
assert visibility_of_elements_on_11th_level, "11th-level elements are invisible"
assert visibility_of_elements_on_12th_level, "12th-level elements are invisible"
assert visibility_of_elements_on_13th_level, "13th-level elements are invisible"
assert structure_of_14th_level, "Elements on the 14th level are absent on the page"
assert visibility_of_elements_on_14th_level, "14th-level elements are invisible"

@allure.title("Verify presence, visibility of lists on the page")
Expand Down
Loading