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 @@ -57,6 +57,7 @@ class HeaderAuthorizedLocators:
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_SPECIALISTS_AUTH = (By.XPATH, "(//nav//a)[13]")
LINK_STATISTICS_AUTH1 = (By.XPATH, "(//nav//a)[3]")
LINK_STATISTICS_AUTH2 = (By.XPATH, "(//nav//a)[7]")
LINK_STATISTICS_AUTH3 = (By.XPATH, "(//nav//a)[17]")
Expand Down
39 changes: 24 additions & 15 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from locators.header_page_locators import (HeaderUnauthorizedLocators, HeaderAuthorizedLocators,
StartPagesLocators)


class HeaderPage(BasePage):
locators = HeaderUnauthorizedLocators
locators1 = HeaderAuthorizedLocators
Expand Down Expand Up @@ -430,13 +429,13 @@ def click_on_direct_internal_links_in_header_auth(self):
current_url = self.get_current_tab_url()
opened_pages.append(current_url)

# Click on the 'Groups' link
# Click on the 'Groups' link #1
self.element_is_present_and_clickable(self.locators1.LINK_GROUPS_AUTH).click()
Wait(self.driver, 10).until(EC.url_changes(current_url))
current_url = self.get_current_tab_url()
opened_pages.append(current_url)

# Click on the 'About' link
# Click on the 'About' link #1
self.element_is_present_and_clickable(self.locators1.LINK_ABOUT_AUTH1).click()
Wait(self.driver, 10).until(EC.url_changes(current_url))
current_url = self.get_current_tab_url()
Expand Down Expand Up @@ -475,33 +474,43 @@ def click_on_direct_external_links_in_header_auth(self):
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
current_url = self.get_current_tab_url()
print(current_url)
return current_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
current_url = self.get_current_tab_url()
print(current_url)
return current_url

@allure.step("Click on the 'About' link #2 for AUTHORIZED user")
def click_on_About_link_auth2(self):
self.click_more_button()
self.element_is_present_and_clickable(self.locators1.LINK_ABOUT_AUTH2).click()
current_tab_url = self.get_current_tab_url()
# print(current_tab_url)
return current_tab_url
current_url = self.get_current_tab_url()
print(current_url)
return current_url

@allure.step("Click on the 'Contacts' link for AUTHORIZED user -- ACTUAL")
def click_on_Contacts_link_auth(self):
self.click_more_button()
self.element_is_present_and_clickable(self.locators1.LINK_CONTACTS_AUTH).click()
current_tab_url = self.get_current_tab_url()
print(current_tab_url)
return current_tab_url
current_url = self.get_current_tab_url()
print(current_url)
return current_url

@allure.step("Click on the 'Specialists' link for AUTHORIZED user -- ACTUAL")
def click_on_Specialists_link_auth(self):
current_url = self.get_current_tab_url()
self.click_more_button()
self.element_is_present_and_clickable(self.locators1.LINK_SPECIALISTS_AUTH).click()
Wait(self.driver, 10).until(EC.url_changes(current_url))
current_url = self.get_current_tab_url()
print(current_url)
return current_url

@allure.step("""Click on external links in the Header
and thereby open corresponding web pages on new tabs for AUTHORIZED user -- unusable till changing UI""")
Expand Down
4 changes: 3 additions & 1 deletion tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ def test_hpa_03_03_04_verify_auth_contacts_link_navigation(self, driver, auto_te
@allure.title("""test_hpa.03.03.05 Verify if internal Specialists link in the Header's dropdown
for an authorized user leads to the correct page after clicking""")
def test_hpa_03_03_05_verify_auth_specialists_link_navigation(self, driver, auto_test_user_authorized):
pass
page = hPage(driver)
opened_page = page.click_on_Specialists_link_auth()
assert opened_page in hPD.set_auth, "The Specialists link leads to an incorrect page after clicking"

@allure.title("""test_hpa.03.03.06 Verify if internal Our Team link in the Header's dropdown
for an authorized user leads to the correct page after clicking""")
Expand Down
Loading