Skip to content

Commit

Permalink
Updated Ragger tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apaillier-ledger committed Dec 11, 2024
1 parent 22004b2 commit cf07914
Show file tree
Hide file tree
Showing 107 changed files with 26 additions and 16 deletions.
Binary file modified tests/ragger/snapshots/flex/test_blind_sign_rejected/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/ragger/snapshots/flex/test_blind_sign_rejected/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/ragger/snapshots/flex/test_blind_sign_signed/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/ragger/snapshots/flex/test_blind_sign_signed/00003.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.
Binary file modified tests/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/00007.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/ragger/snapshots/nanos/test_blind_sign_rejected/00008.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/ragger/snapshots/nanos/test_blind_sign_rejected/00009.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/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/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/ragger/snapshots/nanos/test_blind_sign_rejected/00012.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.
Binary file modified tests/ragger/snapshots/nanos/test_blind_sign_signed/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/ragger/snapshots/nanos/test_blind_sign_signed/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/ragger/snapshots/nanos/test_blind_sign_signed/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/ragger/snapshots/nanos/test_blind_sign_signed/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/ragger/snapshots/nanos/test_blind_sign_signed/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/ragger/snapshots/nanos/test_blind_sign_signed/00007.png
Binary file modified tests/ragger/snapshots/nanos/test_blind_sign_signed/00008.png
Binary file modified tests/ragger/snapshots/nanos/test_blind_sign_signed/00009.png
Binary file modified tests/ragger/snapshots/nanos/test_blind_sign_signed/00010.png
Binary file modified tests/ragger/snapshots/nanos/test_blind_sign_signed/00011.png
Binary file modified tests/ragger/snapshots/nanos/test_sign_parameter_selector/00016.png
Binary file modified tests/ragger/snapshots/nanos/test_sign_parameter_selector/00017.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00002.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00003.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00004.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00005.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00006.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00007.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_rejected/00008.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_signed/00002.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_signed/00003.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_signed/00004.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_signed/00005.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_signed/00006.png
Binary file modified tests/ragger/snapshots/nanosp/test_blind_sign_signed/00007.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00002.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00003.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00004.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00005.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00006.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00007.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_rejected/00008.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_signed/00002.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_signed/00003.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_signed/00004.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_signed/00005.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_signed/00006.png
Binary file modified tests/ragger/snapshots/nanox/test_blind_sign_signed/00007.png
Binary file modified tests/ragger/snapshots/nanox/test_sign_parameter_selector/00011.png
Binary file modified tests/ragger/snapshots/nanox/test_sign_parameter_selector/00012.png
Binary file modified tests/ragger/snapshots/nanox/test_sign_parameter_selector/00014.png
Binary file modified tests/ragger/snapshots/nanox/test_sign_parameter_selector/00016.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_rejected/00001.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_rejected/00002.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_rejected/00003.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_rejected/00004.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_rejected/00005.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_signed/00001.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_signed/00002.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_signed/00003.png
Binary file modified tests/ragger/snapshots/stax/test_blind_sign_signed/00004.png
Binary file modified tests/ragger/snapshots/stax/test_sign_parameter_selector/00011.png
42 changes: 26 additions & 16 deletions tests/ragger/test_blind_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def common_tx_params() -> dict:
}


# Token approval, would require loading the "internal plugin" &
# providing the token metadata from the CAL
# Token approval, would require providing the token metadata from the CAL
def test_blind_sign(firmware: Firmware,
backend: BackendInterface,
navigator: Navigator,
Expand Down Expand Up @@ -81,12 +80,29 @@ def test_blind_sign(firmware: Firmware,
# blind signing warning
moves += [NavInsID.RIGHT_CLICK]

# review | from | amount | to | fees
moves += [NavInsID.RIGHT_CLICK] * 5
# review
moves += [NavInsID.RIGHT_CLICK]

# tx hash
if firmware == Firmware.NANOS:
# for the two addresses
moves += [NavInsID.RIGHT_CLICK] * 4
else:
moves += [NavInsID.RIGHT_CLICK] * 2

# from
if firmware == Firmware.NANOS:
moves += [NavInsID.RIGHT_CLICK] * 3
else:
moves += [NavInsID.RIGHT_CLICK]

# to
if firmware == Firmware.NANOS:
moves += [NavInsID.RIGHT_CLICK] * 3
else:
moves += [NavInsID.RIGHT_CLICK]

# fees
moves += [NavInsID.RIGHT_CLICK]

if not sign:
moves += [NavInsID.RIGHT_CLICK]
Expand All @@ -95,10 +111,7 @@ def test_blind_sign(firmware: Firmware,
else:
moves += [NavInsID.USE_CASE_CHOICE_REJECT]

if firmware == Firmware.STAX:
moves += [NavInsID.SWIPE_CENTER_TO_LEFT] * 2
else:
moves += [NavInsID.SWIPE_CENTER_TO_LEFT] * 3
moves += [NavInsID.SWIPE_CENTER_TO_LEFT] * 3

if sign:
moves += [NavInsID.USE_CASE_REVIEW_CONFIRM]
Expand Down Expand Up @@ -171,21 +184,18 @@ def test_sign_parameter_selector(firmware: Firmware,
moves += [NavInsID.RIGHT_CLICK] * 4 + [NavInsID.BOTH_CLICK]
# parameter 2
moves += [NavInsID.RIGHT_CLICK] * 3 + [NavInsID.BOTH_CLICK]
# blind signing | review | from | amount | to | fees
moves += [NavInsID.RIGHT_CLICK] * 10
# blind signing | review | tx hash | from | to | fees
moves += [NavInsID.RIGHT_CLICK] * 13
else:
# (verify | parameter) * flows
moves += ([NavInsID.RIGHT_CLICK] * 2 + [NavInsID.BOTH_CLICK]) * params
# blind signing | review | from | amount | to | fees
moves += [NavInsID.RIGHT_CLICK] * 6
moves += [NavInsID.RIGHT_CLICK] * 7
moves += [NavInsID.BOTH_CLICK]
else:
moves += ([NavInsID.SWIPE_CENTER_TO_LEFT] * 2 + [NavInsID.USE_CASE_REVIEW_CONFIRM]) * (1 + params)
moves += [NavInsID.USE_CASE_CHOICE_REJECT]
if firmware == Firmware.STAX:
tap_number = 2
else:
tap_number = 3
tap_number = 3
moves += [NavInsID.SWIPE_CENTER_TO_LEFT] * tap_number
moves += [NavInsID.USE_CASE_REVIEW_CONFIRM]
navigator.navigate_and_compare(default_screenshot_path,
Expand Down

0 comments on commit cf07914

Please sign in to comment.