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
45 changes: 12 additions & 33 deletions pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,109 +22,88 @@ def check_visibility_of_page_content(self):

@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]
return elements
# tags = [element.tag_name for element in elements]
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):
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")
def get_structure_of_2nd_level(self):
elements = self.elements_are_present(self.locators.PAGE_SECOND_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
return elements
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):
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")
def get_structure_of_3rd_level(self):
elements = self.elements_are_present(self.locators.PAGE_THIRD_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
return elements
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):
return all(element.is_displayed() for element in self.get_structure_of_3rd_level())

@allure.step("Get structure of the 4th level of nesting on the page")
def get_structure_of_4th_level(self):
elements = self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.PAGE_FOURTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 4th level of nesting are visible")
def check_elements_visibility_on_4th_level(self):
return all(element.is_displayed() for element in self.get_structure_of_4th_level())

@allure.step("Get structure of the 5th level of nesting on the page")
def get_structure_of_5th_level(self):
elements = self.elements_are_present(self.locators.PAGE_FIFTH_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
return elements
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):
return all(element.is_displayed() for element in self.get_structure_of_5th_level())

@allure.step("Get structure of the 6th level of nesting on the page")
def get_structure_of_6th_level(self):
elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)

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

@allure.step("Get structure of the 7th level of nesting on the page")
def get_structure_of_7th_level(self):
elements = self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.PAGE_SEVENTH_LEVEL_ELEMENTS)

@allure.step("Check if elements of the 7th level of nesting are visible")
def check_elements_visibility_on_7th_level(self):
return all(element.is_displayed() for element in self.get_structure_of_7th_level())

@allure.step("Check the list1 on the 5th level of nesting is present on the page")
def get_list1_of_breadcrumbs_links(self):
elements = self.elements_are_present(self.locators.PAGE_LIST1)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.PAGE_LIST1)

@allure.step("Check the list1 is visible")
def check_list1_visibility(self):
return all(element.is_displayed() for element in self.get_list1_of_breadcrumbs_links())

@allure.step("Check the list2 on the 5th level of nesting is present on the page")
def get_list2_of_group_links(self):
elements = self.elements_are_present(self.locators.PAGE_LIST2)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.PAGE_LIST2)

@allure.step("Check the list2 is visible")
def check_list2_visibility(self):
return all(element.is_displayed() for element in self.get_list2_of_group_links())

@allure.step("Check the list3 on the 5th level of nesting is present on the page")
def get_list3_of_subgroup_links(self):
elements = self.elements_are_present(self.locators.PAGE_LIST3)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.PAGE_LIST3)

@allure.step("Check the list3 is visible")
def check_list3_visibility(self):
return all(element.is_displayed() for element in self.get_list3_of_subgroup_links())

@allure.step("Check the list4 on the 6th level of nesting is present on the page")
def get_list4_of_links(self):
elements = self.elements_are_present(self.locators.CARD_IMAGES_LIST4)
tags = [element.tag_name for element in elements]
return elements
return self.elements_are_present(self.locators.CARD_IMAGES_LIST4)

@allure.step("Check the list4 is visible")
def check_list4_visibility(self):
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def auto_test_user_authorized(driver, main_page_open):
page.element_is_visible(LoginPageLocators.INPUT_PASSWORD).send_keys(os.environ["PASSWORD"])
page.element_is_present_and_clickable(LoginPageLocators.SIGN_IN_BUTTON).click()
page.check_expected_link(MainPageLinks.URL_GROUPS_PAGE)
print("Current URL:", driver.current_url) # Temporarily for debugging
page = ProfilePage(driver)
page.loader_checking()

Expand Down