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 @@ -53,6 +53,7 @@ class HeaderAuthorizedLocators:
LINK_DONATE_AUTH = (By.XPATH, "(//nav//a)[10]")
LINK_GITHUB_AUTH = (By.XPATH, "(//nav//a)[11]")
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_PROFILE = (By.XPATH, "(//nav//a)[12]")
LINK_TELEGRAM_AUTH = (By.XPATH, "(//nav//a)[5]")
Expand Down
8 changes: 8 additions & 0 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,14 @@ def click_on_direct_internal_links_in_header_auth(self):

return opened_pages

@allure.step("Click on the 'Groups' link #2 for authorized user")
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 external links in the Header and thereby open corresponding web pages on new tabs
for authorized user""")
def click_on_auth_external_links_in_header(self):
Expand Down
3 changes: 2 additions & 1 deletion test_data/header_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ class HeaderData:
s11 = "https://github.com/Brain-up/brn" # dropdown
s12 = "https://opencollective.com/brainup" # dropdown
s13 = "https://t.me/BrainUpUsers" #, # dropdown
s14 = f"{s}groups"

set_auth = (s, s0, s1, s2, s3, s4, s5, s6, s7, s9, s10, s11, s12, s13)
set_auth = (s, s0, s1, s2, s3, s4, s5, s6, s7, s9, s10, s11, s12, s13, s14)
set_unauth = (s, s1, s2, s3, s8, s9, s10, s11, s12, s13)

link_status_codes = (200,)
Expand Down
9 changes: 8 additions & 1 deletion tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,19 @@ def test_hpa_03_02_verify_auth_internal_links_lead_to_proper_pages(self, driver,

@allure.title("""Verify if direct internal links in the Header for an authorized user
lead to correct pages after click""")
def test_hpa_03_02_1_verify_auth_direct_internal_links_navigation(self, driver, auto_test_user_authorized):
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""")
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"

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