From 7337a7033afbd0c4596b529c3500b66436ccfb13 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Thu, 26 Mar 2026 21:46:00 +0300 Subject: [PATCH 1/2] ref test_hpa_01.03, test_hpa_02.01 Verifying text in links in the Header for an authorized user update header_test.py, header_page.py, header_data.py #268 --- pages/header_page.py | 14 ++++++++------ test_data/header_data.py | 6 +++--- tests/header_test.py | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pages/header_page.py b/pages/header_page.py index ae07662271..7e51d36e63 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -78,11 +78,7 @@ def get_list_of_links_unauth(self): @allure.step("Get the list of links on different levels of nesting in the Header for an authorized user") def get_list_of_links_auth(self): - links = self.elements_are_present(self.locators1.HEADER_LINKS_AUTH) - att = [element.get_attribute("href") for element in links] - print(*att, len(att), sep='\n') - return links - # return self.elements_are_present(self.locators1.HEADER_LINKS_AUTH) + return self.elements_are_present(self.locators1.HEADER_LINKS_AUTH) @allure.step("""Get the list of the 'About', 'Telegram', 'Registration', 'Logo' links (direct links) in the Header for an unauthorized user""") @@ -236,7 +232,13 @@ def check_buttons_unauth_visibility(self): @allure.step("Get the list of buttons in the Header for an authorized user") def get_list_of_buttons_auth(self): - return self.elements_are_present(self.locators.HEADER_BUTTONS)[:4] + all_buttons = self.elements_are_present(self.locators.HEADER_BUTTONS)[:3] + header_buttons = all_buttons[:3] + header_buttons.append(all_buttons[-1]) + att = [element.get_attribute("type") for element in header_buttons] + print(*att, len(att), sep='\n') + return header_buttons + # return self.elements_are_present(self.locators.HEADER_BUTTONS)[:4] @allure.step("Check buttons are visible are visible for an authorized user") diff --git a/test_data/header_data.py b/test_data/header_data.py index b253d0466f..d5f27dbe31 100644 --- a/test_data/header_data.py +++ b/test_data/header_data.py @@ -13,9 +13,9 @@ class HeaderData: "Используемые ресурсы", "Used Resources", "Регистрация", "Registration") - links_text_auth = ("УПРАЖНЕНИЯ", "Упражнения", "GROUPS", - "СТАТИСТИКА", "Статистика", "STATISTICS", - "ОПИСАНИЕ", "Описание", "ABOUT", + links_text_auth = ("УПРАЖНЕНИЯ", "Упражнения", "GROUPS", "Groups", + "СТАТИСТИКА", "Статистика", "STATISTICS", "Statistics", + "ОПИСАНИЕ", "Описание", "ABOUT", "About", "TELEGRAM", "Telegram", "Пожертвовать", "Donate", "GitHub", diff --git a/tests/header_test.py b/tests/header_test.py index 83e4e4cda8..e3766ee993 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -249,7 +249,7 @@ def test_hpa_01_03_verify_auth_header_structural_elements(self, driver, auto_tes logout_button_visibility = page.check_logout_button_visibility() assert header_links, "Links are absent in the Header" assert header_direct_links, "Direct links are absent in the Header" - # assert header_direct_links_visibility, "Direct links are invisible" + assert header_direct_links_visibility, "Direct links are invisible" assert links_in_more_presence, "Links in the dropdown 'More' are absent in the Header" assert links_in_more_invisibility, "Links in the dropdown 'More' are visible" assert links_in_more_visibility, "Links in the dropdown 'More' are invisible" @@ -258,7 +258,7 @@ def test_hpa_01_03_verify_auth_header_structural_elements(self, driver, auto_tes assert profile_link_presence, "The 'Profile' link is absent in the Header" assert profile_link_visibility, "The 'Profile' link is invisible" assert buttons_presence, "Buttons are absent in the Header" - # assert buttons_visibility, "Buttons are invisible" + assert buttons_visibility, "Buttons are invisible" assert ru_en_buttons_presence, "The 'ru' and 'en' buttons are absent in the Header" assert ru_en_buttons_visibility, "The 'ru' and 'en' buttons are invisible" assert more_button_presence, "The 'More' button is absent in the Header" From 82e3361c94608bf3aecc40e63b90f9ffa1f5e78f Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Thu, 26 Mar 2026 21:51:03 +0300 Subject: [PATCH 2/2] ref test_hpa_01.03, test_hpa_02.01 Verifying text in links in the Header for an authorized user update header_test.py, header_page.py, header_data.py #268 --- pages/header_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/header_page.py b/pages/header_page.py index 7e51d36e63..e86213bf5a 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -232,7 +232,7 @@ def check_buttons_unauth_visibility(self): @allure.step("Get the list of buttons in the Header for an authorized user") def get_list_of_buttons_auth(self): - all_buttons = self.elements_are_present(self.locators.HEADER_BUTTONS)[:3] + all_buttons = self.elements_are_present(self.locators.HEADER_BUTTONS) header_buttons = all_buttons[:3] header_buttons.append(all_buttons[-1]) att = [element.get_attribute("type") for element in header_buttons]