From 7f8f129b8b04ed6cae878f02ff2b2225018617fe Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Sun, 6 Jul 2025 09:16:04 +0300 Subject: [PATCH] ref test_hpa_03.02 verify auth links navigation update header_page.py, conftest.py --- pages/header_page.py | 9 +++++---- tests/conftest.py | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/header_page.py b/pages/header_page.py index 2457e89311..c168b9ff21 100644 --- a/pages/header_page.py +++ b/pages/header_page.py @@ -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 @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index 98d9ab9b77..3d72267e41 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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)