From 1d48cbdc532032b7fccb476050fc8b84507053b0 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Tue, 3 Jun 2025 13:02:54 +0300 Subject: [PATCH] update groups_page_test.py, groups_page.py --- pages/groups_page.py | 5 +++-- tests/groups_page_test.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pages/groups_page.py b/pages/groups_page.py index b95ff38a02..c9d2e63f68 100644 --- a/pages/groups_page.py +++ b/pages/groups_page.py @@ -167,8 +167,9 @@ def check_links_clickability(self): @allure.step("Get attribute 'title' of links on the 'ru' local") def get_links_titles_ru(self): - time.sleep(1) - return [element.get_attribute("title") for element in self.get_list_of_links()] + 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") def get_links_titles_en(self): diff --git a/tests/groups_page_test.py b/tests/groups_page_test.py index f0bc15e9c9..e088afa5ab 100644 --- a/tests/groups_page_test.py +++ b/tests/groups_page_test.py @@ -122,14 +122,20 @@ def test_gp_03_01_verify_links(self, driver, groups_ru_page_open): assert all(element in gPD.links_status_code for element in link_status_codes), \ "Status codes of links mismatch valid values" - @allure.title("Verify title, href of links on the 'ru' local") - def test_gp_03_02_verify_links_ru(self, driver, groups_ru_page_open): + @allure.title("Verify title of links on the 'ru' local") + 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() - links_href_ru = page.get_links_href_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" + + @allure.title("Verify href of links on the 'ru' local") + def test_gp_03_02_02_verify_links_ru_href(self, driver, groups_ru_page_open): + page = gPage(driver) + links_href_ru = page.get_links_href_ru() assert links_href_ru, "Links href are empty on the 'ru' local" assert all(element.startswith(gPD.link_href_first_part) for element in links_href_ru), \ "Attributes 'href' of links on the 'ru' local mismatch valid values"