authentik setup and tracing (#2)

* authentik sessions created successfully during setup without breaking tracing

* setup works on EN and DE localization by using regex patterns

* automated tracing with pytest --trace option, manual hook no longer needed

Reviewed-on: local-it-infrastructure/e2e_tests#2
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
Daniel 2023-11-27 17:01:45 +01:00 committed by dan
parent 97ed87c79f
commit d2cd6ba47f
22 changed files with 519 additions and 304 deletions

37
main.py Normal file
View file

@ -0,0 +1,37 @@
import json
import os
from pathlib import Path
from src.utils import get_session_id
from src.wrapper import Wrapper
# The env file list is the input to testing framework. each env file triggers
# the execution of one test Runner and provides configuration to the tests
# inside the runner. There can be dependencies, for example wordpress requires
# that authentik ran first to create the admin session and the user session.
# At the moment, wrong ordering results in unsuccessful test (wrong ordering
# would be wordpress env file is before authentik env file).
ENV_FILES = [
Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik
Path("envfiles/blog.test.dev.local-it.cloud.env"), # wordpress
]
OUTPUT_DIR = Path("./test-output").resolve()
# Set environment variables
# os.environ["PWDEBUG"] = "1"
cred_file = Path("credentials.json")
with open(cred_file, "r") as f:
CREDENTIALS = json.load(f)
os.environ["ADMIN_USER"] = CREDENTIALS["admin_user"]
os.environ["ADMIN_PASS"] = CREDENTIALS["admin_pass"]
session_id = get_session_id()
wrapper = Wrapper(ENV_FILES, output_dir=OUTPUT_DIR, session_id=session_id)
wrapper.setup_test()
wrapper.run_test()