From 3e9964e34411d160c3a4bded153ed455bda96789 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Sun, 3 Aug 2025 15:32:30 +0300 Subject: [PATCH] ref test_erw_01.02, _erw_01.03 update exercises_ru_words_page.py, conftest.py --- pages/exercises_ru_words_page.py | 45 +++++++++----------------------- tests/conftest.py | 1 - 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/pages/exercises_ru_words_page.py b/pages/exercises_ru_words_page.py index 836aab04a3..b2cf819b7f 100644 --- a/pages/exercises_ru_words_page.py +++ b/pages/exercises_ru_words_page.py @@ -22,9 +22,8 @@ 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): @@ -32,9 +31,7 @@ def check_elements_visibility_on_1st_level(self): @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): @@ -42,9 +39,7 @@ def check_elements_visibility_on_2nd_level(self): @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): @@ -52,9 +47,7 @@ def check_elements_visibility_on_3rd_level(self): @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): @@ -62,9 +55,7 @@ def check_elements_visibility_on_4th_level(self): @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): @@ -72,9 +63,7 @@ def check_elements_visibility_on_5th_level(self): @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): @@ -82,9 +71,7 @@ def check_elements_visibility_on_6th_level(self): @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): @@ -92,9 +79,7 @@ def check_elements_visibility_on_7th_level(self): @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): @@ -102,9 +87,7 @@ def check_list1_visibility(self): @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): @@ -112,9 +95,7 @@ def check_list2_visibility(self): @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): @@ -122,9 +103,7 @@ def check_list3_visibility(self): @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): diff --git a/tests/conftest.py b/tests/conftest.py index 7be248a657..f97e0909ef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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()