TestDriver(context, options) to change it.
Choose the operating system
Sandboxes run Linux by default. Setos to run on Windows:
TestDriver() hook also reads the TD_OS environment variable when you don’t pass os. That lets you run one suite on both systems without changing code:
.github/workflows/testdriver.yml
Set the screen resolution
The default resolution is1366x768. Set resolution to change it:
Choose how to watch the run
preview sets where the live view of the sandbox opens:
"browser"opens it in your default browser. This is the default."ide"opens it in an editor panel. This needs the TestDriver extension for VS Code or Cursor."none"turns the live view off. Use this in CI.
headless: true is deprecated. Use preview: "none" instead.
Record the run
- Video. Dashcam records every test by default. Set
dashcam: falseto turn it off. - Screenshots. Set
autoScreenshots: trueto save a screenshot before and after each command. They’re off by default. See Debug a failing test.
Keep a sandbox alive
After a test ends, its sandbox keeps running forkeepAlive milliseconds, so you can reconnect to it:
- The default is
60000(60 seconds). - Values above 30 minutes are capped at 30 minutes.
0uses the default. There’s no value that ends the sandbox immediately.- A sandbox never runs longer than 2 hours in total.
reconnect: true. TestDriver reattaches to the last sandbox it used and skips provision calls, because the app is already open. See Reuse a sandbox while you iterate.
To attach to a specific sandbox, pass its id as sandboxId. Unlike reconnect, sandboxId alone still runs provision calls.
Keep the sandbox when a test fails
SetdebugOnFailure: true to keep the sandbox running when a test fails. TestDriver prints the sandbox id so you can connect to it and look around.
Run on your own machine
To run tests on a machine you manage, setip to its address. See Run on your own machine.
Next steps
Options
Every client option, with its default.
Client & connection
Create, connect, and disconnect a client.
Run tests
Run tests locally and reuse a sandbox.
Run in CI/CD
Run tests on every pull request.

