authentik setup and tracing #2

Merged
dan merged 69 commits from working-setup into dev 2023-11-27 17:01:47 +01:00
Showing only changes of commit f38763d912 - Show all commits

View file

@ -4,18 +4,20 @@ from pathlib import Path
import pytest
from playwright.sync_api import BrowserContext
from src.dirmanager import DirManager
@pytest.fixture
def admin_session(context: BrowserContext, STATES: Path) -> BrowserContext:
state_file = STATES / "admin_state.json"
def admin_session(context: BrowserContext, DIR: DirManager) -> BrowserContext:
state_file = DIR.STATES / "admin_state.json"
storage_state = json.loads(state_file.read_bytes())
context.add_cookies(storage_state["cookies"])
return context
@pytest.fixture
def user_session(context: BrowserContext, STATES: Path) -> BrowserContext:
state_file = STATES / "user_state.json"
def user_session(context: BrowserContext, DIR: Path) -> BrowserContext:
state_file = DIR.STATES / "user_state.json"
storage_state = json.loads(state_file.read_bytes())
context.add_cookies(storage_state["cookies"])
return context