* add full integration test of cli / pytest_abra with all tests

* save path of runner_*.py in runner subclass to improve test discovery -> allows for same test name in two different runners

* reorganize output dir names

* use URL fixture everywhere

* rework coordinator interface

* add --session_id to cli args

* add log results table

* plenty of refactoring

* add assert messages

* add plenty of tests

* add /docs dir with plenty of documentation

* fix authentik setup

* add authentik cleanup, remove test user

* add random test user credential generation and integrate into test routine. random creds are saved to STATES

Reviewed-on: local-it-infrastructure/e2e_tests#16
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
Daniel 2023-12-14 14:03:58 +01:00 committed by dan
parent 016b88a68d
commit 2dd765a974
36 changed files with 1145 additions and 432 deletions

View file

@ -16,27 +16,31 @@ def session_tmp_path(tmp_path_factory: pytest.TempPathFactory) -> Path:
return tmp_path_factory.mktemp("html_test")
def test_merge_html(session_tmp_path: Path):
@pytest.fixture(scope="session")
def html_file(session_tmp_path: Path) -> Path:
"""combines all generated pytest html reports into one"""
in_dir_path = Path(__file__).parent / "assets" / "html_merge"
in_dir_path = in_dir_path.resolve()
ic(in_dir_path)
out_file_path = session_tmp_path / "test.html"
out_assets_dir = session_tmp_path / "assets"
html_file = session_tmp_path / "test.html"
merge_html_reports(in_dir_path.as_posix(), out_file_path.as_posix(), "combined.html")
merge_html_reports(in_dir_path.as_posix(), html_file.as_posix(), "combined.html")
return html_file
assert out_file_path.is_file()
assert out_assets_dir.is_dir()
assert next(out_assets_dir.glob("*"))
def test_merge_html(html_file: Path):
assert html_file.is_file()
assert html_file.parent.is_dir()
assert next(html_file.parent.glob("*"))
@pytest.mark.slow
def test_check_result_with_playwright(session_tmp_path, context: BrowserContext):
html_file = session_tmp_path / "test.html"
def test_check_result_with_playwright(html_file: Path, context: BrowserContext):
assert html_file.is_file()
file_url = BaseUrl(netloc=html_file.as_posix(), scheme="file").get()
page = context.new_page()
page.goto(file_url)