move fixtures
This commit is contained in:
parent
78fafc1e5c
commit
0d6bd2d0f8
2 changed files with 18 additions and 12 deletions
|
|
@ -12,7 +12,7 @@ import pytest
|
|||
from dotenv import dotenv_values
|
||||
from icecream import ic # type: ignore
|
||||
from imbox import Imbox # type: ignore
|
||||
from playwright.sync_api import APIRequestContext, BrowserContext, Playwright, expect
|
||||
from playwright.sync_api import BrowserContext, expect
|
||||
from pytest import Parser
|
||||
|
||||
from pytest_abra import BaseUrl, DirManager, EnvFile
|
||||
|
|
@ -150,14 +150,3 @@ def imap_recent_messages(imap_client: Imbox) -> list[Message]:
|
|||
messages.append(message)
|
||||
|
||||
return messages
|
||||
|
||||
|
||||
@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()
|
||||
|
|
|
|||
17
recipes/authentik/tests_authentik/conftest.py
Normal file
17
recipes/authentik/tests_authentik/conftest.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue