detox-cli lets you operate Detox from command line.
Install detox-cli globally via npm:
npm install -g detox-clidetox [options] [command]| Command | Description |
|---|---|
| test | Initiating your test suite |
| build | Run the command defined in configuration.build |
| run-server | Starts a standalone detox server |
| init | Create initial e2e tests folder |
| clean-framework-cache | Delete all compiled framework binaries from ~/Library/Detox, they will be rebuilt when running 'detox test' |
| help | Display help for specific command |
| Options | Description |
|---|---|
| -h --help |
Output usage information |
Initiating your test suite
detox test [options]
| Option | Description |
|---|---|
| -h, --help | output usage information |
| -r, --runner [runner] | Test runner (supports mocha and jest) |
| -o, --runner-config <config> | Test runner config file |
| -l, --loglevel [value] | info, debug, verbose, silly, wss |
| -c, -configuration <device config> | Select a device configuration from your defined figurations,if not supplied, and there's only one configuration, detox will default to it |
| -r, --reuse | Reuse existing installed app (do not delete and re-tall) for a faster run. |
| -u, --cleanup | Shutdown simulator when test is over, useful for CI ipts, to make sure detox exists cleanly with no residue |
| -d, --debug-synchronization <value> | When an action/expectation takes a significant amount time use this option to print device synchronization status. The status will be printed if the ion takes more than [value]ms to complete |
| -a, --artifacts-location <path> | Artifacts destination path (currently contains only logs). For more details, please check the Artifacts doc |
Run a command defined in 'configuration.build'
detox build <command> [options]
| Option | Description |
|---|---|
| -h, --help | output usage information |
| -c, --configuration <device config> | Select a device configuration from your defined configurations,if not supplied, and there's only one configuration, detox will default to it |
Start a standalone detox server
detox run-server [options]
| Option | Description |
|---|---|
| -h, --help | output usage information |
Create initial e2e tests folder
detox init [options
| Option | Description |
|---|---|
| -h, --help | output usage information |
| -r, --runner | Test runner (currently supports only mocha) |
Display help for a command
detox help [command]