From 391efba908781848e7037bdd09b0c933301b5168 Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Wed, 16 Sep 2026 13:07:33 +0300 Subject: [PATCH] ref fixture auto_test_user_authorized() update conftest.py --- tests/conftest.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 087224f038..fa69a469be 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -168,8 +168,8 @@ def used_resources_page_open(driver, main_page_open): @pytest.fixture() -@allure.step('Auto test user authorized') -def auto_test_user_authorized(driver, main_page_open): +@allure.step('Auto test user authorized -- FOR REVIEW') +def auto_test_user_authorized1(driver, main_page_open): page = BasePage(driver) page.element_is_present_and_clickable(MainPageLocators.LOGIN_BUTTON).click() page.element_is_visible(LoginPageLocators.INPUT_LOGIN).send_keys(os.environ["LOGIN"]) @@ -180,6 +180,25 @@ def auto_test_user_authorized(driver, main_page_open): page.loader_checking() +@pytest.fixture() +@allure.step('Auto test user authorized -- ACTUAL, with checks of input fields accessibility') +def auto_test_user_authorized(driver, main_page_open): + page = BasePage(driver) + page.element_is_present_and_clickable(MainPageLocators.LOGIN_BUTTON).click() + page.element_is_present_and_clickable(LoginPageLocators.INPUT_LOGIN).click() + page.element_is_present_and_clickable(LoginPageLocators.INPUT_LOGIN).send_keys(os.environ["LOGIN"]) + page.element_is_present_and_clickable(LoginPageLocators.INPUT_PASSWORD).click() + page.element_is_present_and_clickable(LoginPageLocators.INPUT_PASSWORD).send_keys(os.environ["PASSWORD"]) + page.element_is_present_and_clickable(LoginPageLocators.SIGN_IN_BUTTON).click() + Wait(driver, 10).until( + lambda d: not d.current_url.endswith('/login'), + message=f"Form was not submitted, URL is still {driver.current_url}" + ) + page.check_expected_link(MainPageLinks.URL_GROUPS_PAGE) + page = ProfilePage(driver) + page.loader_checking() + + @pytest.fixture() @allure.step('USER specialist authorized') def specialist_user_authorized(driver, main_page_open):