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
43 changes: 21 additions & 22 deletions pages/exercises_ru_words_family_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import allure
from pages.base_page import BasePage
from locators.exercises_ru_words_family_page_locators import ExercisesRuWordsFamilyPageLocators
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait as Wait


Expand Down Expand Up @@ -64,50 +65,48 @@ def check_elements_visibility_on_6th_level1(self):

@allure.step("Check if elements of the 6th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_6th_level(self):
elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)
Wait(self.driver, 10).until(lambda d: all(element.is_displayed() for element in elements))
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 -- for REVIEW")
def check_elements_visibility_on_7th_level1(self):
return all(element.is_displayed() for element in self.get_structure_of_7th_level())

@allure.step("Check if elements of the 7th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_7th_level(self):
elements = self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)
Wait(self.driver, 10).until(lambda d: all(element.is_displayed() for element in elements))
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")
@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")
def check_elements_visibility_on_8th_level(self):
@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))

@allure.step("Get structure of the 9th level of nesting on the page")
def get_structure_of_9th_level(self):
return self.elements_are_present(self.locators.PAGE_NINTH_LEVEL_ELEMENTS)
@allure.step("Check if elements of the 8th level of nesting are visible -- ACTUAL")
def check_elements_visibility_on_8th_level(self):
Wait(self.driver, 20).until(
EC.visibility_of_all_elements_located(self.locators.PAGE_EIGHTH_LEVEL_ELEMENTS))
return True

@allure.step("Check if elements of the 9th level of nesting are visible")
@allure.step("Check if elements of the 9th level of nesting are visible -- "
"NOT USED due to the ineffectiveness of unification")
def check_elements_visibility_on_9th_level(self):
return all(element.is_displayed() for element in self.get_structure_of_9th_level())

@allure.step("Get structure of the 10th level of nesting on the page")
def get_structure_of_10th_level(self):
return self.elements_are_present(self.locators.PAGE_TENTH_LEVEL_ELEMENTS)
Wait(self.driver, 5).until(EC.visibility_of_all_elements_located(self.locators.PAGE_NINTH_LEVEL_ELEMENTS))
return True

@allure.step("Check if elements of the 10th level of nesting are visible")
@allure.step("Check if elements of the 10th level of nesting are visible -- "
"NOT USED due to the ineffectiveness of unification")
def check_elements_visibility_on_10th_level(self):
return all(element.is_displayed() for element in self.get_structure_of_10th_level())
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")
def get_structure_of_11th_level(self):
Expand Down
16 changes: 1 addition & 15 deletions tests/exercises_ru_words_family_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,15 @@ def test_erwf_01_02_verify_page_structure_and_visibility(self, driver, exercises
assert visibility_of_elements_on_3rd_level, "3rd-level elements are invisible"
assert visibility_of_elements_on_4th_level, "4th-level elements are invisible"

@allure.title("Verify composition, visibility of elements on the 6st-10th levels of nesting on the page")
@allure.title("Verify composition, visibility of elements on the 6st-8th levels of nesting on the page")
def test_erwf_01_03_verify_page_structure_and_visibility(self, driver, exercises_ru_words_family_page_open):
page = erwfPage(driver)
# structure_of_6th_level = page.get_structure_of_6th_level()
visibility_of_elements_on_6th_level = page.check_elements_visibility_on_6th_level()
# structure_of_7th_level = page.get_structure_of_7th_level()
visibility_of_elements_on_7th_level = page.check_elements_visibility_on_7th_level()
structure_of_8th_level = page.get_structure_of_8th_level()
visibility_of_elements_on_8th_level = page.check_elements_visibility_on_8th_level()
structure_of_9th_level = page.get_structure_of_9th_level()
visibility_of_elements_on_9th_level = page.check_elements_visibility_on_9th_level()
structure_of_10th_level = page.get_structure_of_10th_level()
visibility_of_elements_on_10th_level = page.check_elements_visibility_on_10th_level()
# assert structure_of_6th_level, "Elements on the 6th level are absent on the page"
assert visibility_of_elements_on_6th_level, "6th-level elements are invisible"
# assert structure_of_7th_level, "Elements on the 7th level are absent on the page"
assert visibility_of_elements_on_7th_level, "7th-level elements are invisible"
assert structure_of_8th_level, "Elements on the 8th level are absent on the page"
assert visibility_of_elements_on_8th_level, "8th-level elements are invisible"
assert structure_of_9th_level, "Elements on the 9th level are absent on the page"
assert not visibility_of_elements_on_9th_level, "9th-level elements are visible"
assert structure_of_10th_level, "Elements on the 10th level are absent on the page"
assert not visibility_of_elements_on_10th_level, "10th-level elements are visible"

@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):
Expand Down
Loading