various #16
2 changed files with 31 additions and 0 deletions
30
recipes/authentik/tests_authentik/cleanup_authentik.py
Normal file
30
recipes/authentik/tests_authentik/cleanup_authentik.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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"
|
||||
|
|
@ -5,3 +5,4 @@ class RunnerAuthentik(Runner):
|
|||
env_type = "authentik"
|
||||
setups = [Test(test_file="setup_authentik.py")]
|
||||
tests = [Test(test_file="test_authentik_blueprint_api.py")]
|
||||
cleanups = [Test(test_file="cleanup_authentik.py", prevent_skip=True)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue