-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: update test_dashboard for ragger
- Loading branch information
1 parent
d96a071
commit 26d8aa7
Showing
1 changed file
with
17 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |