Skip to content

Commit c63bcc1

Browse files
Merge pull request #717 from Brain-up/issue_268
Issue_268_HEADER_links
2 parents 8838aae + 48a30de commit c63bcc1

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

locators/header_page_locators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class HeaderUnauthorizedLocators:
4646

4747

4848
class HeaderAuthorizedLocators:
49+
DROPDOWN_LINKS_AUTH = (By.XPATH, "//div[contains(@class, 'bottom')]/a")
4950
HEADER_LINKS_AUTH = (By.XPATH, "//nav//a")
5051
HEADER_ICONS = (By.XPATH, "//nav//*[name()='svg']")
5152
HEADPHONE_ICON = (By.XPATH, "(//nav//*[name()='svg'])[2]")

pages/header_page.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ def check_elements_invisibility_on_6th_level_in_header(self):
7676
def get_list_of_links_unauth(self):
7777
return self.elements_are_present(self.locators.HEADER_LINKS_UNAUTH)
7878

79-
@allure.step("Get the list of links on different levels of nesting in the Header for an authorized user -- ACTUAL")
80-
def get_links_auth_list(self):
81-
return self.elements_are_present(self.locators1.HEADER_LINKS_AUTH)
82-
8379
@allure.step("""Get the list of the 'About', 'Telegram', 'Registration', 'Logo' links (direct links) in the Header
8480
for an unauthorized user""")
8581
def get_list_of_direct_links_unauth(self):
@@ -89,6 +85,13 @@ def get_list_of_direct_links_unauth(self):
8985
direct_links.append(links[i])
9086
return direct_links
9187

88+
89+
# Lists of links for an AUTHORIZED user
90+
91+
@allure.step("Get the list of links on different levels of nesting in the Header for an authorized user -- ACTUAL")
92+
def get_links_auth_list(self):
93+
return self.elements_are_present(self.locators1.HEADER_LINKS_AUTH)
94+
9295
@allure.step("""Get the list of the 'Groups', 'Statistics' (x2), 'About', 'Telegram', 'Profile', 'Logo' links
9396
(direct links) in the Header for an AUTHORIZED user -- ACTUAL""")
9497
def get_direct_links_auth_list(self):
@@ -111,6 +114,13 @@ def get_direct_internal_links_auth_list(self):
111114
print(*att2, len(att2), sep='\n')
112115
return direct_internal_links
113116

117+
@allure.step("""Get the list of links in the 'More' dropdown in the Header for an AUTHORIZED user""")
118+
def get_dropdown_links_auth_list(self):
119+
dropdown_auth_links = self.elements_are_present(self.locators1.DROPDOWN_LINKS_AUTH)
120+
att1 = [element.get_attribute("href") for element in dropdown_auth_links]
121+
print(*att1, len(att1), sep='\n')
122+
return dropdown_auth_links
123+
114124

115125
@allure.step("Check the 'About', 'Telegram', 'Registration', 'Logo' links are visible for an unauthorized user")
116126
def check_direct_links_visibility_unauth(self):

tests/header_test.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,6 @@ def test_hpa_03_01_verify_auth_header_links(self, driver, auto_test_user_authori
334334
assert all(element in hPD.link_status_codes for element in link_status_codes), \
335335
"Status codes of links mismatch valid values"
336336

337-
@pytest.mark.skip
338-
@allure.title("""test_hpa.03.02 Verify the list of internal links in the Header
339-
for an authorized user""")
340-
def test_hpa_03_02_verify_auth_internal_links_in_more(self, driver, auto_test_user_authorized):
341-
page = hPage(driver)
342-
internal_links_in_more = page.get_list_of_internal_links_in_more()
343-
assert internal_links_in_more, "Internal links are not collected in the list"
344-
345337
@allure.title("""test_hpa.03.02.00 Verify the list of direct internal links in the Header
346338
for an authorized user """)
347339
def test_hpa_03_02_00_verify_auth_direct_internal_links_list(self, driver, auto_test_user_authorized):
@@ -378,9 +370,16 @@ def test_hpa_03_02_04_verify_auth_about_link2_navigation(self, driver, auto_test
378370
opened_page2 = page.click_on_About_link_auth2()
379371
assert opened_page2 in hPD.set_auth, "The About link #2 leads to an incorrect page after clicking"
380372

381-
@allure.title("""test_hpa.03.03 Verify the list of external links in the Header's dropdown
373+
@allure.title("""test_hpa.03.03 Verify the list of links in the Header's dropdown
374+
for an authorized user""")
375+
def test_hpa_03_03_verify_auth_dropdown_links_list(self, driver, auto_test_user_authorized):
376+
page = hPage(driver)
377+
links_in_dropdown = page.get_dropdown_links_auth_list()
378+
assert links_in_dropdown, "Links in the Header's dropdown are not collected in the list"
379+
380+
@allure.title("""test_hpa.03.03.00 Verify the list of external links in the Header's dropdown
382381
for an authorized user""")
383-
def test_hpa_03_03_verify_auth_external_links_in_dropdown(self, driver, auto_test_user_authorized):
382+
def test_hpa_03_03_00_verify_auth_external_links_in_dropdown(self, driver, auto_test_user_authorized):
384383
page = hPage(driver)
385384
external_links_in_dropdown = page.get_list_of_external_links_in_more_auth()
386385
assert external_links_in_dropdown, "External links are not collected in the list"

0 commit comments

Comments
 (0)