Skip to content

Commit 1a7da4d

Browse files
authored
Merge pull request #233 from LedgerHQ/add/no_nav
[add] '--no-nav' option in conftest
2 parents 336f38d + dcd28c6 commit 1a7da4d

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- Reviews navigation on touchable devices (Flex, Stax) no longer 'taps', but 'swipes'
13+
## [1.33.0] - 2025-??-??
14+
15+
### Added
16+
17+
- conftest: '--no-nav' option to completely disable the navigation during the tests.
1318

1419
## [1.32.0] - 2025-03-31
1520

@@ -86,7 +91,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8691
## [1.24.0] - 2024-10-03
8792

8893
### Added
89-
- conftest: Added a all_eink device option to target Stax and Flex
94+
- conftest: Added 'all_eink' option for the `--device` argument to target Stax + Flex
9095
- conftest: Added a autouse fixture to skip unsupported devices
9196

9297
### Fixed

src/ragger/conftest/base_conftest.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from typing import Generator, List, Optional
33
from pathlib import Path
44
from ledgered.manifest import Manifest
5+
from unittest.mock import MagicMock
6+
57
from ragger.firmware import Firmware
68
from ragger.backend import BackendInterface, SpeculosBackend, LedgerCommBackend, LedgerWalletBackend
79
from ragger.navigator import Navigator, NanoNavigator, TouchNavigator, NavigateWithScenario
@@ -28,6 +30,7 @@
2830
def pytest_addoption(parser):
2931
parser.addoption("--device", choices=DEVICES, required=True)
3032
parser.addoption("--backend", choices=BACKENDS, default="speculos")
33+
parser.addoption("--no-nav", action="store_true", default=False, help="Disable the navigation")
3134
parser.addoption("--display",
3235
action="store_true",
3336
default=False,
@@ -61,6 +64,11 @@ def verbose(pytestconfig):
6164
return pytestconfig.getoption("Verbose")
6265

6366

67+
@pytest.fixture(scope="session")
68+
def navigation(pytestconfig):
69+
return not pytestconfig.getoption("no_nav")
70+
71+
6472
@pytest.fixture(scope="session")
6573
def backend_name(pytestconfig):
6674
return pytestconfig.getoption("backend")
@@ -295,7 +303,11 @@ def backend(skip_tests_for_unsupported_devices, root_pytest_dir: Path, backend_n
295303

296304

297305
@pytest.fixture(scope=conf.OPTIONAL.BACKEND_SCOPE)
298-
def navigator(backend: BackendInterface, firmware: Firmware, golden_run: bool):
306+
def navigator(backend: BackendInterface, firmware: Firmware, golden_run: bool, display: bool,
307+
navigation: bool):
308+
if not navigation:
309+
return MagicMock()
310+
299311
if firmware.is_nano:
300312
return NanoNavigator(backend, firmware, golden_run)
301313
else:

0 commit comments

Comments
 (0)