testdriver-agent
How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
Generate tests by exploring your app with the AI vision agent
$ npx -y skills add testdriverai/testdriverai --skill testdriver-generating-tests --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testdriver-generating-testsContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate tests by exploring your app with the AI vision agent
name: testdriver:generating-tests description: Generate tests by exploring your app with the AI vision agent
<!-- Generated from generating-tests.mdx. DO NOT EDIT. -->
Start by exploring your app. This is where tests begin: you describe a flow in plain English, and the TestDriver vision agent clicks, types, and reads the screen to figure it out — then writes the test for you. No selectors, no DOM, no brittle locators. Just describe what you want to test and let the agent discover the rest.
There are two ways to explore: chatting interactively with your AI assistant through the TestDriver MCP server, or handing a coding agent our instructions file and prompting it to generate a test.
<Info> Both paths need an MCP-capable AI coding assistant. If you don't have one yet, start with **GitHub Copilot** — there's a [free tier](https://github.com/features/copilot/plans), no credit card required. See [Run → Setup](/copilot/running-tests#setup) for the full install and sign-in walkthrough. </Info>
We recommend starting with [our quickstart](./quickstart), then supplying your coding agent with our agent instructions file.
<Card title="TestDriver Agent Instructions" icon="link" arrow="true" horizontal href="https://github.com/testdriverai/testdriverai/blob/main/ai/agents/testdriver.md?plain=1"> Copy the current version of our agent instructions to provide your coding agent with up-to-date instructions on how to generate TestDriver tests. </Card>
Then, you can prompt your coding agent to generate tests. Here is an example prompt:
Make me a TestDriver test that does the following steps: Navigate to practicetestautomation.com Type username student into Username field Type password Password123 into Password field Push Submit button Verify new page contains expected text 'logged in'
<Info>Explicit commands are preferred for production tests, as they are cheaper, faster, and more reliable.</Info>
With TestDriver's MCP server and your AI assistant (GitHub Copilot, Cursor, or Claude Desktop), you can create tests by chatting with an AI agent. The agent spawns a virtual machine, executes actions, and writes test code for you.
Open your AI assistant's chat. If your project has no other agents configured, the TestDriver agent is used by default. Otherwise, select **testdriver** from the agent dropdown in the chat panel.
Describe what you want to test:
Create a test that logs into my app at https://myapp.com
The agent will: 1. Start a new session and spawn a Linux virtual machine 2. Launch Chrome and navigate to your URL 3. Execute actions based on your instructions 4. Write the test code to a `.test.mjs` file
<Note> The TestDriver agent appears in the agent selection dropdown if you have other agents configured (like `copilot-instructions.md` or other `.agent.md` files). Make sure to select **testdriver** to use TestDriver's MCP tools. </Note>
When the agent starts a session, a **live preview panel** opens in your editor. This lets you:
<Note> The live preview panel requires the TestDriver VS Code extension. Set `TD_PREVIEW=ide` in your MCP configuration to enable it. See the [Run page](/copilot/running-tests) for all device and preview options. </Note>
The recommended workflow for exploring and creating tests:
<Steps> <Step title="Describe Your Test"> Tell the agent what you want to test:
Test the checkout flow on https://shop.example.com
</Step>
<Step title="Watch and Guide"> The agent will start executing. Watch the preview panel and provide guidance if needed:
The login modal appeared. Use test@example.com and password123
</Step>
<Step title="Add Assertions"> Ask the agent to verify specific conditions:
Assert that the order confirmation page is shown with the order number
</Step>
<Step title="Review the Code"> The agent writes test code as it works. Review the generated `.test.mjs` file and make any adjustments. </Step> </Steps>
Here's a complete example of exploring and creating a login test:
You: Create a test for the login flow at https://console.testdriver.ai
Agent: I'll create a test for the login flow. Starting a session...
[Screenshot: Login page loaded]
I can see the login page. Let me find the email input.
[Screenshot: Email input highlighted]
Now I'll type the email and find the password field...
You: Use test@example.com for the email
Agent: Got it. Typing test@example.com...
[Screenshot: Email entered]
Now entering the password and clicking Sign In...
[Screenshot: Dashboard loaded]
✅ Login successful! I've written the test to tests/login.test.mjsThe agent generates standard Vitest test files:
import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";
describe("Login Flow", () => {
it("should log in successfully", async (context) => {
const testdriver = TestDriver(context);
await testdriver.provision.chrome({
url: "https://console.testdriver.ai"
});
const emailInput = await testdriver.find("email input field");
await emailInput.click();
await testdriver.type("test@example.com");
const passwordInput = await testdriver.find("password input field");
await passwordInput.click();
await testdriver.type("password123");
const signInButton = await testdriver.find("Sign In button");
await signInButton.click();
const result = await testdriver.assert("dashboard is visible");
expect(result).toBeTruthy();
});
});Repo: testdriverai/testdriverai
How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
Deploy TestDriver on your AWS infrastructure using CloudFormation
How TestDriver learns your app and caches what it discovers for instant, deterministic replays