From ea4d573563fed743379ec486b4b5023e3049bc2d Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Fri, 27 Dec 2024 22:48:38 +0300 Subject: [PATCH] add test_erw_03.02, update exercises_ru_words_page_test.py, exercises_ru_words_page.py, exercises_ru_words_page_locators.py --- locators/exercises_ru_words_page_locators.py | 2 +- pages/exercises_ru_words_page.py | 5 ++++- tests/exercises_ru_words_page_test.py | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/locators/exercises_ru_words_page_locators.py b/locators/exercises_ru_words_page_locators.py index fd1203d35e..589fc002df 100644 --- a/locators/exercises_ru_words_page_locators.py +++ b/locators/exercises_ru_words_page_locators.py @@ -13,7 +13,7 @@ class ExercisesRuWordsPageLocators: PAGE_SEVENTH_LEVEL_ELEMENTS = (By.XPATH, "//main/*/*/*/*/*/*/*") PAGE_LIST1 = (By.XPATH, '//ul[@aria-label="Breadcrumbs"]//a') # PAGE_LIST1 = (By.XPATH, "//main//div/li") - PAGE_LIST2 = (By.XPATH, "//aside//li") + PAGE_LIST2 = (By.XPATH, "//aside//button") PAGE_LIST3 = (By.XPATH, '//div[contains(@class, "series-page")]//a') # PAGE_LIST3 = (By.XPATH, "//main//div/a") CARD_IMAGES_LIST4 = (By.XPATH, '//div[contains(@style, "svg")]') diff --git a/pages/exercises_ru_words_page.py b/pages/exercises_ru_words_page.py index 918690e3c1..8c54ed26d0 100644 --- a/pages/exercises_ru_words_page.py +++ b/pages/exercises_ru_words_page.py @@ -112,7 +112,6 @@ def check_list2_visibility(self): def check_list3_presence(self): elements = self.elements_are_present(self.locators.PAGE_LIST3) # tags = [element.tag_name for element in elements] - # tags_text = [element.text for element in elements] return elements @allure.step("Check the list3 is visible") @@ -169,3 +168,7 @@ def get_breadcrumbs_links_href(self): @allure.step("Get status code of links") def get_link_status_codes_in_breadcrumbs(self): return [requests.head(link_href).status_code for link_href in self.get_breadcrumbs_links_href()] + + @allure.step("Check if group links are clickable") + def check_group_links_clickability(self): + return all(link.is_enabled() for link in self.check_list2_presence()) diff --git a/tests/exercises_ru_words_page_test.py b/tests/exercises_ru_words_page_test.py index 4bf57a7ea0..4fa12308f3 100644 --- a/tests/exercises_ru_words_page_test.py +++ b/tests/exercises_ru_words_page_test.py @@ -113,3 +113,9 @@ def test_erw_03_01_verify_breadcrumbs_links(self, driver, exercises_ru_words_pag "Attributes 'href' of links in breadcrumbs mismatch the valid values" assert all(el == ExercisesRuWordsPageData.links_status_code for el in breadcrumbs_link_status_codes), \ "Status codes of links in breadcrumbs mismatch valid values" + + @allure.title("Verify clickability of group links on the page") + def test_erw_03_02_verify_group_links_text(self, driver, exercises_ru_words_page_open): + page = ExercisesRuWordsPage(driver) + group_links_clickability = page.check_group_links_clickability() + assert group_links_clickability, "Group links are unclickable"