diff --git a/tests/conftest.py b/tests/conftest.py index 909ec8b..7f60b44 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,6 @@ from ragger.conftest import configuration - +from ragger.navigator import NavInsID +import pytest ########################### ### CONFIGURATION START ### ########################### @@ -13,3 +14,22 @@ # Pull all features from the base ragger conftest using the overridden configuration pytest_plugins = ("ragger.conftest.base_conftest", ) + +# Notes : +# 1. Remove this fixture once the pending review screen is removed from the app +# 2. This fixture clears the pending review screen before each test +# 3. The scope should be the same as the one configured by BACKEND_SCOPE in +# ragger/conftest/configuration.py +@pytest.fixture(scope="class", autouse=True) +def clear_pending_review(firmware, navigator): + print("Clearing pending review") + # Press a button to clear the pending review + if firmware.device.startswith("nano"): + instructions = [ + NavInsID.BOTH_CLICK, + ] + else: + instructions = [ + NavInsID.TAPPABLE_CENTER_TAP, + ] + navigator.navigate(instructions,screen_change_before_first_instruction=False)