๐งช Testing
Test 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 โข Browse Examples on GitHub โ
Testing Methodsโ
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) |
Options --android and --ios override ๐ Config properties if are set in both places
Usage
Run Sherlo to test builds with bundled JavaScript:
npx sherlo test:standard
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) |
Options --android and --ios override ๐ Config properties if are set in both places
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>
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:
Option A: Automatic
Start Sherlo and automatically trigger the EAS build using a script from your package.json:
npx sherlo test:eas-cloud-build --easBuildScriptName <name>
Option B: Manual
Start Sherlo and then manually trigger the EAS build command:
npx sherlo test:eas-cloud-build --waitForEasBuild
The --profile option in EAS build command must match the one in eas-build-on-complete script
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 is set in both places