diff --git a/src/tests_authentik/fixtures_authentik.py b/src/tests_authentik/fixtures_authentik.py index dab4e42..21bddbe 100644 --- a/src/tests_authentik/fixtures_authentik.py +++ b/src/tests_authentik/fixtures_authentik.py @@ -1,7 +1,8 @@ import json import pytest -from playwright.sync_api import BrowserContext +from dotenv import dotenv_values +from playwright.sync_api import BrowserContext, Page from src.dirmanager import DirManager @@ -17,6 +18,17 @@ def admin_context(context: BrowserContext, DIR: DirManager) -> BrowserContext: return context +@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"] + page.goto(url) + return page + + @pytest.fixture def user_context(context: BrowserContext, DIR: DirManager) -> BrowserContext: state_file = DIR.STATES / "user_state.json"