17 lines
492 B
Python
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()
|