- Recording is on by default. You don’t need to configure anything.
- The replay includes the console output from your test and, for websites, the page’s network traffic.
- When the test ends, TestDriver prints a link to the replay.
How recording works
- A provision method starts it. Every provision method starts Dashcam after it launches your app:
chrome(),chromeExtension(),vscode(),installer(),electron(), anddashcam(). - The test runs. Everything on the sandbox screen is recorded.
- The test ends. The Vitest hook stops the recording, uploads your test’s console output to the replay, and prints the link:
chrome() also records the network traffic for the domain of the URL it opens.
When Vitest retries a failed test, each attempt gets its own recording and link.
Add a log file to the replay
Callprovision.dashcam() to show a log file from the sandbox next to the video. Call it before the method that launches your app, so the log is set up before recording starts:
tests/checkout.test.mjs
string
The log file in the sandbox. Defaults to
/tmp/testdriver.log on Linux, or C:\Users\testdriver\testdriver.log on Windows.string
default:"TestDriver Log"
The log’s name in the replay.
boolean
default:"true"
Also record network traffic. It covers the domain opened with
chrome() if that ran first, or all traffic otherwise.string
The recording’s title. Defaults to the test file’s name and the test’s name, such as
checkout - records the app log.Turn recording off
Passdashcam: false when you create the client:
Control the recording yourself
testdriver.dashcam gives you direct control of the recorder. Most tests don’t need it, because the provision methods and the Vitest hook handle recording for you.
Add logs before you call
start(). If you call stop() yourself, the Vitest hook doesn’t print the link, so log it as shown above.
With dashcam: false, these methods do nothing and stop() resolves to null.
Older tests may use
chrome() from testdriverai/presets to get a dashcam object. Presets are deprecated. Use TestDriver(context) and a provision method instead.Related
- Launch apps: the provision methods that start recording
- Debug a failing test: use the replay to find out why a test failed
- Test result JSON: read the replay URL from a file after the run
- Options: every client option

