Skip to content

Commit 9b8e812

Browse files
ref 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
1 parent e2cc02f commit 9b8e812

3 files changed

Lines changed: 19 additions & 11 deletions

File tree

pages/header_page.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Methods for verifying web elements in the Header of the site"""
2-
import time
32
import allure
43
import requests
54
from selenium.webdriver.support import expected_conditions as EC
@@ -99,8 +98,10 @@ def get_list_of_direct_links_unauth(self):
9998
def get_list_of_direct_links_auth(self):
10099
links = self.get_list_of_links_auth()
101100
direct_links = []
102-
for i in [1, 2, 3, 4, 11, 0]:
101+
# for i in [1, 2, 3, 4, 11, 0]:
102+
for i in [1, 2, 3, 4, 17, 0]:
103103
direct_links.append(links[i])
104+
# print(*direct_links)
104105
return direct_links
105106

106107
@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):
279280
def get_text_in_direct_links_unauth(self):
280281
return [link.text for link in self.get_list_of_direct_links_unauth()[:3]]
281282

282-
@allure.step("""Get text in the 'Groups', 'Statistics', 'About', 'Telegram', 'Profile' links in the Header
283+
@allure.step("""Get text in the 'Groups', 'Statistics', 'About', 'Telegram' links in the Header
283284
for an authorized user""")
284285
def get_text_in_direct_links_auth(self):
285-
return [link.text for link in self.get_list_of_direct_links_auth()[:5]]
286+
direct_links_text = [link.text for link in self.get_list_of_direct_links_auth()[:4]]
287+
print(*direct_links_text, len(direct_links_text), sep='\n')
288+
return direct_links_text
289+
# return [link.text for link in self.get_list_of_direct_links_auth()[:5]]
286290

287291
@allure.step("""Get text in the 'Donate', 'GitHub', 'Contacts', 'Specialists', 'Contributors', 'Used Resources'
288292
links in the Header""")
289293
def get_text_of_links_in_more(self):
290294
self.click_more_button()
291-
return [link.text for link in self.get_list_of_links_in_more()]
295+
more_links_text = [link.text for link in self.get_list_of_links_in_more()]
296+
print(*more_links_text, len(more_links_text), sep='\n')
297+
return more_links_text
298+
# return [link.text for link in self.get_list_of_links_in_more()]
292299

293300
@allure.step("Get text in buttons in the Header for an unauthorized user")
294301
def get_text_in_buttons_unauth(self):

test_data/header_data.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ class HeaderData:
1313
"Используемые ресурсы", "Used Resources",
1414
"Регистрация", "Registration")
1515

16-
links_text_auth = ("УПРАЖНЕНИЯ", "GROUPS",
17-
"СТАТИСТИКА", "STATISTICS",
18-
"ОПИСАНИЕ", "ABOUT",
19-
"TELEGRAM",
16+
links_text_auth = ("УПРАЖНЕНИЯ", "Упражнения", "GROUPS",
17+
"СТАТИСТИКА", "Статистика", "STATISTICS",
18+
"ОПИСАНИЕ", "Описание", "ABOUT",
19+
"TELEGRAM", "Telegram",
2020
"Пожертвовать", "Donate",
2121
"GitHub",
2222
"Контакты", "Contacts",
2323
"Специалисты", "Specialists",
2424
"Наша команда", "Contributors",
25-
"Используемые ресурсы", "Used Resources")
25+
"Используемые ресурсы", "Used Resources",
26+
"Аудиометрия", "Audiometry")
2627

2728
buttons_text = ('RU', 'EN', 'ЕЩЕ...', 'MORE...')
2829

tests/header_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_hpa_02_01_verify_auth_text_in_links_and_buttons(self, driver, auto_test
276276
ru_en_buttons_text = page.get_text_in_ru_en_buttons()
277277
assert all(element in hPD.links_text_auth for element in direct_links_text[:4]), \
278278
"Text in links in section 2 mismatches valid values"
279-
assert direct_links_text[4], "Text in the 'Profile' link is absent"
279+
assert direct_links_text, "Text in direct links is absent"
280280
assert all(element in hPD.links_text_auth for element in links_in_more_text), \
281281
"Text in links in section 3 mismatches valid values"
282282
assert all(element in hPD.buttons_text for element in buttons_text), \

0 commit comments

Comments
 (0)