From 641d89438b3c237131b6a9e780120e7f5cce20c7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 30 Nov 2023 12:21:27 +0100 Subject: [PATCH] add authentik_user_page --- src/tests_authentik/fixtures_authentik.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tests_authentik/fixtures_authentik.py b/src/tests_authentik/fixtures_authentik.py index 21bddbe..e9b467d 100644 --- a/src/tests_authentik/fixtures_authentik.py +++ b/src/tests_authentik/fixtures_authentik.py @@ -21,7 +21,6 @@ def admin_context(context: BrowserContext, DIR: DirManager) -> BrowserContext: @pytest.fixture def authentik_admin_page(admin_context: BrowserContext, DIR: DirManager) -> Page: page = admin_context.new_page() - page.pause() authentik_env_file = DIR.ENV_FILES / "authentik" authentik_config: dict[str, str] = dotenv_values(authentik_env_file) # type: ignore url = "https://" + authentik_config["DOMAIN"] @@ -36,3 +35,13 @@ def user_context(context: BrowserContext, DIR: DirManager) -> BrowserContext: context.add_cookies(storage_state["cookies"]) context.set_default_timeout(TIMEOUT) return context + + +@pytest.fixture +def authentik_user_page(user_context: BrowserContext, DIR: DirManager) -> Page: + page = user_context.new_page() + authentik_env_file = DIR.ENV_FILES / "authentik" + authentik_config: dict[str, str] = dotenv_values(authentik_env_file) # type: ignore + url = "https://" + authentik_config["DOMAIN"] + page.goto(url) + return page