Exit Test
Command value: exit
Stops the test immediately and marks it as passing or failing.
Fields
| Field | JSON property | Description |
|---|---|---|
| Exit Status | value | passing (default) or failing. |
Usage
- Steps after an exit step do not run.
- Combine with a step condition to end a test early, for example when a feature flag is off.
Example step (JSON)
{
"command": "exit",
"value": "passing",
"condition_statement": "return !document.querySelector('#beta-banner');"
}Playwright equivalent
return; // exit test as passing
// failing: throw new Error('Test exited as failing');Common options
- Make this step optional (Continue on failure): when checked, a failure in this step is recorded and the test continues with the next step.
- Execute step when JavaScript returns true: runs the step only when the JavaScript condition returns true. Otherwise the step is skipped.
See conditional steps and variables for details.