diff --git a/pages/header_page.py b/pages/header_page.py index 2f9aeee5e8..ae07662271 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -1,5 +1,4 @@ """Methods for verifying web elements in the Header of the site""" -import time import allure import requests from selenium.webdriver.support import expected_conditions as EC @@ -99,8 +98,10 @@ def get_list_of_direct_links_unauth(self): def get_list_of_direct_links_auth(self): links = self.get_list_of_links_auth() direct_links = [] - for i in [1, 2, 3, 4, 11, 0]: + # for i in [1, 2, 3, 4, 11, 0]: + for i in [1, 2, 3, 4, 17, 0]: direct_links.append(links[i]) + # print(*direct_links) return direct_links @allure.step("Check the 'About', 'Telegram', 'Registration', 'Logo' links are visible for an unauthorized user") @@ -279,16 +280,22 @@ def check_user_name_visibility(self): def get_text_in_direct_links_unauth(self): return [link.text for link in self.get_list_of_direct_links_unauth()[:3]] - @allure.step("""Get text in the 'Groups', 'Statistics', 'About', 'Telegram', 'Profile' links in the Header + @allure.step("""Get text in the 'Groups', 'Statistics', 'About', 'Telegram' links in the Header for an authorized user""") def get_text_in_direct_links_auth(self): - return [link.text for link in self.get_list_of_direct_links_auth()[:5]] + direct_links_text = [link.text for link in self.get_list_of_direct_links_auth()[:4]] + print(*direct_links_text, len(direct_links_text), sep='\n') + return direct_links_text + # return [link.text for link in self.get_list_of_direct_links_auth()[:5]] @allure.step("""Get text in the 'Donate', 'GitHub', 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links in the Header""") def get_text_of_links_in_more(self): self.click_more_button() - return [link.text for link in self.get_list_of_links_in_more()] + more_links_text = [link.text for link in self.get_list_of_links_in_more()] + print(*more_links_text, len(more_links_text), sep='\n') + return more_links_text + # return [link.text for link in self.get_list_of_links_in_more()] @allure.step("Get text in buttons in the Header for an unauthorized user") def get_text_in_buttons_unauth(self): diff --git a/test_data/header_data.py b/test_data/header_data.py index 1b5ed383ab..b253d0466f 100644 --- a/test_data/header_data.py +++ b/test_data/header_data.py @@ -13,16 +13,17 @@ class HeaderData: "Используемые ресурсы", "Used Resources", "Регистрация", "Registration") - links_text_auth = ("УПРАЖНЕНИЯ", "GROUPS", - "СТАТИСТИКА", "STATISTICS", - "ОПИСАНИЕ", "ABOUT", - "TELEGRAM", + links_text_auth = ("УПРАЖНЕНИЯ", "Упражнения", "GROUPS", + "СТАТИСТИКА", "Статистика", "STATISTICS", + "ОПИСАНИЕ", "Описание", "ABOUT", + "TELEGRAM", "Telegram", "Пожертвовать", "Donate", "GitHub", "Контакты", "Contacts", "Специалисты", "Specialists", "Наша команда", "Contributors", - "Используемые ресурсы", "Used Resources") + "Используемые ресурсы", "Used Resources", + "Аудиометрия", "Audiometry") buttons_text = ('RU', 'EN', 'ЕЩЕ...', 'MORE...') diff --git a/tests/header_test.py b/tests/header_test.py index f855dc608c..83e4e4cda8 100644 --- a/tests/header_test.py +++ b/tests/header_test.py @@ -276,7 +276,7 @@ def test_hpa_02_01_verify_auth_text_in_links_and_buttons(self, driver, auto_test ru_en_buttons_text = page.get_text_in_ru_en_buttons() assert all(element in hPD.links_text_auth for element in direct_links_text[:4]), \ "Text in links in section 2 mismatches valid values" - assert direct_links_text[4], "Text in the 'Profile' link is absent" + assert direct_links_text, "Text in direct links is absent" assert all(element in hPD.links_text_auth for element in links_in_more_text), \ "Text in links in section 3 mismatches valid values" assert all(element in hPD.buttons_text for element in buttons_text), \