use get_config and BaseUrl in fixtures
This commit is contained in:
parent
ef0d9c9415
commit
db2a34c7a7
1 changed files with 7 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue