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
1 change: 1 addition & 0 deletions locators/header_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class HeaderAuthorizedLocators:
LINK_GROUPS_AUTH = (By.XPATH, "(//nav//a)[2]")
LINK_GROUPS_AUTH2 = (By.XPATH, "(//nav//a)[6]")
LINK_STATISTICS_AUTH = (By.XPATH, "(//nav//a)[3]")
LINK_STATISTICS_AUTH2 = (By.XPATH, "(//nav//a)[7]")
LINK_PROFILE = (By.XPATH, "(//nav//a)[12]")
LINK_TELEGRAM_AUTH = (By.XPATH, "(//nav//a)[5]")
LINK_TELEGRAM_AUTH2 = (By.XPATH, "(//nav//a)[9]")
Expand Down
10 changes: 9 additions & 1 deletion pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def get_links_href_unauth(self):
@allure.step("Get attribute 'href' of links in the Header for an authorized user")
def get_links_href_auth(self):
att = [element.get_attribute("href") for element in self.get_list_of_links_auth()]
# print(*att, len(att), sep='\n')
print(*att, len(att), sep='\n')
return att
# return [element.get_attribute("href") for element in self.get_list_of_links_auth()]

Expand Down Expand Up @@ -422,6 +422,14 @@ def click_on_Groups_link_auth2(self):
self.click_more_button()
self.element_is_present_and_clickable(self.locators1.LINK_GROUPS_AUTH2).click()
current_tab_url = self.get_current_tab_url()
# print(current_tab_url)
return current_tab_url

@allure.step("Click on the 'Statistics' link #2 for authorized user")
def click_on_Statistics_link_auth2(self):
self.click_more_button()
self.element_is_present_and_clickable(self.locators1.LINK_STATISTICS_AUTH2).click()
current_tab_url = self.get_current_tab_url()
print(current_tab_url)
return current_tab_url

Expand Down
23 changes: 15 additions & 8 deletions tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ def test_hpa_03_01_verify_auth_header_links(self, driver, auto_test_user_authori
assert all(element in hPD.link_status_codes for element in link_status_codes), \
"Status codes of links mismatch valid values"

@pytest.mark.xfail
@allure.title("""Verify if internal links in the Header for an authorized user
lead to correct pages after click""")
@pytest.mark.skip
@allure.title("""test_hpa.03.02 Verify if internal links in the Header for an authorized user
lead to correct pages after clicking""")
def test_hpa_03_02_verify_auth_internal_links_lead_to_proper_pages(self, driver, auto_test_user_authorized):
page = hPage(driver)
internal_links_in_more = page.get_list_of_internal_links_in_more()
Expand All @@ -342,20 +342,27 @@ def test_hpa_03_02_verify_auth_internal_links_lead_to_proper_pages(self, driver,
assert all(element in hPD.set_auth for element in opened_pages), \
"Some of internal links lead to incorrect pages after clicking"

@allure.title("""Verify if direct internal links in the Header for an authorized user
lead to correct pages after click""")
@allure.title("""test_hpa.03.02.01 Verify if direct internal links in the Header for an authorized user
lead to correct pages after clicking""")
def test_hpa_03_02_01_verify_auth_direct_internal_links_navigation(self, driver, auto_test_user_authorized):
page = hPage(driver)
opened_pages = page.click_on_direct_internal_links_in_header_auth()
assert all(element in hPD.set_auth for element in opened_pages), \
"Some of direct internal links lead to incorrect pages after clicking"

@allure.title("""Verify if internal 'Group' link #2 in the Header for an authorized user
leads to the correct page after click""")
@allure.title("""test_hpa.03.02.02 Verify if internal 'Groups' link #2 in the Header for an authorized user
leads to the correct page after clicking""")
def test_hpa_03_02_02_verify_auth_groups_link2_navigation(self, driver, auto_test_user_authorized):
page = hPage(driver)
opened_page2 = page.click_on_Groups_link_auth2()
assert opened_page2 in hPD.set_auth, "The Group link #2 leads to an incorrect page after clicking"
assert opened_page2 in hPD.set_auth, "The Groups link #2 leads to an incorrect page after clicking"

@allure.title("""test_hpa.03.02.03 Verify if internal 'Statistics' link #2 in the Header
for an authorized user leads to the correct page after clicking""")
def test_hpa_03_02_03_verify_auth_statistics_link2_navigation(self, driver, auto_test_user_authorized):
page = hPage(driver)
opened_page2 = page.click_on_Statistics_link_auth2()
assert opened_page2 in hPD.set_auth, "The Statistics link #2 leads to an incorrect page after clicking"

@pytest.mark.skip("Unstable test environment")
@allure.title("""Verify if external links in the Header for an authorized user
Expand Down
Loading