Skip to content

Issue_268_HEADER_links #556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
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
9 changes: 5 additions & 4 deletions pages/header_page.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Methods for verifying web elements in the Header of the site"""
import time
import allure
import requests
from selenium.webdriver.support import expected_conditions as EC
Expand Down Expand Up @@ -352,16 +351,18 @@ def click_on_internal_links_in_header_auth(self):
opened_pages = []
# Click on the 'Statistics', 'Groups', 'About', 'Profile', 'Logo' links
for link in self.get_list_of_direct_internal_links_auth():
current_url = self.get_current_tab_url()
link.click()
time.sleep(1)
Wait(self.driver, 10).until(EC.url_changes(current_url))
opened_pages.append(self.get_current_tab_url())
# Click on the 'Contacts', 'Specialists', 'Contributors', 'Used Resources' links
for link in self.get_list_of_internal_links_in_more():
self.click_more_button()
time.sleep(1)
current_url = self.get_current_tab_url()
link.click()
time.sleep(1)
Wait(self.driver, 10).until(EC.url_changes(current_url))
opened_pages.append(self.get_current_tab_url())
print(*opened_pages, sep='\n') # Temporarily for debugging
return opened_pages

@allure.step("""Click on external links in the Header and thereby open corresponding web pages on new tabs
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def auto_test_user_authorized(driver, main_page_open):
page.element_is_visible(LoginPageLocators.INPUT_LOGIN).send_keys(os.environ["LOGIN"])
page.element_is_visible(LoginPageLocators.INPUT_PASSWORD).send_keys(os.environ["PASSWORD"])
page.element_is_present_and_clickable(LoginPageLocators.SIGN_IN_BUTTON).click()
print("Current URL:", driver.current_url) # Temporarily for debugging
page.check_expected_link(MainPageLinks.URL_GROUPS_PAGE)
print("Current URL:", driver.current_url) # Temporarily for debugging
page = ProfilePage(driver)
Expand Down
Loading