diff --git a/pages/groups_page.py b/pages/groups_page.py index bdf265af58..4d5507dee8 100644 --- a/pages/groups_page.py +++ b/pages/groups_page.py @@ -6,20 +6,11 @@ from locators.groups_page_locators import GroupsPageLocators, HeaderLocators from test_data.links import MainPageLinks as Links -from selenium.webdriver.support.ui import WebDriverWait -from selenium.webdriver.support import expected_conditions as ec - class GroupsPage(BasePage): locators = GroupsPageLocators locators1 = HeaderLocators - @allure.step("Loader checking") - def loader_checking(self): - self.timeout = 50 - return WebDriverWait(self.driver, self.timeout).until( - ec.visibility_of_element_located(self.locators.PAGE_SUBTITLES)) - # Checking the structure and display of elements on the page @allure.step("Check if some content is present in DOM") def check_presence_of_page_content(self): @@ -76,8 +67,6 @@ 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): - WebDriverWait(self.driver, 30).until( - ec.presence_of_all_elements_located(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS)) elements = self.elements_are_present(self.locators.PAGE_SIXTH_LEVEL_ELEMENTS) # tags = [element.tag_name for element in elements] return elements @@ -85,8 +74,6 @@ def get_structure_of_6th_level(self): @allure.step("Check if elements of the 6th level of nesting are visible") def check_elements_visibility_on_6th_level(self): elements = self.get_structure_of_6th_level() - for element in elements: - WebDriverWait(self.driver, 10).until(ec.visibility_of(element)) return all(element.is_displayed() for element in elements) @allure.step("Check the title h3 on the 2nd level of nesting is present on the page") @@ -107,16 +94,12 @@ def check_visibility_of_tiles(self): @allure.step("Get the list of images on the 6th level of nesting on the page") def get_list_of_images(self): - WebDriverWait(self.driver, 30).until( - ec.presence_of_all_elements_located(self.locators.PAGE_IMAGES)) elements = self.elements_are_present(self.locators.PAGE_IMAGES) return elements @allure.step("Check if images on the 6th level of nesting are visible") def check_visibility_of_images(self): elements = self.get_list_of_images() - for element in elements: - WebDriverWait(self.driver, 10).until(ec.visibility_of(element)) return all(element.is_displayed() for element in elements) @allure.step("Get the list of subtitles on the 6th level of nesting on the page") @@ -168,7 +151,6 @@ def check_links_clickability(self): @allure.step("Get attribute 'title' of links on the 'ru' local") def get_links_titles_ru(self): elements = self.get_list_of_links() - # WebDriverWait(self.driver, 10).until(ec.visibility_of_all_elements_located(self.locators.PAGE_IMAGES)) return [element.get_attribute('title') for element in elements] @allure.step("Get attribute 'title' of links on the 'en' local") @@ -228,7 +210,6 @@ def get_images_src(self): @allure.step("Get the list of attribute 'alt' values of images in links on the 'ru' local") def get_images_alt_ru(self): elements = self.get_list_of_images() - WebDriverWait(self.driver, 10).until(ec.visibility_of_all_elements_located(self.locators.PAGE_IMAGES)) return [element.get_attribute('alt') for element in elements] @allure.step("Get the list of attribute 'alt' values of images in links on the 'en' local") @@ -238,8 +219,6 @@ def get_images_alt_en(self): @allure.step("Get the list of sizes of images in links") def get_images_sizes(self): elements = self.get_list_of_images() - for element in elements: - WebDriverWait(self.driver, 10).until(ec.visibility_of(element)) return [element.size for element in elements] @allure.step("Check changes of images sizes after resizing") diff --git a/tests/exercises_ru_similar_phrases_page_test.py b/tests/exercises_ru_similar_phrases_page_test.py index f28a2e35f9..8558378e8e 100644 --- a/tests/exercises_ru_similar_phrases_page_test.py +++ b/tests/exercises_ru_similar_phrases_page_test.py @@ -72,8 +72,6 @@ class TestExRuSimPhrPageText: def test_ersp_02_01_verify_tab_title(self, driver, exercises_ru_similar_phrases_page_open): page = erspPage(driver) tab_title_value = page.get_value_of_tab_title() - print("Found tab title value:", tab_title_value) # temporarily for debugging - print("Expected tab title value:", erspPD.tab_title_ru) assert tab_title_value, "The title value of the tab is empty" assert tab_title_value in erspPD.tab_title_ru, "The tab title mismatches the valid value" @@ -97,8 +95,6 @@ def test_ersp_02_03_verify_group_links_text(self, driver, exercises_ru_similar_p def test_ersp_02_04_verify_subgroup_links_text(self, driver, exercises_ru_similar_phrases_page_open): page = erspPage(driver) subgroup_links_text = page.get_subgroup_links_text() - print("Found tab title value:", subgroup_links_text) # temporarily for debugging - print("Expected tab title value:", erspPD.subgroup_links_text) assert subgroup_links_text, "Text in cards is absent" assert all(element in erspPD.subgroup_links_text for element in subgroup_links_text), \ "Text in subgroup links mismatches valid values" diff --git a/tests/groups_page_test.py b/tests/groups_page_test.py index e088afa5ab..86bed8a970 100644 --- a/tests/groups_page_test.py +++ b/tests/groups_page_test.py @@ -126,8 +126,6 @@ def test_gp_03_01_verify_links(self, driver, groups_ru_page_open): def test_gp_03_02_01_verify_links_ru_title(self, driver, groups_ru_page_open): page = gPage(driver) link_titles_ru = page.get_links_titles_ru() - print("Found alt attributes:", link_titles_ru) # temporarily for debugging - print("Expected alt attributes:", gPD.link_titles_ru) assert link_titles_ru, "Link titles values are empty on the 'ru' local" assert all(element in gPD.link_titles_ru for element in link_titles_ru), \ "Link titles mismatch any valid values on the 'ru' local" @@ -181,8 +179,6 @@ def test_gp_04_01_verify_images_src(self, driver, groups_ru_page_open): def test_gp_04_02_verify_images_alt_ru(self, driver, groups_ru_page_open): page = gPage(driver) images_alt_ru = page.get_images_alt_ru() - print("Found alt attributes:", images_alt_ru) # temporarily for debugging - print("Expected alt attributes:", gPD.images_alt_ru) assert images_alt_ru, "The 'alt' attribute value of some images is empty on the 'ru' local" assert all(element in gPD.images_alt_ru for element in images_alt_ru), \ "The 'alt' attribute value of some images is empty or mismatches valid values on the 'ru' local"