From f38763d9128bf60457ef261327fbed4e4934bcb1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 27 Nov 2023 14:28:52 +0100 Subject: [PATCH] use new DIR fixture --- src/tests_authentik/fixtures_authentik.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tests_authentik/fixtures_authentik.py b/src/tests_authentik/fixtures_authentik.py index 4a67d49..3d26907 100644 --- a/src/tests_authentik/fixtures_authentik.py +++ b/src/tests_authentik/fixtures_authentik.py @@ -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