Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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""")
Expand Down Expand Up @@ -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)
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")
Expand Down
6 changes: 3 additions & 3 deletions test_data/header_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Loading