e2e_tests/recipes/authentik/tests_authentik/conftest.py
2023-12-13 17:00:56 +01:00

17 lines
492 B
Python

from typing import Generator
import pytest
from playwright.sync_api import APIRequestContext, Playwright
from pytest_abra import DirManager
@pytest.fixture(scope="session")
def api_request_context(
playwright: Playwright,
DIR: DirManager,
) -> Generator[APIRequestContext, None, None]:
state_file = DIR.STATES / "authentik_admin_state.json"
request_context = playwright.request.new_context(storage_state=state_file)
yield request_context
request_context.dispose()