diff --git a/recipes/authentik/tests_authentik/fixtures_authentik.py b/recipes/authentik/tests_authentik/fixtures_authentik.py index 3f27b43..34ed3d7 100644 --- a/recipes/authentik/tests_authentik/fixtures_authentik.py +++ b/recipes/authentik/tests_authentik/fixtures_authentik.py @@ -1,10 +1,10 @@ import json import pytest -from dotenv import dotenv_values from playwright.sync_api import BrowserContext, Page from abratest.dir_manager import DirManager +from abratest.utils import BaseUrl @pytest.fixture @@ -18,10 +18,9 @@ def authentik_admin_context(context: BrowserContext, DIR: DirManager) -> Browser @pytest.fixture def authentik_admin_page(authentik_admin_context: BrowserContext, DIR: DirManager) -> Page: page = authentik_admin_context.new_page() - env_file = DIR.ENV_FILES / "authentik" - config: dict[str, str] = dotenv_values(env_file) # type: ignore - url = "https://" + config["DOMAIN"] - page.goto(url) + config = DIR.get_config("authentik") + base_url = BaseUrl(config["DOMAIN"]) + page.goto(base_url.get()) return page @@ -36,8 +35,7 @@ def authentik_user_context(context: BrowserContext, DIR: DirManager) -> BrowserC @pytest.fixture def authentik_user_page(authentik_user_context: BrowserContext, DIR: DirManager) -> Page: page = authentik_user_context.new_page() - env_file = DIR.ENV_FILES / "authentik" - config: dict[str, str] = dotenv_values(env_file) # type: ignore - url = "https://" + config["DOMAIN"] - page.goto(url) + config = DIR.get_config("authentik") + base_url = BaseUrl(config["DOMAIN"]) + page.goto(base_url.get()) return page