refactor for independent test dirs (#7)
* make it so that the actual tests can be moved anywhere, for example in abra recipe repos -> major refactoring with pytest test discovery magic * create RUNNER_DICT dynamically with importlib -> none of the tests are hardcoded, more tests can be added by placing a folder * autoload fixtures with pytest plugins * add URL fixture to navigate on web pages. Includes url parser based on python urllib to generate correct links * fix nextcloud setups and tests * add email groundwork with imbox Reviewed-on: local-it-infrastructure/e2e_tests#7 Co-authored-by: Daniel <d.brummerloh@gmail.com> Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
parent
3fa10aaa69
commit
f9c21c6e6b
45 changed files with 373 additions and 228 deletions
27
main.py
27
main.py
|
|
@ -4,9 +4,9 @@ from pathlib import Path
|
|||
|
||||
from loguru import logger
|
||||
|
||||
from src.coordinator import Coordinator
|
||||
from src.dir_manager import DirManager
|
||||
from src.utils import get_session_id
|
||||
from abratest.coordinator import Coordinator
|
||||
from abratest.dir_manager import DirManager
|
||||
from abratest.utils import get_session_id
|
||||
|
||||
# ----------------------------- lookup env files ----------------------------- #
|
||||
|
||||
|
|
@ -23,6 +23,7 @@ from src.utils import get_session_id
|
|||
ENV_FILES = [
|
||||
Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik
|
||||
Path("envfiles/blog.test.dev.local-it.cloud.env"), # wordpress
|
||||
# Path("envfiles/files.test.dev.local-it.cloud.env"), # nextcloud
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -30,12 +31,7 @@ ENV_FILES = [
|
|||
|
||||
|
||||
OUTPUT_DIR = Path("./test-output").resolve()
|
||||
|
||||
|
||||
# -------------------------- enable playwright debug ------------------------- #
|
||||
|
||||
|
||||
# os.environ["PWDEBUG"] = "1"
|
||||
RECIPES_DIR = Path("./recipes").resolve()
|
||||
|
||||
|
||||
# --------------------- load credentials to env variables -------------------- #
|
||||
|
|
@ -49,6 +45,14 @@ for key, value in CREDENTIALS.items():
|
|||
os.environ[key] = value
|
||||
|
||||
|
||||
# -------------------------- enable playwright debug ------------------------- #
|
||||
|
||||
|
||||
# add abra-testing dir
|
||||
os.environ["PYTEST_PLUGINS"] = "abratest.plugin-abra" # "abratest.plugin,abratest.other"
|
||||
# os.environ["PWDEBUG"] = "1"
|
||||
|
||||
|
||||
# ----------------------------- define session_id ---------------------------- #
|
||||
|
||||
|
||||
|
|
@ -58,6 +62,7 @@ session_id = get_session_id()
|
|||
|
||||
# ------------------------------- setup logging ------------------------------ #
|
||||
|
||||
|
||||
DIR = DirManager(output_dir=OUTPUT_DIR, session_id=session_id)
|
||||
log_file = DIR.RECORDS / "coordinator.log"
|
||||
logger.add(log_file)
|
||||
|
|
@ -66,7 +71,9 @@ logger.add(log_file)
|
|||
# ---------------------------- initialize and run ---------------------------- #
|
||||
|
||||
|
||||
coordinator = Coordinator(ENV_FILES, output_dir=OUTPUT_DIR, session_id=session_id)
|
||||
coordinator = Coordinator(
|
||||
env_paths_list=ENV_FILES, output_dir=OUTPUT_DIR, session_id=session_id, recipes_dir=RECIPES_DIR
|
||||
)
|
||||
coordinator.setup_test()
|
||||
coordinator.run_test()
|
||||
coordinator.combine_html()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue