* general project refactoring * various small improvements * improve imap fixture with helper functions and typing * add wordpress send email setup * add wordpress receive email test * add various documentation Reviewed-on: local-it-infrastructure/e2e_tests#13 Co-authored-by: Daniel <d.brummerloh@gmail.com> Co-committed-by: Daniel <d.brummerloh@gmail.com>
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
|