Skip to content

Commit

Permalink
tests: update test_dashboard for ragger
Browse files Browse the repository at this point in the history
  • Loading branch information
sgliner-ledger committed Mar 7, 2024
1 parent d96a071 commit 26d8aa7
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions tests/test_dashboard.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 26d8aa7

Please sign in to comment.