From 0971adf7a7021ac067bb1aa747d864cd3d169adf Mon Sep 17 00:00:00 2001 From: matejcik Date: Mon, 21 Jun 2021 13:55:01 +0200 Subject: [PATCH] feat(tests): generate UI test report again from current data --- tests/ui_tests/__init__.py | 16 ++++++++++++++++ tests/ui_tests/__main__.py | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 tests/ui_tests/__main__.py diff --git a/tests/ui_tests/__init__.py b/tests/ui_tests/__init__.py index 89e53dbae..f225e473d 100644 --- a/tests/ui_tests/__init__.py +++ b/tests/ui_tests/__init__.py @@ -6,6 +6,7 @@ from contextlib import contextmanager from pathlib import Path import pytest +from _pytest.outcomes import Failed from .reporting import testreport @@ -139,3 +140,18 @@ def _get_fixtures_content(fixtures: dict, remove_missing: bool): fixtures = fixtures return json.dumps(fixtures, indent="", sort_keys=True) + "\n" + + +def main(): + read_fixtures() + for record in (UI_TESTS_DIR / "screens").iterdir(): + if not (record / "actual").exists(): + continue + + try: + _process_tested(record, record.name) + print("PASSED:", record.name) + except Failed: + print("FAILED:", record.name) + + testreport.index() diff --git a/tests/ui_tests/__main__.py b/tests/ui_tests/__main__.py new file mode 100644 index 000000000..8273c4ff5 --- /dev/null +++ b/tests/ui_tests/__main__.py @@ -0,0 +1,3 @@ +from . import main + +main()