Running from VS Code (GUI Mode)
For a visual testing experience, use the Vitest extension:Open Test Explorer
Click the beaker icon in the VS Code sidebar to open the Test Explorer. This shows all your test files and test cases.
Run Tests
Click the play button next to any test file or individual test to run it. You can also:
- Run all tests with the “Run All” button
- Debug tests with the “Debug” button
Running from Terminal
Use Vitest to run your tests from the command line to see full output:Iterating on Tests
When tests fail or need updates, you have two options:Option 1: Ask the MCP Agent (Recommended)
For discovering updated element descriptions or debugging failures, chat with the TestDriver agent:- Start a new session
- Navigate to the page
- Analyze the current state
- Update the test code
- Element text or layout has changed
- You need to see what’s currently on screen
- The failure reason isn’t obvious from the error message
Option 2: Edit the Code Directly
For simple changes, edit the test files directly:- Updating text strings
- Adjusting timeouts
- Fixing typos
Test Configuration
Timeouts
TestDriver tests require longer timeouts than typical unit tests. Yourvitest.config.mjs should have:
vitest.config.mjs
Environment Variables
Tests use theTD_API_KEY environment variable. Set it in your .env file:
.env
Viewing Test Reports
After each test run, TestDriver provides a link to the full test report:- Video recording of the test
- Screenshots at each step
- Network logs and performance metrics
- Console output and errors
View Test Reports
Access all your test runs and recordings in the TestDriver console

