Skip to content

Commit

Permalink
Add Stax function tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aido committed Sep 2, 2024
1 parent 7cb07d0 commit 5a994e2
Show file tree
Hide file tree
Showing 4 changed files with 352 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
download_app_binaries_artifact: compiled_app_binaries
test_dir: tests/functional
run_for_devices: '["nanos"]'
run_for_devices: '["nanos", "stax"]'

ledger_app_test_unit:
name: Unit tests
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.0] - 2024-08-25
## [1.8.0] - 2024-09-02

### Added

Expand All @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add Stax layouts for recovering BIP39 phrase
- Add screenshots and animations
- Add demo videos for Stax and Nano S
- Add Stax function tests

## [1.7.4] - 2024-06-20

Expand Down
94 changes: 94 additions & 0 deletions tests/functional/test_bip39_12word.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,101 @@ def nanos_bip39_12word(backend, navigator):
backend.wait_for_text_on_screen("tuna next keep gyro", 1)
navigator.navigate_until_text(NavInsID.RIGHT_CLICK, [], "Quit", 20, screen_change_before_first_instruction=False)

def stax_bip39_12word(backend):
backend.wait_for_text_on_screen("Seed Tool", 10)
backend.finger_touch(106, 510, 1)
backend.wait_for_text_on_screen("BIP39 Check", 5)
backend.finger_touch(124, 601, 1)
backend.finger_touch(148, 601, 1)
backend.wait_for_text_on_screen("Enter word", 5)
backend.finger_touch(160, 520, 1) # f
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(220, 464, 1) # y
backend.finger_touch(100, 280, 1)
backend.finger_touch(260, 576, 1) # m
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(60, 576, 1) # x
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(100, 280, 1)
backend.finger_touch(180, 464, 1) # t
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 280, 1)
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(160, 520, 1) # f
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(260, 576, 1) # m
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(100, 280, 1)
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 280, 1)
backend.wait_for_text_on_screen("Correct Secret", 5)
backend.wait_for_text_on_screen("Recovery Phrase", 1)
backend.finger_touch(200, 630, 1)
backend.wait_for_text_on_screen("Generate SSKR", 5)
backend.finger_touch(200, 550, 1)
backend.wait_for_text_on_screen("Enter number of SSKR shares", 5)
backend.finger_touch(340, 300, 1) # 3
backend.finger_touch(340, 600,1)
backend.wait_for_text_on_screen("Enter threshold value", 5)
backend.finger_touch(195, 300, 1) # 2
backend.finger_touch(340, 600,1)
backend.wait_for_text_on_screen("SSKR Share", 5)
backend.wait_for_text_on_screen("tuna next keep gyro", 1)
backend.wait_for_text_on_screen("1 of 3", 1)
backend.finger_touch(360, 630,1)
backend.wait_for_text_on_screen("SSKR Share", 5)
backend.wait_for_text_on_screen("tuna next keep gyro", 1)
backend.wait_for_text_on_screen("2 of 3", 1)
backend.finger_touch(360, 630,1)
backend.wait_for_text_on_screen("SSKR Share", 5)
backend.wait_for_text_on_screen("tuna next keep gyro", 1)
backend.wait_for_text_on_screen("3 of 3", 1)
backend.finger_touch(80, 630,1)
backend.wait_for_text_on_screen("Seed Tool", 5)
backend.finger_touch(200, 630,1)

@mark.use_on_backend("speculos")
def test_bip39_12word(firmware, backend, navigator, set_seed):
if firmware.device == "nanos":
nanos_bip39_12word(backend, navigator)
elif firmware.device == "stax":
stax_bip39_12word(backend)
255 changes: 255 additions & 0 deletions tests/functional/test_sskr_128bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,262 @@ def nanos_sskr_128bit(backend, navigator):
navigator.navigate([NavInsID.RIGHT_CLICK], screen_change_before_first_instruction=False)
backend.wait_for_text_on_screen("Quit", 1)

def stax_sskr_128bit(backend):
backend.wait_for_text_on_screen("Seed Tool", 10)
backend.finger_touch(106, 510, 1)
backend.wait_for_text_on_screen("SSKR Check", 5)
backend.finger_touch(212, 510, 1)
backend.wait_for_text_on_screen("Enter Share 1 Word 1", 5)
backend.finger_touch(180, 464, 1) # t
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 280, 1)
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(60, 576, 1) # x
backend.finger_touch(100, 280, 1)
backend.finger_touch(320, 520, 1) # k
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(200, 520, 1) # g
backend.finger_touch(220, 464, 1) # y
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 280, 1)
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(180, 576, 1) # b
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(180, 576, 1) # b
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(280, 520, 1) # j
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(60, 464, 1) # w
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(240, 520, 1) # h
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(100, 280, 1)
backend.finger_touch(280, 520, 1) # j
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(100, 280, 1)
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(100, 280, 1)
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(100, 280, 1)
backend.finger_touch(320, 520, 1) # k
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(100, 280, 1)
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(100, 280, 1)
backend.finger_touch(160, 520, 1) # f
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 576, 1) # v
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(180, 464, 1) # t
backend.finger_touch(60, 464, 1) # w
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 576, 1) # v
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 280, 1)
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(60, 464, 1) # w
backend.finger_touch(240, 520, 1) # h
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(280, 520, 1) # j
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(260, 576, 1) # m
backend.finger_touch(100, 280, 1)
backend.finger_touch(280, 520, 1) # j
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 280, 1)
backend.finger_touch(180, 464, 1) # t
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 280, 1)
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(60, 576, 1) # x
backend.finger_touch(100, 280, 1)
backend.finger_touch(320, 520, 1) # k
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(200, 520, 1) # g
backend.finger_touch(220, 464, 1) # y
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 280, 1)
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(180, 576, 1) # b
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(200, 520, 1) # g
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(20, 464, 1) # q
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(320, 520, 1) # k
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(60, 464, 1) # w
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(320, 520, 1) # k
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(100, 280, 1)
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(260, 576, 1) # m
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(380, 464, 1) # p
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 280, 1)
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(100, 280, 1)
backend.finger_touch(160, 520, 1) # f
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(100, 280, 1)
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(300, 464, 1) # i
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(100, 280, 1)
backend.finger_touch(180, 576, 1) # b
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(100, 280, 1)
backend.finger_touch(200, 520, 1) # g
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(260, 576, 1) # m
backend.finger_touch(100, 280, 1)
backend.finger_touch(220, 464, 1) # y
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(100, 280, 1)
backend.finger_touch(160, 520, 1) # f
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(140, 464, 1) # r
backend.finger_touch(100, 280, 1)
backend.finger_touch(180, 576, 1) # b
backend.finger_touch(260, 464, 1) # u
backend.finger_touch(360, 520, 1) # l
backend.finger_touch(100, 280, 1)
backend.finger_touch(200, 520, 1) # g
backend.finger_touch(100, 464, 1) # e
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(100, 280, 1)
backend.finger_touch(280, 520, 1) # j
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(120, 520, 1) # d
backend.finger_touch(100, 280, 1)
backend.finger_touch(220, 576, 1) # n
backend.finger_touch(40, 520, 1) # a
backend.finger_touch(140, 576, 1) # v
backend.finger_touch(100, 280, 1)
backend.finger_touch(100, 576, 1) # c
backend.finger_touch(340, 464, 1) # o
backend.finger_touch(80, 520, 1) # s
backend.finger_touch(100, 280, 1)
backend.wait_for_text_on_screen("Correct Secret", 5)
backend.wait_for_text_on_screen("Recovery Phrase", 1)
backend.finger_touch(200, 630, 1)
backend.wait_for_text_on_screen("Recover BIP39", 5)
backend.finger_touch(200, 550, 1)
backend.wait_for_text_on_screen("BIP39 Phrase", 5)
backend.wait_for_text_on_screen("fly mule excess", 1)
backend.wait_for_text_on_screen("resource treat", 1)
backend.wait_for_text_on_screen("plunge nose soda", 1)
backend.wait_for_text_on_screen("reflect adult ramp", 1)
backend.wait_for_text_on_screen("planet", 1)
backend.finger_touch(200, 630,1)
backend.wait_for_text_on_screen("Seed Tool", 5)
backend.finger_touch(200, 630,1)

@mark.use_on_backend("speculos")
def test_sskr_128bit(firmware, backend, navigator, set_seed):
if firmware.device == "nanos":
nanos_sskr_128bit(backend, navigator)
elif firmware.device == "stax":
stax_sskr_128bit(backend)

0 comments on commit 5a994e2

Please sign in to comment.