Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krigga committed Mar 7, 2024
1 parent 29965f1 commit da5d7a4
Show file tree
Hide file tree
Showing 144 changed files with 22 additions and 8 deletions.
23 changes: 22 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from ragger.conftest import configuration
from ragger.navigator import NavInsID
import pytest

###########################
### CONFIGURATION START ###
Expand All @@ -12,4 +14,23 @@
#########################

# Pull all features from the base ragger conftest using the overridden configuration
pytest_plugins = ("ragger.conftest.base_conftest", )
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.USE_CASE_CHOICE_CONFIRM,
]
navigator.navigate(instructions,screen_change_before_first_instruction=False)
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_app_mainmenu/00023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_accepted/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_accepted/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_accepted/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_accepted/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_refused/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_refused/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_refused/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_refused/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_get_proof_refused/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanosp/test_sign_data/part0/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part0/00002.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part0/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part0/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part1/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part1/00002.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part1/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part1/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_data/part1/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_data_refused/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_data_refused/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_blind_error/00000.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_blind_error/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_no_payload/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_refused/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_refused/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_subwallet_id/part0/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_subwallet_id/part1/00007.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part0/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part1/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part10/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part13/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part13/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part13/00007.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part2/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part2/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part2/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part2/00007.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part2/00008.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part3/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part3/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part3/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part3/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part3/00007.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part4/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part4/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part4/00006.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part4/00007.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part5/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part5/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part5/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part6/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part6/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part7/00000.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part7/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part7/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part7/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part7/00005.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part8/00000.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part8/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part9/00003.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_with_payload/part9/00007.png
Binary file modified tests/snapshots/stax/test_get_proof_accepted/00005.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_public_key_confirm_accepted/00004.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified tests/snapshots/stax/test_sign_data/part0/00003.png
Binary file modified tests/snapshots/stax/test_sign_data/part1/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_no_payload/00003.png
Binary file modified tests/snapshots/stax/test_sign_tx_subwallet_id/part0/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_subwallet_id/part1/00005.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part0/00005.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part1/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part10/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part11/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part12/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part13/00005.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part2/00005.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part3/00005.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part4/00005.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part5/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part6/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part7/00004.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part8/00003.png
Binary file modified tests/snapshots/stax/test_sign_tx_with_payload/part9/00004.png
4 changes: 0 additions & 4 deletions tests/test_proof_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def test_get_proof_accepted(firmware, backend, navigator, test_name):
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_EXIT_QR,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM,
NavInsID.WAIT_FOR_HOME_SCREEN
]
navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH,
test_name,
Expand Down Expand Up @@ -62,18 +61,15 @@ def test_get_proof_refused(firmware, backend, navigator, test_name):
instructions_set = [
[
NavInsID.USE_CASE_REVIEW_REJECT,
NavInsID.WAIT_FOR_HOME_SCREEN
],
[
NavInsID.USE_CASE_REVIEW_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CANCEL,
NavInsID.WAIT_FOR_HOME_SCREEN
],
[
NavInsID.USE_CASE_REVIEW_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CANCEL,
NavInsID.WAIT_FOR_HOME_SCREEN
]
]
for i, instructions in enumerate(instructions_set):
Expand Down
3 changes: 0 additions & 3 deletions tests/test_pubkey_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def test_get_public_key_confirm_accepted(firmware, backend, navigator, test_name
NavIns(NavInsID.TOUCH, (200, 335)),
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_EXIT_QR,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM,
NavInsID.WAIT_FOR_HOME_SCREEN
]
navigator.navigate_and_compare(ROOT_SCREENSHOT_PATH,
test_name,
Expand Down Expand Up @@ -60,12 +59,10 @@ def test_get_public_key_confirm_refused(firmware, backend, navigator, test_name)
instructions_set = [
[
NavInsID.USE_CASE_REVIEW_REJECT,
NavInsID.WAIT_FOR_HOME_SCREEN
],
[
NavInsID.USE_CASE_REVIEW_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CANCEL,
NavInsID.WAIT_FOR_HOME_SCREEN
]
]
for i, instructions in enumerate(instructions_set):
Expand Down

0 comments on commit da5d7a4

Please sign in to comment.