From 26d8aa7bd26605679b58c031db1c06e9ac4d2e40 Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Mon, 10 Jul 2023 17:13:40 +0200 Subject: [PATCH] tests: update test_dashboard for ragger --- tests/test_dashboard.py | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/tests/test_dashboard.py b/tests/test_dashboard.py index cbfb9a12e..07639eb74 100644 --- a/tests/test_dashboard.py +++ b/tests/test_dashboard.py @@ -1,27 +1,22 @@ -import pytest +from ragger.navigator import NavInsID +from pathlib import Path -from speculos.client import SpeculosClient +ROOT_SCREENSHOT_PATH = Path(__file__).parent.resolve() -def test_dashboard(comm: SpeculosClient, is_speculos: bool, app_version: str, model: str): +def test_dashboard(firmware, navigator, test_name): # Tests that the text shown in the dashboard screens are the expected ones - if not is_speculos: - pytest.skip("Requires speculos") - - if model == "stax": - pytest.skip("No dashboard test for stax") - - comm.press_and_release("right") - comm.wait_for_text_event("Version") - comm.wait_for_text_event(app_version) - - comm.press_and_release("right") - comm.wait_for_text_event("About") - - comm.press_and_release("right") - comm.wait_for_text_event("Quit") - - comm.press_and_release("right") - comm.wait_for_text_event("Bitcoin Testnet") - comm.wait_for_text_event("is ready") + if firmware.device.startswith("nano"): + instructions = [ + NavInsID.RIGHT_CLICK, + NavInsID.RIGHT_CLICK, + NavInsID.RIGHT_CLICK + ] + else: + instructions = [ + NavInsID.USE_CASE_HOME_INFO, + NavInsID.USE_CASE_SETTINGS_SINGLE_PAGE_EXIT + ] + navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH, test_name, instructions, + screen_change_before_first_instruction=False)