@testdriverai/mcp 7.11.136-test → 7.11.138-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.
Files changed (174) hide show
  1. package/ai/skills/testdriver-assert/SKILL.md +5 -5
  2. package/ai/skills/testdriver-caching/SKILL.md +2 -2
  3. package/ai/skills/testdriver-changelog/SKILL.md +186 -0
  4. package/ai/skills/testdriver-claude-mcp-plugin/SKILL.md +208 -0
  5. package/ai/skills/testdriver-click/SKILL.md +13 -13
  6. package/ai/skills/testdriver-client/SKILL.md +1 -1
  7. package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +5 -5
  8. package/ai/skills/testdriver-double-click/SKILL.md +7 -7
  9. package/ai/skills/testdriver-enterprise/SKILL.md +1 -1
  10. package/ai/skills/testdriver-events/SKILL.md +1 -1
  11. package/ai/skills/testdriver-exec/SKILL.md +10 -10
  12. package/ai/skills/testdriver-extract/SKILL.md +6 -6
  13. package/ai/skills/testdriver-find/SKILL.md +61 -61
  14. package/ai/skills/testdriver-focus-application/SKILL.md +6 -6
  15. package/ai/skills/testdriver-generating-tests/SKILL.md +3 -3
  16. package/ai/skills/testdriver-hosted/SKILL.md +3 -3
  17. package/ai/skills/testdriver-hover/SKILL.md +6 -6
  18. package/ai/skills/testdriver-making-assertions/SKILL.md +2 -2
  19. package/ai/skills/testdriver-mouse-down/SKILL.md +9 -9
  20. package/ai/skills/testdriver-mouse-up/SKILL.md +9 -9
  21. package/ai/skills/testdriver-parse/SKILL.md +4 -4
  22. package/ai/skills/testdriver-performing-actions/SKILL.md +4 -4
  23. package/ai/skills/testdriver-press-keys/SKILL.md +5 -5
  24. package/ai/skills/testdriver-quickstart/SKILL.md +51 -54
  25. package/ai/skills/testdriver-redraw/SKILL.md +1 -1
  26. package/ai/skills/testdriver-right-click/SKILL.md +7 -7
  27. package/ai/skills/testdriver-screenshot/SKILL.md +9 -9
  28. package/ai/skills/testdriver-scroll/SKILL.md +13 -13
  29. package/ai/skills/testdriver-self-hosted/SKILL.md +1 -1
  30. package/ai/skills/testdriver-type/SKILL.md +7 -7
  31. package/ai/skills/testdriver-wait/SKILL.md +5 -5
  32. package/ai/skills/testdriver-what-is-testdriver/SKILL.md +11 -11
  33. package/docs/{v7/_drafts → _drafts}/agents.mdx +1 -1
  34. package/docs/{v7/_drafts → _drafts}/best-practices.mdx +4 -4
  35. package/docs/{v7/_drafts → _drafts}/caching-selectors.mdx +3 -3
  36. package/docs/{v7/_drafts → _drafts}/configuration.mdx +4 -4
  37. package/docs/{v7/_drafts → _drafts}/debugging.mdx +4 -4
  38. package/docs/{v7/_drafts → _drafts}/error-handling.mdx +4 -4
  39. package/docs/{v7/_drafts → _drafts}/faq.mdx +7 -7
  40. package/docs/{v7/_drafts → _drafts}/installation.mdx +2 -2
  41. package/docs/{v7/_drafts → _drafts}/migration.mdx +4 -4
  42. package/docs/{v7/_drafts → _drafts}/observable.mdx +3 -3
  43. package/docs/{v7/_drafts → _drafts}/powerful.mdx +4 -4
  44. package/docs/{v7/_drafts → _drafts}/readme.mdx +11 -11
  45. package/docs/{v7/_drafts → _drafts}/reports.mdx +4 -4
  46. package/docs/{v7/_drafts → _drafts}/scalable.mdx +10 -10
  47. package/docs/{v7/_drafts → _drafts}/troubleshooting.mdx +4 -4
  48. package/docs/{v7/_drafts → _drafts}/vitest-plugin.mdx +2 -2
  49. package/docs/{v7/_drafts → _drafts}/vitest.mdx +9 -9
  50. package/docs/_scripts/generate-examples.js +9 -10
  51. package/docs/_scripts/generate-skills.js +4 -4
  52. package/docs/{v7/agent.mdx → agent.mdx} +17 -17
  53. package/docs/{v7/assert.mdx → assert.mdx} +5 -5
  54. package/docs/{v7/aws-setup.mdx → aws-setup.mdx} +6 -6
  55. package/docs/{v7/cache.mdx → cache.mdx} +9 -9
  56. package/docs/{v7/caching.mdx → caching.mdx} +13 -12
  57. package/docs/{v7/captcha.mdx → captcha.mdx} +7 -7
  58. package/docs/changelog.mdx +13 -13
  59. package/docs/{v7/ci-cd.mdx → ci-cd.mdx} +10 -10
  60. package/docs/{v7/click.mdx → click.mdx} +13 -13
  61. package/docs/client.mdx +323 -0
  62. package/docs/{v7/copilot → copilot}/auto-healing.mdx +2 -2
  63. package/docs/{v7/copilot → copilot}/running-tests.mdx +8 -8
  64. package/docs/{v7/customizing-devices.mdx → customizing-devices.mdx} +1 -1
  65. package/docs/{v7/dashcam.mdx → dashcam.mdx} +3 -3
  66. package/docs/{v7/debugging-with-screenshots.mdx → debugging-with-screenshots.mdx} +12 -12
  67. package/docs/docs.json +429 -288
  68. package/docs/{v7/double-click.mdx → double-click.mdx} +7 -7
  69. package/docs/{v7/elements.mdx → elements.mdx} +7 -7
  70. package/docs/{v7/enterprise.mdx → enterprise.mdx} +2 -2
  71. package/docs/{v7/errors.mdx → errors.mdx} +3 -3
  72. package/docs/{v7/events.mdx → events.mdx} +4 -4
  73. package/docs/{v7/exec.mdx → exec.mdx} +10 -10
  74. package/docs/{v7/extract.mdx → extract.mdx} +10 -10
  75. package/docs/{v7/find.mdx → find.mdx} +61 -61
  76. package/docs/{v7/focus-application.mdx → focus-application.mdx} +6 -6
  77. package/docs/{v7/generating-tests.mdx → generating-tests.mdx} +10 -10
  78. package/docs/guide/best-practices-polling.mdx +6 -1
  79. package/docs/{v7/hosted.mdx → hosted.mdx} +7 -7
  80. package/docs/{v7/hover.mdx → hover.mdx} +6 -6
  81. package/docs/interacting-with-your-app.mdx +198 -0
  82. package/docs/locating-elements.mdx +423 -0
  83. package/docs/{v7/making-assertions.mdx → making-assertions.mdx} +7 -7
  84. package/docs/{v7/mouse-down.mdx → mouse-down.mdx} +9 -9
  85. package/docs/{v7/mouse-up.mdx → mouse-up.mdx} +9 -9
  86. package/docs/options.mdx +320 -0
  87. package/docs/{v7/parse.mdx → parse.mdx} +12 -12
  88. package/docs/{v7/performing-actions.mdx → performing-actions.mdx} +11 -11
  89. package/docs/{v7/press-keys.mdx → press-keys.mdx} +5 -5
  90. package/docs/{v7/provision.mdx → provision.mdx} +9 -9
  91. package/docs/quickstart-cli.mdx +437 -0
  92. package/docs/quickstart-github.mdx +54 -0
  93. package/docs/quickstart-manual.mdx +135 -0
  94. package/docs/quickstart.mdx +22 -0
  95. package/docs/{v7/redraw.mdx → redraw.mdx} +7 -7
  96. package/docs/{v7/reusable-code.mdx → reusable-code.mdx} +3 -3
  97. package/docs/{v7/right-click.mdx → right-click.mdx} +7 -7
  98. package/docs/{v7/screenshot.mdx → screenshot.mdx} +9 -9
  99. package/docs/{v7/screenshots.mdx → screenshots.mdx} +3 -3
  100. package/docs/{v7/scroll.mdx → scroll.mdx} +13 -13
  101. package/docs/{v7/secrets.mdx → secrets.mdx} +4 -4
  102. package/docs/{v7/self-hosted.mdx → self-hosted.mdx} +7 -7
  103. package/docs/{v7/test-results-json.mdx → test-results-json.mdx} +4 -4
  104. package/docs/{v7/type.mdx → type.mdx} +7 -7
  105. package/docs/{v7/variables.mdx → variables.mdx} +2 -2
  106. package/docs/{v7/wait.mdx → wait.mdx} +5 -5
  107. package/docs/what-is-testdriver.mdx +54 -0
  108. package/lib/environments.json +1 -1
  109. package/lib/github-comment.mjs +2 -3
  110. package/package.json +1 -1
  111. package/scripts/generate-skills.js +1 -1
  112. package/docs/v7/client.mdx +0 -486
  113. package/docs/v7/quickstart.mdx +0 -451
  114. package/docs/v7/what-is-testdriver.mdx +0 -54
  115. /package/docs/{v7/_drafts → _drafts}/architecture.mdx +0 -0
  116. /package/docs/{v7/_drafts → _drafts}/auto-cache-key.mdx +0 -0
  117. /package/docs/{v7/_drafts → _drafts}/awesome-logs-quick-ref.mdx +0 -0
  118. /package/docs/{v7/_drafts → _drafts}/cli-to-sdk-migration.mdx +0 -0
  119. /package/docs/{v7/_drafts → _drafts}/commands/assert.mdx +0 -0
  120. /package/docs/{v7/_drafts → _drafts}/commands/exec.mdx +0 -0
  121. /package/docs/{v7/_drafts → _drafts}/commands/focus-application.mdx +0 -0
  122. /package/docs/{v7/_drafts → _drafts}/commands/hover-image.mdx +0 -0
  123. /package/docs/{v7/_drafts → _drafts}/commands/hover-text.mdx +0 -0
  124. /package/docs/{v7/_drafts → _drafts}/commands/if.mdx +0 -0
  125. /package/docs/{v7/_drafts → _drafts}/commands/match-image.mdx +0 -0
  126. /package/docs/{v7/_drafts → _drafts}/commands/press-keys.mdx +0 -0
  127. /package/docs/{v7/_drafts → _drafts}/commands/remember.mdx +0 -0
  128. /package/docs/{v7/_drafts → _drafts}/commands/run.mdx +0 -0
  129. /package/docs/{v7/_drafts → _drafts}/commands/scroll-until-image.mdx +0 -0
  130. /package/docs/{v7/_drafts → _drafts}/commands/scroll-until-text.mdx +0 -0
  131. /package/docs/{v7/_drafts → _drafts}/commands/scroll.mdx +0 -0
  132. /package/docs/{v7/_drafts → _drafts}/commands/type.mdx +0 -0
  133. /package/docs/{v7/_drafts → _drafts}/commands/wait-for-image.mdx +0 -0
  134. /package/docs/{v7/_drafts → _drafts}/commands/wait-for-text.mdx +0 -0
  135. /package/docs/{v7/_drafts → _drafts}/commands/wait.mdx +0 -0
  136. /package/docs/{v7/_drafts → _drafts}/contributing.mdx +0 -0
  137. /package/docs/{v7/_drafts → _drafts}/dashcam-title-feature.mdx +0 -0
  138. /package/docs/{v7/_drafts → _drafts}/hooks.mdx +0 -0
  139. /package/docs/{v7/_drafts → _drafts}/init-command.mdx +0 -0
  140. /package/docs/{v7/_drafts → _drafts}/playwright.mdx +0 -0
  141. /package/docs/{v7/_drafts → _drafts}/plugin-migration.mdx +0 -0
  142. /package/docs/{v7/_drafts → _drafts}/presets.mdx +0 -0
  143. /package/docs/{v7/_drafts → _drafts}/progressive-disclosure.mdx +0 -0
  144. /package/docs/{v7/_drafts → _drafts}/provision.mdx +0 -0
  145. /package/docs/{v7/_drafts → _drafts}/quick-start-test-recording.mdx +0 -0
  146. /package/docs/{v7/_drafts → _drafts}/screenshot.mdx +0 -0
  147. /package/docs/{v7/_drafts → _drafts}/sdk-awesome-logs.mdx +0 -0
  148. /package/docs/{v7/_drafts → _drafts}/sdk-browser-rendering.mdx +0 -0
  149. /package/docs/{v7/_drafts → _drafts}/sdk-migration.mdx +0 -0
  150. /package/docs/{v7/_drafts → _drafts}/sdk-v7-complete.mdx +0 -0
  151. /package/docs/{v7/_drafts → _drafts}/self-hosting.mdx +0 -0
  152. /package/docs/{v7/_drafts → _drafts}/test-recording.mdx +0 -0
  153. /package/docs/{v7/_drafts → _drafts}/writing-tests.mdx +0 -0
  154. /package/docs/{v7/examples → examples}/ai.mdx +0 -0
  155. /package/docs/{v7/examples → examples}/assert.mdx +0 -0
  156. /package/docs/{v7/examples → examples}/captcha-api.mdx +0 -0
  157. /package/docs/{v7/examples → examples}/chrome-extension.mdx +0 -0
  158. /package/docs/{v7/examples → examples}/drag-and-drop.mdx +0 -0
  159. /package/docs/{v7/examples → examples}/element-not-found.mdx +0 -0
  160. /package/docs/{v7/examples → examples}/findall-coffee-icons.mdx +0 -0
  161. /package/docs/{v7/examples → examples}/formatted-logging.mdx +0 -0
  162. /package/docs/{v7/examples → examples}/hover-image.mdx +0 -0
  163. /package/docs/{v7/examples → examples}/hover-text-with-description.mdx +0 -0
  164. /package/docs/{v7/examples → examples}/hover-text.mdx +0 -0
  165. /package/docs/{v7/examples → examples}/installer.mdx +0 -0
  166. /package/docs/{v7/examples → examples}/launch-vscode-linux.mdx +0 -0
  167. /package/docs/{v7/examples → examples}/match-image.mdx +0 -0
  168. /package/docs/{v7/examples → examples}/parse.mdx +0 -0
  169. /package/docs/{v7/examples → examples}/press-keys.mdx +0 -0
  170. /package/docs/{v7/examples → examples}/scroll-keyboard.mdx +0 -0
  171. /package/docs/{v7/examples → examples}/scroll-until-text.mdx +0 -0
  172. /package/docs/{v7/examples → examples}/scroll.mdx +0 -0
  173. /package/docs/{v7/examples → examples}/type.mdx +0 -0
  174. /package/docs/{v7/mcp.mdx → mcp.mdx} +0 -0
@@ -0,0 +1,437 @@
1
+ ---
2
+ title: "Configure Your Agent"
3
+ sidebarTitle: "Configure Your Agent"
4
+ description: "Scaffold a project, connect TestDriver to your AI client, and run your first test."
5
+ icon: "bolt"
6
+ ---
7
+
8
+ Use the TestDriver CLI to scaffold a project, connect your AI client, and run the example test. `testdriverai init` installs three things so you can write, run, and debug real end-to-end tests from chat:
9
+
10
+ - **The agent**: an expert test-writer. It controls a live sandbox, writes code after each step, and re-runs the test until it passes.
11
+ - **Skills**: small instruction files that teach the agent the correct syntax for each TestDriver capability (`find`, `click`, `type`, `assert`, and more).
12
+ - **The MCP server**: exposes TestDriver's computer-use tools through the [Model Context Protocol](https://modelcontextprotocol.io) so any MCP client can call them.
13
+
14
+ <Info>
15
+ **Prerequisites**
16
+
17
+ - [Node.js](https://nodejs.org) 20.19 or later
18
+ - A TestDriver account. [Create one for free](https://console.testdriver.ai/settings). You get 60 device minutes, no credit card required.
19
+ </Info>
20
+
21
+ <Steps>
22
+ <Step title="Scaffold a project">
23
+
24
+ Make a new folder (or open an existing project) and run `init`:
25
+
26
+ ```bash
27
+ mkdir my-tests && cd my-tests
28
+ npx testdriverai init
29
+ ```
30
+
31
+ `init` asks two questions:
32
+
33
+ 1. **How to authenticate.** Choose **Login with browser** to sign in and save your key automatically, or paste an API key from [console.testdriver.ai/settings](https://console.testdriver.ai/settings). Either way, it is saved to `.env` as `TD_API_KEY`.
34
+ 2. **Which AI clients to set up.** Pick VS Code, Cursor, Claude Code, and others, or press Enter to skip. `init` detects the clients already present in your project and pre-selects them. You can run `init` again later to add more; it merges the TestDriver entry into your existing config and does not overwrite your other servers.
35
+
36
+ It then installs `vitest` and `testdriverai` and creates these files:
37
+
38
+ | File | Purpose |
39
+ | --- | --- |
40
+ | `tests/example.test.js` | Example test: log in to a demo store and add an item to the cart |
41
+ | `tests/login.js` | Reusable login snippet imported by the example test |
42
+ | `vitest.config.js` | Vitest config with the TestDriver reporter and long timeouts |
43
+ | `.env` | Your `TD_API_KEY` (git-ignored) |
44
+ | `.github/workflows/testdriver.yml` | GitHub Actions workflow that runs your tests on every PR |
45
+ | `.github/agents/`, `.github/skills/` | Agent and skills for the AI clients you selected |
46
+
47
+ <Tip>
48
+ Skip the prompts in CI or scripts with flags:
49
+
50
+ ```bash
51
+ npx testdriverai init --client claude-code # one client
52
+ npx testdriverai init --client claude-code,cursor,vscode # several
53
+ npx testdriverai init --client all # everything
54
+ npx testdriverai init --no-sample-test # no example files
55
+ ```
56
+ </Tip>
57
+
58
+ </Step>
59
+
60
+ <Step title="Connect your AI client">
61
+
62
+ `init` writes the agent, skills, and MCP server config in the format and location each client expects. Here is what it installs and where.
63
+
64
+ #### The agent
65
+
66
+ The **TestDriver agent** runs inside your AI client (Claude Code, Cursor, VS Code, and others). Unlike a chat assistant that only suggests code, it works **iteratively on a live sandbox**: it starts a session, performs each action, writes the code to your test file, confirms the result with a screenshot, and re-runs the test until it passes.
67
+
68
+ | Client | Agent location |
69
+ | --- | --- |
70
+ | Claude Code | `.claude/agents/testdriver.md` |
71
+ | VS Code (Copilot) | `.github/agents/testdriver.agent.md` |
72
+ | Cursor | `.cursor/rules/testdriver.mdc` |
73
+ | Windsurf | `.windsurf/rules/testdriver.md` |
74
+ | Codex | `AGENTS.md` |
75
+ | Zed | `.rules` |
76
+
77
+ #### Skills
78
+
79
+ **Skills** are small instruction files, one per TestDriver capability, in the [Anthropic `SKILL.md` format](https://code.claude.com/docs/en/skills). There are over 100, generated from this documentation, covering every action and concept: `find`, `click`, `type`, `assert`, `check`, `scroll`, `press-keys`, `provision`, caching, secrets, CI/CD, and more.
80
+
81
+ | Client | Skills location |
82
+ | --- | --- |
83
+ | Claude Code | `.claude/skills/<name>/SKILL.md` |
84
+ | Zed | `.agents/skills/<name>/SKILL.md` |
85
+ | Codex | referenced from `AGENTS.md` |
86
+ | VS Code · Cursor · Windsurf | folded into the agent rules/instructions |
87
+
88
+ #### MCP server
89
+
90
+ The **TestDriver MCP server** exposes the computer-use tools (`session_start`, `find`, `click`, `type`, `assert`, `check`, `screenshot`, and more). It runs as a local stdio process and authenticates with your `TD_API_KEY`:
91
+
92
+ ```bash
93
+ npx -p testdriverai testdriverai-mcp
94
+ ```
95
+
96
+ | Client | Auto-install | MCP config file | Config key |
97
+ | --- | --- | --- | --- |
98
+ | Claude Code | ✅ | `.mcp.json` | `mcpServers` |
99
+ | Claude Desktop | ✅ | OS-specific | `mcpServers` |
100
+ | Cursor | ✅ | `.cursor/mcp.json` | `mcpServers` |
101
+ | VS Code (Copilot) | ✅ | `.vscode/mcp.json` | `servers` |
102
+ | Windsurf | ✅ | `~/.codeium/windsurf/mcp_config.json` | `mcpServers` |
103
+ | Codex | ✅ | `~/.codex/config.toml` | `[mcp_servers]` |
104
+ | Zed | ✅ | `.zed/settings.json` | `context_servers` |
105
+ | Lovable | ⚙️ partial | GitHub `AGENTS.md` + UI | — |
106
+ | Replit | ⚙️ partial | `replit.md` + UI | — |
107
+ | v0 (Vercel) | 📝 manual | web UI only | — |
108
+
109
+ <Accordion title="Configure the MCP server by hand">
110
+ <Note>
111
+ Each client uses a **different top-level key** for MCP servers. The most common manual-config mistake is using `mcpServers` for VS Code (which needs `servers`), Codex (TOML `[mcp_servers]`), or Zed (`context_servers`).
112
+ </Note>
113
+
114
+ <Tabs>
115
+ <Tab title="Claude Code">
116
+ Add this to `.mcp.json` at your project root (or `~/.claude.json` for all projects):
117
+
118
+ ```json
119
+ {
120
+ "mcpServers": {
121
+ "testdriver": {
122
+ "type": "stdio",
123
+ "command": "npx",
124
+ "args": ["-p", "testdriverai", "testdriverai-mcp"],
125
+ "env": { "TD_API_KEY": "${TD_API_KEY}" }
126
+ }
127
+ }
128
+ }
129
+ ```
130
+ </Tab>
131
+
132
+ <Tab title="Claude Desktop">
133
+ Edit the Claude Desktop config file:
134
+
135
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
136
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
137
+ - **Linux:** `~/.config/Claude/claude_desktop_config.json`
138
+
139
+ ```json
140
+ {
141
+ "mcpServers": {
142
+ "testdriver": {
143
+ "command": "npx",
144
+ "args": ["-p", "testdriverai", "testdriverai-mcp"],
145
+ "env": { "TD_API_KEY": "your_api_key" }
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ Start Claude Desktop again after you save.
152
+ </Tab>
153
+
154
+ <Tab title="Cursor">
155
+ Add this to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
156
+
157
+ ```json
158
+ {
159
+ "mcpServers": {
160
+ "testdriver": {
161
+ "type": "stdio",
162
+ "command": "npx",
163
+ "args": ["-p", "testdriverai", "testdriverai-mcp"],
164
+ "env": { "TD_API_KEY": "${TD_API_KEY}" }
165
+ }
166
+ }
167
+ }
168
+ ```
169
+ </Tab>
170
+
171
+ <Tab title="VS Code">
172
+ Add this to `.vscode/mcp.json`. VS Code uses the `servers` key and an `inputs` prompt for secrets:
173
+
174
+ ```json
175
+ {
176
+ "servers": {
177
+ "testdriver": {
178
+ "type": "stdio",
179
+ "command": "npx",
180
+ "args": ["-p", "testdriverai", "testdriverai-mcp"],
181
+ "env": { "TD_API_KEY": "${input:testdriver-api-key}" }
182
+ }
183
+ },
184
+ "inputs": [
185
+ {
186
+ "type": "promptString",
187
+ "id": "testdriver-api-key",
188
+ "description": "TestDriver API Key From https://console.testdriver.ai/settings",
189
+ "password": true
190
+ }
191
+ ]
192
+ }
193
+ ```
194
+ </Tab>
195
+
196
+ <Tab title="Windsurf">
197
+ Windsurf reads the MCP config globally. Add this to `~/.codeium/windsurf/mcp_config.json`:
198
+
199
+ ```json
200
+ {
201
+ "mcpServers": {
202
+ "testdriver": {
203
+ "command": "npx",
204
+ "args": ["-p", "testdriverai", "testdriverai-mcp"],
205
+ "env": { "TD_API_KEY": "${TD_API_KEY}" }
206
+ }
207
+ }
208
+ }
209
+ ```
210
+ </Tab>
211
+
212
+ <Tab title="Codex">
213
+ Codex uses TOML. Add this to `~/.codex/config.toml`:
214
+
215
+ ```toml
216
+ [mcp_servers.testdriver]
217
+ command = "npx"
218
+ args = ["-p", "testdriverai", "testdriverai-mcp"]
219
+ env = { TD_API_KEY = "${TD_API_KEY}" }
220
+ ```
221
+ </Tab>
222
+
223
+ <Tab title="Zed">
224
+ Zed calls them "context servers". Add this to `.zed/settings.json` (project) or `~/.config/zed/settings.json` (global):
225
+
226
+ ```json
227
+ {
228
+ "context_servers": {
229
+ "testdriver": {
230
+ "command": "npx",
231
+ "args": ["-p", "testdriverai", "testdriverai-mcp"],
232
+ "env": { "TD_API_KEY": "${TD_API_KEY}" }
233
+ }
234
+ }
235
+ }
236
+ ```
237
+ </Tab>
238
+ </Tabs>
239
+ </Accordion>
240
+
241
+ <Accordion title="Web-based clients (Lovable, Replit, v0)">
242
+ These run in the browser, so they cannot start the MCP server as a local process. Configure them through each product's UI.
243
+
244
+ **Lovable**
245
+
246
+ 1. Connect your GitHub repo, then run `npx testdriverai init --client lovable`. This writes `AGENTS.md` and the skills into the repo so the Lovable agent can use them.
247
+ 2. In Lovable, open **Settings → MCP** and add the TestDriver server.
248
+
249
+ **Replit**
250
+
251
+ 1. Run `npx testdriverai init --client replit` to write `replit.md` with the TestDriver agent guidance.
252
+ 2. In Replit, open **Tools → Integrations → MCP** and add a custom MCP server.
253
+
254
+ **v0 (Vercel)**
255
+
256
+ v0 is UI-only and does not read repo files.
257
+
258
+ 1. Open **[v0.app/chat/settings/mcp-connections](https://v0.app/chat/settings/mcp-connections)** and add the TestDriver MCP connection.
259
+ 2. Paste the agent guidance into **Instructions** (the **+** in the prompt bar).
260
+ </Accordion>
261
+
262
+ #### Verify the install
263
+
264
+ Open your client's chat and ask the agent to write a test:
265
+
266
+ ```text
267
+ @testdriver write a test that opens the homepage and asserts the title
268
+ ```
269
+
270
+ If the MCP server is connected, the agent starts a sandbox session and you see screenshots as it works. It writes the steps into a test file in `tests/` and runs it for you. If the tools do not appear, confirm that `TD_API_KEY` is set and restart the client.
271
+
272
+ </Step>
273
+
274
+ <Step title="Run the example test">
275
+
276
+ TestDriver tests are plain [Vitest](https://vitest.dev) tests. Run them with:
277
+
278
+ ```bash
279
+ npm test
280
+ ```
281
+
282
+ Here is what happens:
283
+
284
+ 1. A cloud sandbox starts and opens Chrome at the demo app.
285
+ 2. A live preview of the sandbox opens in your browser so you can watch.
286
+ 3. The test finds the login form, types credentials, adds an item to the cart, and asserts the cart has an item.
287
+ 4. The sandbox is torn down and results are uploaded.
288
+
289
+ At the end of the output, look for the run link:
290
+
291
+ ```text
292
+ TESTDRIVER_RUN_URL=https://console.testdriver.ai/runs/...
293
+ ```
294
+
295
+ Open it to see the video recording, screenshots, and logs for each step.
296
+
297
+ <Note>
298
+ The first run takes a minute or two while the sandbox boots. Later runs are faster because element locations are [cached](/caching).
299
+ </Note>
300
+
301
+ </Step>
302
+
303
+ <Step title="Read the example test">
304
+
305
+ Open `tests/example.test.js`. Every TestDriver test follows the same shape: create an instance, provision an app, then find, act, and assert in natural language.
306
+
307
+ ```js tests/example.test.js
308
+ import { test, expect } from 'vitest';
309
+ import { TestDriver } from 'testdriverai/vitest/hooks';
310
+ import { login } from './login.js';
311
+
312
+ test('should login and add item to cart', async (context) => {
313
+ // Connects to a sandbox and records the session
314
+ const testdriver = TestDriver(context);
315
+
316
+ // Launch Chrome at the app under test
317
+ await testdriver.provision.chrome({
318
+ url: 'http://testdriver-sandbox.vercel.app/login',
319
+ });
320
+
321
+ // Reusable step from tests/login.js
322
+ await login(testdriver);
323
+
324
+ // Describe elements in plain English
325
+ const addToCart = await testdriver.find('add to cart button under TestDriver Hat');
326
+ await addToCart.click();
327
+
328
+ const cart = await testdriver.find('cart button in the top right corner');
329
+ await cart.click();
330
+
331
+ // Assert with natural language, then use Vitest's expect
332
+ const result = await testdriver.assert('There is an item in the cart');
333
+ expect(result).toBeTruthy();
334
+ });
335
+ ```
336
+
337
+ The pieces you will use most:
338
+
339
+ - [`provision.chrome()`](/provision) starts a browser (or a desktop app) in the sandbox
340
+ - [`find()`](/find) locates an element by description; then call `.click()`, `.hover()`, and so on
341
+ - [`type()`](/type) and [`pressKeys()`](/press-keys) send keyboard input
342
+ - [`assert()`](/assert) asks a yes/no question about the screen
343
+
344
+ </Step>
345
+
346
+ <Step title="Write your own test">
347
+
348
+ The fastest way is to ask the agent:
349
+
350
+ ```text
351
+ @testdriver write a test that searches duckduckgo.com for "testdriver.ai" and verifies results appear
352
+ ```
353
+
354
+ Or write it by hand. Create `tests/search.test.js` and point it at a site you want to test:
355
+
356
+ ```js tests/search.test.js
357
+ import { test, expect } from 'vitest';
358
+ import { TestDriver } from 'testdriverai/vitest/hooks';
359
+
360
+ test('search shows results', async (context) => {
361
+ const testdriver = TestDriver(context);
362
+
363
+ await testdriver.provision.chrome({ url: 'https://duckduckgo.com' });
364
+
365
+ const searchBox = await testdriver.find('search input field');
366
+ await searchBox.click();
367
+ await testdriver.type('testdriver.ai');
368
+ await testdriver.pressKeys(['enter']);
369
+
370
+ const result = await testdriver.assert('search results are displayed');
371
+ expect(result).toBeTruthy();
372
+ });
373
+ ```
374
+
375
+ Run just that file:
376
+
377
+ ```bash
378
+ npx vitest run tests/search.test.js
379
+ ```
380
+
381
+ <Tip>
382
+ Not sure how to describe an element? Say what a person sees: `"blue Sign In button in the header"` works better than `"button"`. See [Locating elements](/locating-elements).
383
+ </Tip>
384
+
385
+ </Step>
386
+
387
+ <Step title="Run in CI">
388
+
389
+ `init` already created `.github/workflows/testdriver.yml`. Push your project to GitHub, then add `TD_API_KEY` as a repository secret (**Settings → Secrets and variables → Actions**). Your tests now run on every pull request.
390
+
391
+ See [CI/CD](/ci-cd) for other providers and for keyless auth with the TestDriver GitHub App.
392
+
393
+ </Step>
394
+ </Steps>
395
+
396
+ ## Troubleshooting
397
+
398
+ <AccordionGroup>
399
+ <Accordion title="TD_API_KEY is not configured">
400
+ The SDK reads `TD_API_KEY` from `.env` in the folder where you run `vitest`. Make sure the file exists and has this line:
401
+
402
+ ```bash .env
403
+ TD_API_KEY=your_api_key
404
+ ```
405
+
406
+ You can also export it in your shell: `export TD_API_KEY=your_api_key`.
407
+ </Accordion>
408
+
409
+ <Accordion title="The agent or MCP tools do not appear in my client">
410
+ Confirm `TD_API_KEY` is set, check that the MCP config uses the correct top-level key for your client (see the table above), and restart the client. Running `npx testdriverai init --client <name>` again rewrites the config in the correct format.
411
+ </Accordion>
412
+
413
+ <Accordion title="No test files found">
414
+ Vitest only picks up files that match `*.test.js`, `*.test.mjs`, or `*.spec.*`. Check the file name and that the file is inside your project folder.
415
+ </Accordion>
416
+
417
+ <Accordion title="Test times out">
418
+ Sandbox provisioning and teardown take time. `init` sets `testTimeout` and `hookTimeout` to 5 minutes in `vitest.config.js`. If you wrote the config by hand, add both values.
419
+ </Accordion>
420
+ </AccordionGroup>
421
+
422
+ ## Next steps
423
+
424
+ <CardGroup cols={2}>
425
+ <Card title="Generating tests" icon="wand-magic-sparkles" href="/generating-tests" arrow horizontal>
426
+ Prompting patterns that get the best tests out of the agent.
427
+ </Card>
428
+ <Card title="Walkthrough" icon="map" href="/provision" arrow horizontal>
429
+ Provision apps, locate elements, perform actions, and make assertions.
430
+ </Card>
431
+ <Card title="Reusable code" icon="recycle" href="/reusable-code" arrow horizontal>
432
+ Share login flows and other steps across tests.
433
+ </Card>
434
+ <Card title="Secrets" icon="key" href="/secrets" arrow horizontal>
435
+ Keep passwords and tokens out of logs and recordings.
436
+ </Card>
437
+ </CardGroup>
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: "Add TestDriver to GitHub"
3
+ sidebarTitle: "Add to GitHub"
4
+ description: "Drop-in UI tests for any GitHub repository."
5
+ icon: "github"
6
+ ---
7
+
8
+ Drop-in UI tests for any GitHub repository. Mention `@testdriverai` in a pull request or issue and it writes, runs, and commits UI tests, then catches regressions before they merge. No local install required.
9
+
10
+ <Card
11
+ title="Add to GitHub"
12
+ icon="github"
13
+ href="https://go.testdriver.ai/github"
14
+ arrow
15
+ horizontal
16
+ >
17
+ Install the TestDriver GitHub App and start testing in minutes.
18
+ </Card>
19
+
20
+ <Steps>
21
+ <Step title="Install the GitHub App">
22
+ Click **Add to GitHub** above and choose the repositories you want to test. You can add more repositories later from your GitHub organization settings.
23
+ </Step>
24
+
25
+ <Step title="Mention @testdriverai">
26
+ Open a pull request or an issue and describe the test you want in a comment:
27
+
28
+ ```text
29
+ @testdriverai Write a test that verifies the homepage loads and the signup button works.
30
+ ```
31
+
32
+ TestDriver replies in the thread, starts a sandbox, writes the test, runs it, and posts the result with a link to the recording. It then opens a pull request that adds the test file to your repository.
33
+
34
+ <Tip>
35
+ Describe what a user does and what they should see, not implementation details. "Log in, add the first product to the cart, and confirm the cart badge shows 1" gives better results than "click `#add-btn`".
36
+ </Tip>
37
+ </Step>
38
+
39
+ <Step title="Catch regressions automatically">
40
+ Once tests are committed, TestDriver runs them on every pull request that changes something a user would see and posts a review with what it observed, including a recording. Mention `@testdriverai` on any PR to ask follow-up questions or request more tests.
41
+ </Step>
42
+ </Steps>
43
+
44
+ Want to use TestDriver from GitHub Copilot or the GitHub Mobile app? Read the full GitHub guide:
45
+
46
+ <Card
47
+ title="GitHub Integration Guide"
48
+ icon="arrow-right"
49
+ href="/copilot/auto-healing#use-testdriver-in-github"
50
+ arrow
51
+ horizontal
52
+ >
53
+ Use TestDriver from GitHub web, Copilot chat, PR reviews, and mobile.
54
+ </Card>
@@ -0,0 +1,135 @@
1
+ ---
2
+ title: "Manual"
3
+ sidebarTitle: "Setting up your workspace"
4
+ description: "Add TestDriver to an existing project by hand."
5
+ icon: "wrench"
6
+ ---
7
+
8
+ Add TestDriver to an existing project without the `init` scaffold. This is useful when you already have a Vitest setup or want full control over each file.
9
+
10
+ <Tip>
11
+ If you are starting from scratch, the [CLI quickstart](/quickstart-cli) does all of this for you with one command.
12
+ </Tip>
13
+
14
+ <Steps>
15
+ <Step title="Get an API key">
16
+
17
+ <Card
18
+ title="Get an API Key"
19
+ icon="user-plus"
20
+ href="https://console.testdriver.ai/settings"
21
+ arrow
22
+ horizontal
23
+ >
24
+ Start with 60 free device minutes, no credit card required.
25
+ </Card>
26
+
27
+ Save the key in a `.env` file at your project root. The SDK loads it automatically:
28
+
29
+ ```bash .env
30
+ TD_API_KEY=your_api_key
31
+ ```
32
+
33
+ Add `.env` to `.gitignore` so the key is not committed.
34
+
35
+ </Step>
36
+ <Step title="Install dependencies">
37
+
38
+ Install Vitest and TestDriver as dev dependencies:
39
+
40
+ ```bash
41
+ npm install --save-dev vitest testdriverai
42
+ ```
43
+
44
+ <Note>
45
+ TestDriver requires Node.js 20.19 or later and only runs on [Vitest](https://vitest.dev). Jest, Mocha, and other runners are not supported.
46
+ </Note>
47
+
48
+ </Step>
49
+ <Step title="Configure Vitest">
50
+
51
+ Create `vitest.config.js` at your project root (or add these settings to an existing one):
52
+
53
+ ```js vitest.config.js
54
+ import { defineConfig } from 'vitest/config';
55
+ import TestDriver from 'testdriverai/vitest';
56
+
57
+ export default defineConfig({
58
+ test: {
59
+ // Sandboxes take time to boot and tear down. Both values are required.
60
+ testTimeout: 300000,
61
+ hookTimeout: 300000,
62
+ reporters: ['default', TestDriver()],
63
+ setupFiles: ['testdriverai/vitest/setup'],
64
+ },
65
+ });
66
+ ```
67
+
68
+ - `TestDriver()` reporter uploads results, recordings, and screenshots to the console.
69
+ - `setupFiles` registers the hooks that connect each test to a sandbox and clean it up.
70
+ - Without `hookTimeout`, cleanup fails at Vitest's default 10-second limit.
71
+
72
+ </Step>
73
+ <Step title="Write a test">
74
+
75
+ Create `tests/search.test.js`:
76
+
77
+ ```js tests/search.test.js
78
+ import { test, expect } from 'vitest';
79
+ import { TestDriver } from 'testdriverai/vitest/hooks';
80
+
81
+ test('search shows results', async (context) => {
82
+ // Connects to a sandbox and records the session
83
+ const testdriver = TestDriver(context);
84
+
85
+ // Launch Chrome at a URL
86
+ await testdriver.provision.chrome({ url: 'https://duckduckgo.com' });
87
+
88
+ // Locate elements by describing them
89
+ const searchBox = await testdriver.find('search input field');
90
+ await searchBox.click();
91
+
92
+ // Type into the focused element and submit
93
+ await testdriver.type('testdriver.ai');
94
+ await testdriver.pressKeys(['enter']);
95
+
96
+ // Ask a yes/no question about the screen
97
+ const result = await testdriver.assert('search results are displayed');
98
+ expect(result).toBeTruthy();
99
+ });
100
+ ```
101
+
102
+ If your project does not have `"type": "module"` in `package.json`, name the file `search.test.mjs` instead.
103
+
104
+ </Step>
105
+ <Step title="Run the test">
106
+
107
+ ```bash
108
+ npx vitest run
109
+ ```
110
+
111
+ A sandbox starts, Chrome opens, and a live preview appears in your browser. When the run finishes, open the `TESTDRIVER_RUN_URL` printed at the end of the output to see the recording and step-by-step screenshots.
112
+
113
+ </Step>
114
+ </Steps>
115
+
116
+ ## Optional: AI client setup
117
+
118
+ If you want to write tests with an AI assistant, connect the TestDriver agent and MCP server. You can do this without re-scaffolding the project:
119
+
120
+ ```bash
121
+ npx testdriverai init --client cursor,claude-code,vscode --no-sample-test
122
+ ```
123
+
124
+ See [Configure Your Agent](/quickstart-cli#connect-your-ai-client) for the manual configuration of each client.
125
+
126
+ ## Next steps
127
+
128
+ <CardGroup cols={2}>
129
+ <Card title="Walkthrough" icon="map" href="/provision" arrow horizontal>
130
+ Provision apps, locate elements, perform actions, and make assertions.
131
+ </Card>
132
+ <Card title="CI/CD" icon="github" href="/ci-cd" arrow horizontal>
133
+ Run tests on every pull request with GitHub Actions or another provider.
134
+ </Card>
135
+ </CardGroup>
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: "Quick Start"
3
+ sidebarTitle: "Quickstart"
4
+ description: "Run your first computer-use test in minutes."
5
+ icon: "rocket"
6
+ ---
7
+
8
+ TestDriver writes and runs computer-use tests for web apps, desktop apps, and browser extensions. Tests describe what a user sees and does in plain English, and run on real machines in the cloud. Pick the path that fits how you work:
9
+
10
+ <CardGroup cols={2}>
11
+ <Card title="Add to GitHub" icon="github" href="/quickstart-github" arrow horizontal>
12
+ No install. Mention `@testdriverai` in a PR or issue and it writes, runs, and commits tests for you.
13
+ </Card>
14
+ <Card title="Configure Your Agent" icon="terminal" href="/quickstart-cli" arrow horizontal>
15
+ One command scaffolds a project and connects the TestDriver agent and MCP server to Cursor, Claude Code, VS Code, and more.
16
+ </Card>
17
+ <Card title="Manual" icon="wrench" href="/quickstart-manual" arrow horizontal>
18
+ Add TestDriver to an existing Vitest project file by file.
19
+ </Card>
20
+ </CardGroup>
21
+
22
+ <Tip><a href="https://discord.com/invite/cWDFW8DzPm" target="_blank" rel="noreferrer">Join our Discord</a> if you have questions or get stuck.</Tip>
@@ -8,20 +8,20 @@ mode: "wide"
8
8
 
9
9
  ## Overview
10
10
 
11
- The redraw system waits for the screen to stabilize after an interaction before continuing. It detects when animations, page loads, and network requests have settled, preventing actions from being performed on a changing screen.
11
+ The redraw system waits for the screen to become stable after an interaction. Then it continues. It finds when animations, page loads, and network requests are complete. This stops actions on a screen that changes.
12
12
 
13
13
  <Note>
14
- **Redraw is disabled by default since v7.3.** Enable it explicitly if your tests interact with applications that have significant animations or loading states.
14
+ **Redraw is disabled by default from v7.3.** Enable it if your tests interact with applications that have many animations or load states.
15
15
  </Note>
16
16
 
17
17
  ## How It Works
18
18
 
19
- Redraw uses a **two-phase detection** approach:
19
+ Redraw uses a **two-phase detection** method:
20
20
 
21
- 1. **Change Detection** Compare the current frame to the initial screenshot taken right after the action. If the pixel diff exceeds 0.1%, the screen has changed.
22
- 2. **Stability Detection** — Compare consecutive frames using z-score analysis. When the diff between frames drops below 0.1% or the z-score is negative (current diff is below average), the screen has settled.
21
+ 1. **Change Detection**. TestDriver compares the present frame to the first screenshot from after the action. If the pixel diff is more than 0.1%, the screen changed.
22
+ 2. **Stability Detection** — TestDriver compares frames that come after each other with z-score analysis. When the diff between frames is less than 0.1%, or the z-score is negative (the present diff is less than the average), the screen is complete.
23
23
 
24
- The screen is considered **settled** when both phases complete: the screen changed from the initial state AND consecutive frames are now stable.
24
+ The screen is **complete** when both phases finish: the screen changed from the first state AND the frames that come after each other are now stable.
25
25
 
26
26
  ```mermaid
27
27
  flowchart TD
@@ -134,7 +134,7 @@ The final settling condition requires **both** screen AND network to be settled
134
134
 
135
135
  ## Events
136
136
 
137
- The redraw system emits events through the SDK emitter. See [Events](/v7/events) for the full event reference.
137
+ The redraw system emits events through the SDK emitter. See [Events](/events) for the full event reference.
138
138
 
139
139
  | Event | Description |
140
140
  |---|---|