General configuration for pytest is under ledger-app/tests/functional/conftest.py.
Configuration includes useful information like the app name, the devices, and the ragger backends.
First install ragger. It is a python package.
pip install raggerSee Ragger Documentation for additional information.
Follow the instructions in Readme.
To validate, run the app via speculos. Make sure that you run your emulator to match the build.
cd ledger-app
speculos build/nanosp/bin/app.elfYou will need to install several python packages
cd tests/functional
pip install -r requirements.txtYou can run emulated tests for a specific device or for all devices. Set --device to all for all devices.
Use --display to see the emulated UI as the tests are run. The default mode runs the emulator in headless mode.
cd test/functional
pytest -v --tb=short --device=nanox --displayremove the directory ledger-app/tests/functional/snapshots-tmp/ to clean out the old snapshots