diff --git a/pages/groups_page.py b/pages/groups_page.py index 35aea91c13..b95ff38a02 100644 --- a/pages/groups_page.py +++ b/pages/groups_page.py @@ -227,8 +227,7 @@ 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() - for element in elements: - WebDriverWait(self.driver, 20).until(ec.visibility_of(element)) + 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") @@ -237,8 +236,10 @@ def get_images_alt_en(self): @allure.step("Get the list of sizes of images in links") def get_images_sizes(self): - time.sleep(2) - return [image.size for image in self.get_list_of_images()] + 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") def check_size_changes_of_images(self): diff --git a/tests/groups_page_test.py b/tests/groups_page_test.py index 686a43e266..f0bc15e9c9 100644 --- a/tests/groups_page_test.py +++ b/tests/groups_page_test.py @@ -175,6 +175,8 @@ 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"