Testing
Run visual tests on your React Native builds in the cloud with the testing method that fits your workflow: Standard, EAS Update, or EAS Cloud Build.
Run a visual test with one command
To run tests, use this guided testing command:
npx sherlo test
For non-interactive commands, you can run directly:
npx sherlo test:standard- test app builds with bundled JavaScriptnpx sherlo test:eas-update- test builds with OTA JavaScript updates - skip rebuildsnpx sherlo test:eas-cloud-build- automatically test builds created on Expo servers
Each testing method has a complete example project.
Pick a testing method for your workflow
Select a testing method based on your needs:
- Standard
- EAS Update
- EAS Cloud Build
Description
Run visual tests on app builds with bundled JavaScript.
Workflow
Requirements
- Define paths to preview simulator builds
Options
| Option | Value | Description |
|---|---|---|
--android | <path> | Path to Android build (.apk) |
--ios | <path> | Path to iOS build (.app, .tar.gz or .tar) |
Usage
Run Sherlo to test builds with bundled JavaScript:
npx sherlo test:standard
Try a complete example project with a GitHub Actions workflow included
Description
Run visual tests using over-the-air JavaScript updates - without full app rebuilds.
Workflow
Requirements
- Use EAS Update for over-the-air updates
- Install
expoversion 51 or higher andexpo-dev-client - Define paths to development simulator builds
Options
| Option | Value | Description |
|---|---|---|
--branch | <branch> | Name of the EAS Update branch to fetch the latest update from |
--android | <path> | Path to Android build (.apk) |
--ios | <path> | Path to iOS build (.app, .tar.gz or .tar) |
Usage
Run Sherlo to test the latest update from an EAS Update branch:
npx sherlo test:eas-update --branch <branch>
Make sure you've published your latest changes to EAS Update before testing. You can use:
npx eas-cli update --auto --branch <branch>
Try a complete example project with a GitHub Actions workflow included
Description
Automatically run visual tests after builds complete on Expo servers.
Workflow
Requirements
- Use EAS Build to create preview simulator builds on Expo servers
Add
eas-build-on-completescript to yourpackage.json:package.json{"scripts": {"eas-build-on-complete": "npx sherlo eas-build-on-complete --profile <profile>",// ...},// ...}EAS build profileThe
--profileoption must:- Point to the EAS build profile that creates preview simulator builds
- Match the
--profileoption used in your EAS build command
Options
| Option | Value | Description |
|---|---|---|
--easBuildScriptName | <name> | Name of the package.json script that triggers EAS build |
--waitForEasBuild | Start waiting for EAS build to be triggered manually |
Usage
Run Sherlo to test builds after completion on Expo servers:
Automatic
Start Sherlo and automatically trigger the EAS build using a script from your package.json:
npx sherlo test:eas-cloud-build --easBuildScriptName <name>
Manual
Start Sherlo and then manually trigger the EAS build command:
npx sherlo test:eas-cloud-build --waitForEasBuild
The --profile option in the EAS build command must match the one in eas-build-on-complete script.
Try a complete example project with a GitHub Actions workflow included
Common options
These options work with any testing command:
| Option | Value | Default | Description |
|---|---|---|---|
--token | <token> | Authentication token for the project | |
--message | <message> | Custom message to label the test | |
--config | <path> | sherlo.config.json | Path to the config file |
--projectRoot | <path> | . | Path to the root directory of your project |
Option --token overrides config property if it is set in both places.