30 lines
794 B
Python
30 lines
794 B
Python
import json
|
|
import os
|
|
|
|
from playwright.sync_api import BrowserContext
|
|
|
|
from pytest_abra import BaseUrl, DirManager
|
|
|
|
ADMIN_USER = os.environ["ADMIN_USER"]
|
|
ADMIN_PASS = os.environ["ADMIN_PASS"]
|
|
TEST_USER = os.environ["TEST_USER"]
|
|
TEST_PASS = os.environ["TEST_PASS"]
|
|
|
|
|
|
def remove_user():
|
|
pass
|
|
|
|
|
|
def cleanup_delete_user(
|
|
context: BrowserContext, env_config: dict[str, str], DIR: DirManager, URL: BaseUrl, check_if_user_exists
|
|
):
|
|
# load admin cookies to context
|
|
state_file = DIR.STATES / "authentik_admin_state.json"
|
|
storage_state = json.loads(state_file.read_bytes())
|
|
context.add_cookies(storage_state["cookies"])
|
|
|
|
if check_if_user_exists(context, env_config, URL):
|
|
# just login with user
|
|
assert False, "yes"
|
|
remove_user()
|
|
assert False, "no"
|