@testdriverai/agent 7.11.229-canary → 7.11.232-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/_data/examples-manifest.json +16 -16
- package/docs/_scripts/generate-examples.js +38 -45
- package/docs/agent.mdx +174 -93
- package/docs/assert.mdx +73 -269
- package/docs/aws-setup.mdx +196 -314
- package/docs/bring-your-own-machine.mdx +139 -206
- package/docs/cache.mdx +144 -151
- package/docs/caching.mdx +99 -89
- package/docs/captcha.mdx +126 -111
- package/docs/ci-cd.mdx +154 -543
- package/docs/click.mdx +74 -229
- package/docs/client.mdx +177 -231
- package/docs/copilot/auto-healing.mdx +86 -370
- package/docs/copilot/running-tests.mdx +121 -930
- package/docs/customizing-devices.mdx +74 -251
- package/docs/dashcam.mdx +72 -405
- package/docs/debugging-with-screenshots.mdx +105 -371
- package/docs/docs.json +79 -22
- package/docs/double-click.mdx +48 -68
- package/docs/errors.mdx +102 -176
- package/docs/events.mdx +170 -327
- package/docs/examples/{hover-text-with-description.mdx → add-to-cart.mdx} +30 -35
- package/docs/examples/assert.mdx +28 -41
- package/docs/examples/click-button.mdx +71 -0
- package/docs/examples/{hover-image.mdx → click-icon.mdx} +32 -28
- package/docs/examples/element-not-found.mdx +27 -26
- package/docs/examples/findall-coffee-icons.mdx +28 -32
- package/docs/examples/installer.mdx +61 -25
- package/docs/examples/launch-vscode-linux.mdx +28 -51
- package/docs/examples/navigate-and-scroll.mdx +82 -0
- package/docs/examples/parse.mdx +24 -28
- package/docs/examples/press-keys.mdx +28 -25
- package/docs/examples/scroll.mdx +25 -27
- package/docs/examples/type.mdx +26 -21
- package/docs/exec.mdx +92 -256
- package/docs/extract.mdx +69 -170
- package/docs/find.mdx +140 -736
- package/docs/focus-application.mdx +69 -246
- package/docs/generating-tests.mdx +103 -137
- package/docs/guide/best-practices-polling.mdx +65 -141
- package/docs/hosted.mdx +80 -144
- package/docs/hover.mdx +62 -235
- package/docs/locating-elements.mdx +74 -369
- package/docs/making-assertions.mdx +116 -74
- package/docs/mcp-setup.mdx +80 -63
- package/docs/mouse-down.mdx +48 -125
- package/docs/mouse-up.mdx +47 -129
- package/docs/options.mdx +75 -48
- package/docs/parse.mdx +95 -184
- package/docs/performing-actions.mdx +104 -94
- package/docs/press-keys.mdx +59 -299
- package/docs/provision.mdx +137 -182
- package/docs/quickstart-claude.mdx +85 -0
- package/docs/quickstart-github.mdx +62 -32
- package/docs/quickstart-manual.mdx +60 -33
- package/docs/quickstart-vscode.mdx +97 -0
- package/docs/quickstart.mdx +26 -9
- package/docs/redraw.mdx +101 -165
- package/docs/reusable-code.mdx +97 -200
- package/docs/right-click.mdx +47 -89
- package/docs/screenshot.mdx +47 -201
- package/docs/screenshots.mdx +87 -137
- package/docs/scroll.mdx +71 -154
- package/docs/secrets.mdx +96 -91
- package/docs/self-hosted.mdx +83 -142
- package/docs/snippets/enterprise.mdx +15 -0
- package/docs/styles.css +68 -0
- package/docs/test-results-json.mdx +167 -204
- package/docs/type.mdx +56 -304
- package/docs/variables.mdx +121 -81
- package/docs/wait.mdx +33 -31
- package/docs/what-is-testdriver.mdx +80 -32
- package/examples/{hover-text-with-description.test.mjs → add-to-cart.test.mjs} +4 -5
- package/examples/assert.test.mjs +3 -20
- package/examples/{hover-text.test.mjs → click-button.test.mjs} +3 -4
- package/examples/{hover-image.test.mjs → click-icon.test.mjs} +5 -6
- package/examples/element-not-found.test.mjs +3 -5
- package/examples/findall-coffee-icons.test.mjs +3 -3
- package/examples/installer.test.mjs +1 -1
- package/examples/launch-vscode-linux.test.mjs +6 -33
- package/examples/{scroll-keyboard.test.mjs → navigate-and-scroll.test.mjs} +4 -5
- package/examples/parse.test.mjs +1 -2
- package/examples/press-keys.test.mjs +4 -4
- package/examples/scroll.test.mjs +3 -6
- package/examples/type.test.mjs +5 -2
- package/lib/provision.js +6 -2
- package/package.json +1 -1
- package/sdk.d.ts +4 -2
- package/sdk.js +1 -1
- package/docs/claude-mcp-plugin.mdx +0 -244
- package/docs/elements.mdx +0 -606
- package/docs/examples/ai.mdx +0 -78
- package/docs/examples/captcha-api.mdx +0 -92
- package/docs/examples/chrome-extension.mdx +0 -156
- package/docs/examples/drag-and-drop.mdx +0 -100
- package/docs/examples/formatted-logging.mdx +0 -74
- package/docs/examples/hover-text.mdx +0 -70
- package/docs/examples/match-image.mdx +0 -97
- package/docs/examples/scroll-keyboard.mdx +0 -80
- package/docs/examples/scroll-until-text.mdx +0 -109
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Using TestDriver with Claude Code (MCP)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
TestDriver ships as a native [Claude Code plugin](https://docs.claude.com/en/docs/claude-code/plugins) that bundles the **TestDriver MCP server**, the **`testdriver` expert sub-agent**, and all **TestDriver skills**. You get everything you need to drive TestDriver from Claude Code with a single install.
|
|
6
|
-
|
|
7
|
-
> The plugin lives inside the `testdriverai` npm package at `ai/.claude-plugin/plugin.json`, and the marketplace entry lives at `.claude-plugin/marketplace.json` in this repo.
|
|
8
|
-
|
|
9
|
-
## 1. Get a TestDriver API key
|
|
10
|
-
|
|
11
|
-
- Visit your team page (e.g. `https://console.testdriver.ai/settings`)
|
|
12
|
-
- Create or copy a **Team API Key** (or User API Key)
|
|
13
|
-
- Export it in your shell so Claude Code can pass it to the MCP server:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
export TD_API_KEY="your_api_key_here"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## 2. Install the plugin in Claude Code
|
|
20
|
-
|
|
21
|
-
From inside Claude Code, add this repo as a plugin marketplace and install the `testdriver` plugin:
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
/plugin marketplace add testdriverai/testdriverai
|
|
25
|
-
/plugin install testdriver@testdriver
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
That registers three things:
|
|
29
|
-
|
|
30
|
-
- **`testdriver` MCP server** — spawned via `npx -p testdriverai testdriverai-mcp`, with `TD_API_KEY` forwarded from your environment.
|
|
31
|
-
- **`testdriver` sub-agent** — the TestDriver expert agent from `ai/agents/testdriver.md`. Invoke it with `@testdriver ...`.
|
|
32
|
-
- **TestDriver skills** — every `ai/skills/testdriver-*` skill, auto-loaded by Claude Code.
|
|
33
|
-
|
|
34
|
-
## 3. Write tests with the agent
|
|
35
|
-
|
|
36
|
-
In a Claude Code session, delegate to the agent:
|
|
37
|
-
|
|
38
|
-
```text
|
|
39
|
-
@testdriver Write a test that signs into https://example.com and adds an item to the cart.
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The agent will use the TestDriver MCP tools (`session_start`, `find`, `click`, `type`, `assert`, …) to interactively build a Vitest test, append generated code to your test file after every action, and run it with `vitest run` until it passes.
|
|
43
|
-
|
|
44
|
-
For the full agent guide, see the [`testdriver` agent definition](https://github.com/testdriverai/testdriverai/blob/main/ai/agents/testdriver.md) and the [MCP workflow skill](https://github.com/testdriverai/testdriverai/blob/main/ai/skills/testdriver-mcp-workflow/SKILL.md).
|
|
45
|
-
|
|
46
|
-
## Manual MCP configuration (no plugin)
|
|
47
|
-
|
|
48
|
-
If you prefer not to use the plugin, you can register the MCP server manually in any MCP-compatible client (Claude Desktop, Cursor, VS Code, …):
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"mcpServers": {
|
|
53
|
-
"testdriver": {
|
|
54
|
-
"command": "npx",
|
|
55
|
-
"args": ["-p", "testdriverai", "testdriverai-mcp"],
|
|
56
|
-
"env": {
|
|
57
|
-
"TD_API_KEY": "${TD_API_KEY}"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
This is the same config the plugin wires up for you — the plugin just bundles it alongside the agent and skills.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Remote (hosted URL) install — no CLI, browser login
|
|
69
|
-
|
|
70
|
-
TestDriver also runs a **hosted MCP server** you can connect to with just a URL. There is no `npx` command and no API key to paste: the server speaks OAuth 2.1, so your client opens a browser, you sign in with TestDriver, and the tools appear. It exposes the **full live tool set** (`session_start`, `find`, `click`, `type`, `assert`, …) plus the read-only data tools, all scoped to your team.
|
|
71
|
-
|
|
72
|
-
Hosted endpoint:
|
|
73
|
-
|
|
74
|
-
```text
|
|
75
|
-
https://mcp.testdriver.ai/mcp
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
The server advertises its authorization server (Auth0) via [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728) protected-resource metadata at:
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
https://mcp.testdriver.ai/.well-known/oauth-protected-resource
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Spec-compliant clients discover and complete the OAuth flow automatically:
|
|
85
|
-
|
|
86
|
-
- **Claude** — add a custom connector pointing at the URL above; Claude runs the browser login for you.
|
|
87
|
-
- **VS Code / Copilot** — add a remote MCP server entry with the URL; VS Code handles the OAuth handshake.
|
|
88
|
-
- **ChatGPT** — add it as a connector by URL.
|
|
89
|
-
- **Any spec-compliant client** — point it at the URL; it will read the metadata, sign you in, and connect.
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"mcpServers": {
|
|
94
|
-
"testdriver": {
|
|
95
|
-
"url": "https://mcp.testdriver.ai/mcp"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Each connection gets its own isolated sandbox, so multiple people (or multiple chats) can run tests at the same time without interfering. The API-key paths above still work for automation and CI.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Observing test runs via HTTP MCP
|
|
106
|
-
|
|
107
|
-
TestDriver also exposes **test results and analytics** over an HTTP MCP endpoint, so Claude Code (or any MCP-compatible client) can inspect your test runs, failures, and filters without provisioning a sandbox.
|
|
108
|
-
|
|
109
|
-
### HTTP MCP endpoint contract
|
|
110
|
-
|
|
111
|
-
The HTTP endpoint lives at:
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
POST /api/v1/mcp
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
It expects the TestDriver API key in the `X-Api-Key` header (or `Authorization: Bearer <key>`).
|
|
118
|
-
|
|
119
|
-
Common request shapes:
|
|
120
|
-
|
|
121
|
-
- **List tools**
|
|
122
|
-
|
|
123
|
-
```json
|
|
124
|
-
{
|
|
125
|
-
"kind": "list_tools"
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
- **Call a tool**
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"kind": "call_tool",
|
|
134
|
-
"tool": "list_test_runs",
|
|
135
|
-
"arguments": {
|
|
136
|
-
"status": "failed",
|
|
137
|
-
"page": 1,
|
|
138
|
-
"limit": 20
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Responses from tool calls follow the MCP content convention:
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"content": [
|
|
148
|
-
{
|
|
149
|
-
"type": "json",
|
|
150
|
-
"json": {
|
|
151
|
-
"testRuns": [],
|
|
152
|
-
"totalCount": 0,
|
|
153
|
-
"hasMore": false
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Available tools
|
|
161
|
-
|
|
162
|
-
The MCP server advertises at least these tools in `list_tools`:
|
|
163
|
-
|
|
164
|
-
- `list_test_runs`
|
|
165
|
-
List recent TestDriver test runs for the current team, with filters and pagination.
|
|
166
|
-
|
|
167
|
-
- `get_test_run_detail`
|
|
168
|
-
Get a single test run and its test cases (including replay IDs / share keys when available).
|
|
169
|
-
|
|
170
|
-
- `list_test_cases`
|
|
171
|
-
List individual test cases for the team with status, duration, error messages, and replay info.
|
|
172
|
-
|
|
173
|
-
- `get_filter_options`
|
|
174
|
-
Get branch, suite, repo, filename, commit, status, platform, and test name options for building queries.
|
|
175
|
-
|
|
176
|
-
### Pointing Claude Code at the HTTP MCP endpoint
|
|
177
|
-
|
|
178
|
-
You can point Claude Code at the HTTP MCP endpoint using a JSON configuration similar to:
|
|
179
|
-
|
|
180
|
-
```json
|
|
181
|
-
{
|
|
182
|
-
"$schema": "https://schema.anthropic.com/mcp/servers.json",
|
|
183
|
-
"mcpServers": {
|
|
184
|
-
"testdriver-cloud": {
|
|
185
|
-
"type": "sse",
|
|
186
|
-
"url": "https://your-api-host.example.com/api/v1/mcp",
|
|
187
|
-
"requestHeaders": {
|
|
188
|
-
"X-Api-Key": "${TD_API_KEY}"
|
|
189
|
-
},
|
|
190
|
-
"description": "Query TestDriver test runs, test cases, and filters for your team using an API key."
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
You can find this exact snippet in the repo at:
|
|
197
|
-
|
|
198
|
-
- `claude-mcp-config.example.json`
|
|
199
|
-
|
|
200
|
-
Replace `https://your-api-host.example.com` with your actual API origin (e.g. `https://api.testdriver.ai` or `http://localhost:1337` in development).
|
|
201
|
-
|
|
202
|
-
### Local development
|
|
203
|
-
|
|
204
|
-
For local development:
|
|
205
|
-
|
|
206
|
-
- Run your API server on `http://localhost:1337`
|
|
207
|
-
- Point `baseUrl` at `http://localhost:1337/api/v1/mcp`
|
|
208
|
-
- Use a local team or user API key in `TD_API_KEY`
|
|
209
|
-
|
|
210
|
-
```json
|
|
211
|
-
{
|
|
212
|
-
"mcpServers": {
|
|
213
|
-
"testdriver-cloud-local": {
|
|
214
|
-
"type": "sse",
|
|
215
|
-
"url": "http://localhost:1337/api/v1/mcp",
|
|
216
|
-
"requestHeaders": {
|
|
217
|
-
"X-Api-Key": "${TD_API_KEY}"
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Skills documentation for Claude
|
|
225
|
-
|
|
226
|
-
Claude Code loads the agent and skills automatically when you install the plugin (see step 2). The underlying sources are:
|
|
227
|
-
|
|
228
|
-
- `ai/agents/testdriver.md` contains the **full TestDriver Agent Guide**
|
|
229
|
-
- `ai/skills/testdriver-*/SKILL.md` provide task-specific skills (MCP workflow, assertions, provisioning, etc.)
|
|
230
|
-
|
|
231
|
-
Use these as the primary reference for:
|
|
232
|
-
|
|
233
|
-
- How to initialize the `TestDriver` SDK in Vitest
|
|
234
|
-
- The MCP workflow for building tests interactively with visual feedback
|
|
235
|
-
- How to find elements, click, type, scroll, assert, and capture screenshots
|
|
236
|
-
|
|
237
|
-
The MCP tools described above are **read-only** helpers for:
|
|
238
|
-
|
|
239
|
-
- Inspecting recent test runs and failures
|
|
240
|
-
- Discovering branches, files, and suites to focus on
|
|
241
|
-
- Pulling detailed test case and replay information into Claude for analysis
|
|
242
|
-
|
|
243
|
-
Use the SDK (`testdriverai`) for **driving tests**, and the HTTP MCP server (`/api/v1/mcp`) for **observing and debugging** them from Claude Code.
|
|
244
|
-
|