diff --git a/core/Makefile b/core/Makefile index 734993940f..3c9a5cf47e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -80,10 +80,10 @@ test_emu_click: ## run click tests cd tests ; ./run_tests_click_emu.sh $(TESTOPTS) test_emu_ui: ## run ui integration tests - cd tests ; ./run_tests_device_emu.sh --test-screen=test -m "not skip_ui" $(TESTOPTS) + cd tests ; ./run_tests_device_emu.sh --ui=test -m "not skip_ui" $(TESTOPTS) test_emu_ui_record: ## record and hash screens for ui integration tests - cd tests ; ./run_tests_device_emu.sh --test-screen=record -m "not skip_ui" $(TESTOPTS) + cd tests ; ./run_tests_device_emu.sh --ui=record -m "not skip_ui" $(TESTOPTS) pylint: ## run pylint on application sources and tests pylint -E $(shell find src tests -name *.py) diff --git a/tests/conftest.py b/tests/conftest.py index eab6a66853..f2033d9e95 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -140,7 +140,7 @@ def client(request): def pytest_addoption(parser): parser.addoption( - "--test-screen", + "--ui", action="store", default="", help="Enable UI intergration tests: 'record' or 'test'", diff --git a/tests/ui_tests/__init__.py b/tests/ui_tests/__init__.py index a989adc5e8..288bb3dc89 100644 --- a/tests/ui_tests/__init__.py +++ b/tests/ui_tests/__init__.py @@ -86,20 +86,20 @@ def _process_tested(fixture_test_path, test_name): @contextmanager def screen_recording(client, request): - test_screen = request.config.getoption("test_screen") - if request.node.get_closest_marker("skip_ui") or not test_screen: + test_ui = request.config.getoption("ui") + if request.node.get_closest_marker("skip_ui") or not test_ui: yield return test_name = _get_test_dirname(request.node) fixture_test_path = Path(__file__).parent.resolve() / "fixtures" / test_name - if test_screen == "record": + if test_ui == "record": screen_path = fixture_test_path / "recorded" - elif test_screen == "test": + elif test_ui == "test": screen_path = fixture_test_path / "actual" else: - raise ValueError("Invalid test_screen option.") + raise ValueError("Invalid 'ui' option.") _check_fixture_directory(fixture_test_path, screen_path) @@ -108,9 +108,9 @@ def screen_recording(client, request): yield finally: client.debug.stop_recording() - if test_screen == "record": + if test_ui == "record": _process_recorded(screen_path) - elif test_screen == "test": + elif test_ui == "test": _process_tested(fixture_test_path, test_name) else: - raise ValueError("Invalid test_screen option.") + raise ValueError("Invalid 'ui' option.")