Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests #19

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ragger.conftest import configuration
from ragger.navigator import NavInsID
import pytest

###########################
Expand All @@ -7,7 +8,7 @@

# You can configure optional parameters by overriding the value of ragger.configuration.OPTIONAL_CONFIGURATION
# Please refer to ragger/conftest/configuration.py for their descriptions and accepted values
configuration.OPTIONAL.BACKEND_SCOPE = "function"
configuration.OPTIONAL.BACKEND_SCOPE = "class"

configuration.OPTIONAL.CUSTOM_SEED = "course grief vintage slim tell hospital car maze model style elegant kitchen state purpose matrix gas grid enable frown road goddess glove canyon key"

Expand All @@ -33,3 +34,23 @@ def pytest_collection_modifyitems(config, items):
for item in items:
if "all" in item.keywords:
item.add_marker(skip)

class PreauthNavigator:
def __init__(self, navigator, firmware, default_screenshot_path, test_name):
self.navigator = navigator
self.firmware = firmware
self.default_screenshot_path = default_screenshot_path
self.test_name = test_name

def navigate(self):
if self.firmware.is_nano:
self.navigator.navigate_until_text_and_compare(navigate_instruction=NavInsID.RIGHT_CLICK,
validation_instructions=[NavInsID.BOTH_CLICK],
text="Generate",
path=self.default_screenshot_path,
test_case_name=self.test_name + "_preauth",
screen_change_after_last_instruction=False)

@pytest.fixture(scope="function")
def preauth_navigator(navigator, firmware, default_screenshot_path, test_name) -> PreauthNavigator:
return PreauthNavigator(navigator, firmware, default_screenshot_path, test_name)
2 changes: 2 additions & 0 deletions tests/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool:pytest]
addopts = --strict-markers
Binary file modified tests/snapshots/flex/test_get_address_0/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/flex/test_get_address_0/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/flex/test_get_address_0/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/flex/test_get_address_0/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/flex/test_get_address_0/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/flex/test_get_address_1/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/flex/test_get_address_1/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/flex/test_get_address_1/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/flex/test_get_address_1/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/flex/test_get_address_1/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/flex/test_get_address_2/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/flex/test_get_address_2/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/flex/test_get_address_2/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/flex/test_get_address_2/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/flex/test_get_address_2/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/flex/test_get_address_3/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/flex/test_get_address_3/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/flex/test_get_address_3/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/flex/test_get_address_3/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/flex/test_get_address_3/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/flex/test_get_address_49370/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/flex/test_get_address_49370/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/flex/test_get_address_49370/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/flex/test_get_address_49370/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/flex/test_get_address_49370/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/flex/test_get_address_x312a/00000.png
Binary file modified tests/snapshots/flex/test_get_address_x312a/00001.png
Binary file modified tests/snapshots/flex/test_get_address_x312a/00002.png
Binary file modified tests/snapshots/flex/test_get_address_x312a/00003.png
Binary file modified tests/snapshots/flex/test_get_address_x312a/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_0/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_0/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_0/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_0/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_1/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_1/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_1/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_1/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_1/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_1/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_2/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_2/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_2/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_2/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_2/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_2/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_3/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_3/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_3/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_3/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_3/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_3/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_mainet/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_mainet/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_mainet/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_mainet/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_mainet/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_mainet/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_testnet/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_testnet/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_testnet/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_testnet/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_testnet/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_0_4_testnet/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00005.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_1/00007.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_2/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_2/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_2/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_2/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_2/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_2/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_3/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_3/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_3/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_3/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_3/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_3/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00005.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_4/00007.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_5/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_5/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_5/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_5/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_5/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_12586_5/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_2/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_2/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_2/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_2/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_2/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_2/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_2_1/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_2_1/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_2_1/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_2_1/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_2_1/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_2_1/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_3/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_3/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_3/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_3/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_3/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_3/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_3_1/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_3_1/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_3_1/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_3_1/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_3_1/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_3_1/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370/00006.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370_1/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370_1/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370_1/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370_1/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370_1/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_49370_1/00006.png
Binary file modified tests/snapshots/nanos/test_get_address_2/00000.png
Binary file modified tests/snapshots/nanos/test_get_address_2/00001.png
Binary file modified tests/snapshots/nanos/test_get_address_2/00002.png
Binary file modified tests/snapshots/nanos/test_get_address_2/00003.png
Binary file modified tests/snapshots/nanos/test_get_address_2_preauth/00001.png
Binary file modified tests/snapshots/nanosp/test_get_address_2/00000.png
Binary file modified tests/snapshots/nanosp/test_get_address_2/00001.png
Binary file modified tests/snapshots/nanosp/test_get_address_2_preauth/00001.png
Binary file modified tests/snapshots/nanox/test_get_address_2/00000.png
Binary file modified tests/snapshots/nanox/test_get_address_2/00001.png
Binary file modified tests/snapshots/nanox/test_get_address_2_preauth/00001.png
Binary file modified tests/snapshots/stax/test_get_address_0/00002.png
Binary file modified tests/snapshots/stax/test_get_address_0/00003.png
Binary file modified tests/snapshots/stax/test_get_address_0/00004.png
Binary file removed tests/snapshots/stax/test_get_address_0/00005.png
Diff not rendered.
Binary file removed tests/snapshots/stax/test_get_address_0/00006.png
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_address_1/00002.png
Binary file modified tests/snapshots/stax/test_get_address_1/00003.png
Binary file modified tests/snapshots/stax/test_get_address_1/00004.png
Binary file removed tests/snapshots/stax/test_get_address_1/00005.png
Diff not rendered.
Binary file removed tests/snapshots/stax/test_get_address_1/00006.png
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_address_2/00001.png
Binary file modified tests/snapshots/stax/test_get_address_2/00002.png
Binary file modified tests/snapshots/stax/test_get_address_2/00003.png
Binary file modified tests/snapshots/stax/test_get_address_2/00004.png
Binary file removed tests/snapshots/stax/test_get_address_2/00005.png
Diff not rendered.
Binary file removed tests/snapshots/stax/test_get_address_2/00006.png
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_address_3/00002.png
Binary file modified tests/snapshots/stax/test_get_address_3/00003.png
Binary file modified tests/snapshots/stax/test_get_address_3/00004.png
Binary file removed tests/snapshots/stax/test_get_address_3/00005.png
Diff not rendered.
Binary file removed tests/snapshots/stax/test_get_address_3/00006.png
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_address_49370/00002.png
Binary file modified tests/snapshots/stax/test_get_address_49370/00003.png
Binary file modified tests/snapshots/stax/test_get_address_49370/00004.png
Diff not rendered.
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_address_x312a/00002.png
Binary file modified tests/snapshots/stax/test_get_address_x312a/00003.png
Binary file modified tests/snapshots/stax/test_get_address_x312a/00004.png
Diff not rendered.
Diff not rendered.
Loading
Loading