23 lines
675 B
Python
23 lines
675 B
Python
import json
|
|
|
|
import pytest
|
|
from playwright.sync_api import BrowserContext, Page
|
|
|
|
from pytest_abra import BaseUrl, DirManager
|
|
|
|
pytest_plugins = "authentik.tests_authentik.fixtures_authentik"
|
|
|
|
|
|
@pytest.fixture
|
|
def wordpress_admin_context(context: BrowserContext, DIR: DirManager) -> BrowserContext:
|
|
state_file = DIR.STATES / "wordpress_admin_state.json"
|
|
storage_state = json.loads(state_file.read_bytes())
|
|
context.add_cookies(storage_state["cookies"])
|
|
return context
|
|
|
|
|
|
@pytest.fixture
|
|
def wordpress_admin_page(wordpress_admin_context: BrowserContext, URL: BaseUrl) -> Page:
|
|
page = wordpress_admin_context.new_page()
|
|
page.goto(URL.get())
|
|
return page
|