@testdriverai/mcp 7.10.0-canary.0 → 7.10.1-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 (196) hide show
  1. package/.claude-plugin/marketplace.json +17 -0
  2. package/agent/index.js +116 -71
  3. package/agent/interface.js +13 -1
  4. package/agent/lib/commands.js +35 -15
  5. package/agent/lib/provision-commands.js +92 -11
  6. package/agent/lib/sandbox.js +263 -30
  7. package/agent/lib/sdk.js +16 -12
  8. package/agent/lib/system.js +107 -31
  9. package/ai/.claude-plugin/plugin.json +89 -4
  10. package/ai/agents/testdriver.md +4 -8
  11. package/ai/skills/testdriver-assert/SKILL.md +0 -1
  12. package/ai/skills/testdriver-aws-setup/SKILL.md +1 -1
  13. package/ai/skills/testdriver-caching/SKILL.md +13 -6
  14. package/ai/skills/testdriver-ci-cd/SKILL.md +57 -14
  15. package/ai/skills/testdriver-client/SKILL.md +10 -6
  16. package/ai/skills/testdriver-customizing-devices/SKILL.md +7 -5
  17. package/ai/skills/testdriver-dashcam/SKILL.md +36 -3
  18. package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +28 -4
  19. package/ai/skills/testdriver-device-config/SKILL.md +5 -5
  20. package/ai/skills/testdriver-find/SKILL.md +50 -11
  21. package/ai/skills/testdriver-generating-tests/SKILL.md +163 -8
  22. package/ai/skills/testdriver-hosted/SKILL.md +1 -1
  23. package/ai/skills/testdriver-machine-setup/SKILL.md +331 -0
  24. package/ai/skills/testdriver-making-assertions/SKILL.md +78 -2
  25. package/ai/skills/testdriver-mcp-workflow/SKILL.md +2 -2
  26. package/ai/skills/testdriver-parse/SKILL.md +1 -1
  27. package/ai/skills/testdriver-performing-actions/SKILL.md +97 -3
  28. package/ai/skills/testdriver-provision/SKILL.md +0 -20
  29. package/ai/skills/testdriver-quickstart/SKILL.md +299 -21
  30. package/ai/skills/testdriver-reusable-code/SKILL.md +3 -3
  31. package/ai/skills/testdriver-running-tests/SKILL.md +1 -1
  32. package/ai/skills/testdriver-screenshot/SKILL.md +5 -5
  33. package/ai/skills/testdriver-scroll/SKILL.md +30 -160
  34. package/ai/skills/testdriver-test-writer/SKILL.md +3 -5
  35. package/ai/skills/testdriver-testdriver/SKILL.md +3 -7
  36. package/ai/skills/testdriver-wait/SKILL.md +1 -1
  37. package/{docs/v7/ai.mdx → ai/skills/testdriver:ai/SKILL.md} +3 -4
  38. package/ai/skills/testdriver:assert/SKILL.md +315 -0
  39. package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
  40. package/ai/skills/testdriver:cache/SKILL.md +221 -0
  41. package/ai/skills/testdriver:caching/SKILL.md +124 -0
  42. package/ai/skills/testdriver:captcha/SKILL.md +158 -0
  43. package/ai/skills/testdriver:ci-cd/SKILL.md +659 -0
  44. package/ai/skills/testdriver:click/SKILL.md +286 -0
  45. package/ai/skills/testdriver:client/SKILL.md +477 -0
  46. package/ai/skills/testdriver:customizing-devices/SKILL.md +319 -0
  47. package/ai/skills/testdriver:dashcam/SKILL.md +451 -0
  48. package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +415 -0
  49. package/{docs/v7/device-config.mdx → ai/skills/testdriver:device-config/SKILL.md} +8 -8
  50. package/ai/skills/testdriver:double-click/SKILL.md +102 -0
  51. package/ai/skills/testdriver:elements/SKILL.md +605 -0
  52. package/ai/skills/testdriver:enterprise/SKILL.md +7 -0
  53. package/ai/skills/testdriver:errors/SKILL.md +246 -0
  54. package/ai/skills/testdriver:events/SKILL.md +356 -0
  55. package/ai/skills/testdriver:exec/SKILL.md +317 -0
  56. package/ai/skills/testdriver:find/SKILL.md +860 -0
  57. package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
  58. package/ai/skills/testdriver:generating-tests/SKILL.md +25 -0
  59. package/ai/skills/testdriver:hosted/SKILL.md +156 -0
  60. package/ai/skills/testdriver:hover/SKILL.md +278 -0
  61. package/{docs/v7/locating-elements.mdx → ai/skills/testdriver:locating-elements/SKILL.md} +3 -3
  62. package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
  63. package/ai/skills/testdriver:mcp/SKILL.md +7 -0
  64. package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
  65. package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
  66. package/ai/skills/testdriver:parse/SKILL.md +236 -0
  67. package/ai/skills/testdriver:performing-actions/SKILL.md +53 -0
  68. package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
  69. package/ai/skills/testdriver:provision/SKILL.md +331 -0
  70. package/ai/skills/testdriver:quickstart/SKILL.md +172 -0
  71. package/ai/skills/testdriver:redraw/SKILL.md +214 -0
  72. package/ai/skills/testdriver:reusable-code/SKILL.md +249 -0
  73. package/ai/skills/testdriver:right-click/SKILL.md +123 -0
  74. package/{docs/v7/running-tests.mdx → ai/skills/testdriver:running-tests/SKILL.md} +4 -4
  75. package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
  76. package/ai/skills/testdriver:screenshots/SKILL.md +184 -0
  77. package/ai/skills/testdriver:scroll/SKILL.md +205 -0
  78. package/ai/skills/testdriver:secrets/SKILL.md +115 -0
  79. package/ai/skills/testdriver:self-hosted/SKILL.md +147 -0
  80. package/ai/skills/testdriver:test-results-json/SKILL.md +257 -0
  81. package/ai/skills/testdriver:testdriver/SKILL.md +624 -0
  82. package/ai/skills/testdriver:type/SKILL.md +357 -0
  83. package/ai/skills/testdriver:variables/SKILL.md +111 -0
  84. package/ai/skills/testdriver:wait/SKILL.md +50 -0
  85. package/{docs/v7/waiting-for-elements.mdx → ai/skills/testdriver:waiting-for-elements/SKILL.md} +3 -3
  86. package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  87. package/debugger/index.html +12 -0
  88. package/docs/_data/examples-manifest.json +54 -46
  89. package/docs/_data/examples-manifest.schema.json +12 -2
  90. package/docs/_scripts/extract-example-urls.js +21 -3
  91. package/docs/_scripts/generate-examples.js +64 -16
  92. package/docs/changelog.mdx +29 -2
  93. package/docs/claude-mcp-plugin.mdx +65 -18
  94. package/docs/docs.json +16 -33
  95. package/docs/snippets/tests/scroll-yaml.mdx +2 -2
  96. package/docs/v6/commands/scroll-until-image.mdx +1 -1
  97. package/docs/v6/commands/scroll-until-text.mdx +2 -2
  98. package/docs/v6/commands/scroll.mdx +2 -2
  99. package/docs/v7/_drafts/agents.mdx +0 -4
  100. package/docs/v7/_drafts/best-practices.mdx +0 -12
  101. package/docs/v7/_drafts/commands/scroll-until-image.mdx +1 -1
  102. package/docs/v7/_drafts/commands/scroll-until-text.mdx +2 -2
  103. package/docs/v7/_drafts/commands/scroll.mdx +1 -1
  104. package/docs/v7/_drafts/configuration.mdx +0 -12
  105. package/docs/v7/_drafts/faq.mdx +2 -10
  106. package/docs/v7/_drafts/readme.mdx +0 -1
  107. package/docs/v7/_drafts/troubleshooting.mdx +1 -4
  108. package/docs/v7/assert.mdx +0 -1
  109. package/docs/v7/aws-setup.mdx +1 -1
  110. package/docs/v7/caching.mdx +14 -10
  111. package/docs/v7/ci-cd.mdx +98 -14
  112. package/docs/v7/client.mdx +10 -6
  113. package/docs/v7/copilot/auto-healing.mdx +167 -18
  114. package/docs/v7/copilot/running-tests.mdx +915 -54
  115. package/docs/v7/customizing-devices.mdx +7 -5
  116. package/docs/v7/dashcam.mdx +36 -3
  117. package/docs/v7/debugging-with-screenshots.mdx +31 -7
  118. package/docs/v7/examples/ai.mdx +13 -8
  119. package/docs/v7/examples/assert.mdx +1 -1
  120. package/docs/v7/examples/chrome-extension.mdx +30 -13
  121. package/docs/v7/examples/element-not-found.mdx +1 -1
  122. package/docs/v7/examples/findall-coffee-icons.mdx +3 -2
  123. package/docs/v7/examples/formatted-logging.mdx +74 -0
  124. package/docs/v7/examples/hover-image.mdx +1 -1
  125. package/docs/v7/examples/hover-text-with-description.mdx +2 -2
  126. package/docs/v7/examples/hover-text.mdx +1 -1
  127. package/docs/v7/examples/installer.mdx +1 -1
  128. package/docs/v7/examples/launch-vscode-linux.mdx +27 -27
  129. package/docs/v7/examples/match-image.mdx +1 -1
  130. package/docs/v7/examples/parse.mdx +3 -2
  131. package/docs/v7/examples/press-keys.mdx +2 -2
  132. package/docs/v7/examples/scroll-keyboard.mdx +2 -2
  133. package/docs/v7/examples/scroll-until-text.mdx +1 -1
  134. package/docs/v7/examples/scroll.mdx +1 -1
  135. package/docs/v7/examples/type.mdx +1 -1
  136. package/docs/v7/find.mdx +50 -11
  137. package/docs/v7/generating-tests.mdx +166 -10
  138. package/docs/v7/hosted.mdx +1 -1
  139. package/docs/v7/making-assertions.mdx +81 -4
  140. package/docs/v7/parse.mdx +1 -1
  141. package/docs/v7/performing-actions.mdx +100 -5
  142. package/docs/v7/provision.mdx +0 -20
  143. package/docs/v7/quickstart.mdx +299 -21
  144. package/docs/v7/reusable-code.mdx +3 -3
  145. package/docs/v7/screenshot.mdx +5 -5
  146. package/docs/v7/scroll.mdx +30 -160
  147. package/docs/v7/wait.mdx +1 -1
  148. package/examples/chrome-extension.test.mjs +29 -12
  149. package/examples/config.mjs +1 -1
  150. package/examples/launch-vscode-linux.test.mjs +25 -25
  151. package/interfaces/cli/commands/init.js +84 -2
  152. package/interfaces/vitest-plugin.mjs +51 -61
  153. package/lib/core/Dashcam.js +43 -2
  154. package/lib/core/index.d.ts +13 -1
  155. package/lib/github-comment.mjs +11 -5
  156. package/lib/init-project.js +98 -44
  157. package/lib/install-clients.js +470 -0
  158. package/lib/provision.js +749 -0
  159. package/lib/resolve-channel.js +2 -2
  160. package/lib/sentry.js +15 -2
  161. package/lib/vitest/hooks.mjs +44 -34
  162. package/mcp-server/README.md +32 -0
  163. package/mcp-server/dist/core/actions.d.ts +176 -0
  164. package/mcp-server/dist/core/actions.js +753 -0
  165. package/mcp-server/dist/env-utils.d.ts +45 -0
  166. package/mcp-server/dist/env-utils.js +63 -0
  167. package/mcp-server/dist/provision-types.d.ts +6 -2
  168. package/mcp-server/dist/provision-types.js +3 -1
  169. package/mcp-server/dist/server.mjs +449 -751
  170. package/mcp-server/package-lock.json +384 -1
  171. package/mcp-server/package.json +5 -2
  172. package/mcp-server/src/core/actions.ts +912 -0
  173. package/mcp-server/src/env-utils.test.ts +82 -0
  174. package/mcp-server/src/env-utils.ts +77 -0
  175. package/mcp-server/src/provision-types.ts +4 -1
  176. package/mcp-server/src/server.ts +533 -954
  177. package/mcp-server/tsconfig.json +1 -1
  178. package/mcp-server/vitest.config.ts +7 -0
  179. package/package.json +15 -3
  180. package/sdk.d.ts +11 -9
  181. package/sdk.js +116 -746
  182. package/setup/aws/spawn-runner.sh +24 -3
  183. package/docs/v7/_drafts/caching-ai.mdx +0 -215
  184. package/docs/v7/_drafts/caching.mdx +0 -366
  185. package/docs/v7/_drafts/prompt-cache.mdx +0 -200
  186. package/docs/v7/copilot/creating-tests.mdx +0 -156
  187. package/docs/v7/copilot/github.mdx +0 -143
  188. package/docs/v7/copilot/setup.mdx +0 -143
  189. package/docs/v7/examples/exec-output.mdx +0 -84
  190. package/docs/v7/examples/exec-pwsh.mdx +0 -82
  191. package/docs/v7/examples/focus-window.mdx +0 -61
  192. package/docs/v7/examples/scroll-until-image.mdx +0 -82
  193. package/docs/v7/examples/windows-installer.mdx +0 -95
  194. package/examples/formatted-logging.test.mjs +0 -27
  195. package/examples/match-image.test.mjs +0 -55
  196. package/manual/exec-stream-logs.test.mjs +0 -25
@@ -1,23 +1,168 @@
1
1
  ---
2
- title: "Auto-Healing Tests"
3
- sidebarTitle: "Auto-Healing"
4
- description: "Set up automatic test repair in CI using GitHub Copilot and TestDriver"
5
- icon: "bandage"
2
+ title: "Prevent"
3
+ sidebarTitle: "Prevent"
4
+ description: "Catch regressions automatically with CI, auto-healing, and GitHub integration"
5
+ icon: "shield-check"
6
6
  ---
7
7
 
8
- Auto-healing tests automatically fix themselves when your application changes. By integrating GitHub Copilot with TestDriver in your CI pipeline, you can have AI investigate test failures and propose fixes.
8
+ Prevent regressions by letting TestDriver run and repair itself on every change. Once you've [explored](/v7/generating-tests), [taught it your app](/v7/caching), [run it](/v7/copilot/running-tests), [validated outcomes](/v7/making-assertions), [adapted to your UI](/v7/performing-actions), and learned to [debug with screenshots](/v7/debugging-with-screenshots), the last step is closing the loop: wire TestDriver into your pull requests so regressions never reach production.
9
9
 
10
- ## How It Works
10
+ Your AI agent can run tests on every PR, investigate failures, and propose fixes — and you can drive all of it from GitHub itself, whether you're at your desk or on your phone.
11
+
12
+ ## Use TestDriver in GitHub
13
+
14
+ TestDriver works directly in GitHub's web interface and mobile app. The same MCP server that powers VS Code integration also works in GitHub, letting you create and manage tests from anywhere.
15
+
16
+ ### How It Works
17
+
18
+ When you add a TestDriver agent file to your repository at `.github/agents/testdriver.agent.md`, GitHub Copilot can use TestDriver's MCP tools directly in:
19
+
20
+ - GitHub.com (web browser)
21
+ - GitHub Mobile app (iOS/Android)
22
+ - Pull request conversations
23
+ - Issue comments
24
+
25
+ ### Using TestDriver in GitHub Web
26
+
27
+ <Steps>
28
+ <Step title="Navigate to Your Repository">
29
+ Open your repository on GitHub.com. Make sure you have the TestDriver agent file at `.github/agents/testdriver.agent.md`.
30
+ </Step>
31
+
32
+ <Step title="Start a Copilot Chat">
33
+ Click the **Copilot icon** in the GitHub interface to open a chat. You can find this in:
34
+ - The repository's Code tab
35
+ - Pull request pages
36
+ - Issue pages
37
+ </Step>
38
+
39
+ <Step title="Invoke the TestDriver Agent">
40
+ Start your message with `@testdriver`:
41
+
42
+ ```
43
+ @testdriver Create a test that verifies the homepage loads correctly at https://myapp.com
44
+ ```
45
+
46
+ The agent will spawn a sandbox environment and begin executing, just like in VS Code.
47
+ </Step>
48
+
49
+ <Step title="View Screenshots in Chat">
50
+ As the test runs, screenshots appear directly in the chat. You can see what the AI sees and provide guidance if needed.
51
+ </Step>
52
+ </Steps>
53
+
54
+ ### Creating Tests from PR Comments
55
+
56
+ You can create tests directly from pull request reviews. Comment on a PR and mention Copilot:
57
+
58
+ ```
59
+ @copilot create a TestDriver test that verifies this new feature works.
60
+ Test the checkout flow with a guest user.
61
+ ```
62
+
63
+ Copilot will:
64
+ 1. Use the TestDriver MCP server
65
+ 2. Create a test based on your description
66
+ 3. Commit the test file to the PR branch
67
+
68
+ This is useful for:
69
+ - Adding test coverage during code review
70
+ - Verifying bug fixes before merging
71
+ - Creating regression tests for new features
72
+
73
+ ### Creating Tests from Issues
74
+
75
+ You can also create tests from issue comments:
76
+
77
+ ```
78
+ @copilot Use TestDriver to create a test that reproduces this bug.
79
+ Navigate to /settings, change the theme, and verify it persists after refresh.
80
+ ```
81
+
82
+ The test will be created in a new branch and linked to the issue.
83
+
84
+ ### Mobile App Support
85
+
86
+ The GitHub Mobile app supports Copilot chat, which means you can use TestDriver from your phone:
87
+
88
+ 1. Open the GitHub app
89
+ 2. Navigate to your repository
90
+ 3. Tap the Copilot icon
91
+ 4. Type `@testdriver` followed by your request
92
+
93
+ Screenshots and test progress appear in the chat, letting you create and debug tests on the go.
94
+
95
+ ### Example: PR Review Workflow
96
+
97
+ Here's a complete workflow for adding tests during code review:
98
+
99
+ <Steps>
100
+ <Step title="Developer Opens PR">
101
+ A developer opens a pull request with a new feature.
102
+ </Step>
103
+
104
+ <Step title="Reviewer Requests Tests">
105
+ The reviewer comments:
106
+ ```
107
+ @copilot Create a TestDriver test for this user registration flow.
108
+ Test both successful registration and validation errors.
109
+ ```
110
+ </Step>
111
+
112
+ <Step title="Copilot Creates Tests">
113
+ Copilot spawns TestDriver, creates the tests, and commits them to the PR branch.
114
+ </Step>
115
+
116
+ <Step title="Tests Run in CI">
117
+ The new tests run automatically in CI, validating the feature works as expected.
118
+ </Step>
119
+ </Steps>
120
+
121
+ ### Agent File Reference
122
+
123
+ The agent file at `.github/agents/testdriver.agent.md` contains the configuration for GitHub Copilot to use TestDriver. Here's the structure:
124
+
125
+ ```yaml
126
+ ---
127
+ name: testdriver
128
+ description: An expert at creating and refining automated tests using TestDriver.ai
129
+ mcp-servers:
130
+ testdriver:
131
+ command: npx
132
+ args:
133
+ - -p
134
+ - testdriverai
135
+ - testdriverai-mcp
136
+ env:
137
+ TD_API_KEY: ${TD_API_KEY}
138
+ ---
139
+
140
+ # TestDriver Expert
141
+
142
+ You are an expert at writing automated tests using TestDriver...
143
+ ```
144
+
145
+ The `TD_API_KEY` is pulled from your repository secrets when running in GitHub Actions or from your environment when using the web interface.
146
+
147
+ <Warning>
148
+ Make sure `TD_API_KEY` is set in your repository secrets for CI workflows. Go to **Settings → Secrets and variables → Actions** to add it.
149
+ </Warning>
150
+
151
+ ## Auto-Healing Tests
152
+
153
+ Auto-healing tests automatically fix themselves when your application changes. By integrating an AI coding agent with TestDriver in your CI pipeline, you can have AI investigate test failures and propose fixes. The example below uses GitHub Copilot in GitHub Actions, but the same approach works with any AI agent that can run TestDriver's MCP server.
154
+
155
+ ### How It Works
11
156
 
12
157
  When a test fails in CI:
13
158
 
14
159
  1. **GitHub Actions detects the failure**
15
- 2. **Copilot spawns the TestDriver agent** with access to the MCP server
160
+ 2. **The AI agent spawns TestDriver** with access to the MCP server
16
161
  3. **The agent investigates** by running the failing test and analyzing what changed
17
- 4. **Copilot creates a fix** by updating the test code
162
+ 4. **The agent creates a fix** by updating the test code
18
163
  5. **A pull request is opened** with the proposed changes for review
19
164
 
20
- ## Setting Up Auto-Healing
165
+ ### Setting Up Auto-Healing
21
166
 
22
167
  <Steps>
23
168
  <Step title="Add Repository Secrets">
@@ -131,7 +276,7 @@ When a test fails in CI:
131
276
  </Step>
132
277
  </Steps>
133
278
 
134
- ## Example: Button Text Change
279
+ ### Example: Button Text Change
135
280
 
136
281
  Here's what auto-healing looks like when a button's text changes:
137
282
 
@@ -158,7 +303,7 @@ Here's what auto-healing looks like when a button's text changes:
158
303
  </Step>
159
304
 
160
305
  <Step title="Auto-Heal Triggers">
161
- The auto-heal workflow runs, and Copilot investigates:
306
+ The auto-heal workflow runs, and the AI agent investigates:
162
307
 
163
308
  ```
164
309
  The test is looking for a "Submit button" but I see a "Send button"
@@ -177,9 +322,9 @@ Here's what auto-healing looks like when a button's text changes:
177
322
  </Step>
178
323
  </Steps>
179
324
 
180
- ## Configuration Options
325
+ ### Configuration Options
181
326
 
182
- ### Selective Auto-Healing
327
+ #### Selective Auto-Healing
183
328
 
184
329
  You can limit auto-healing to specific test files or patterns:
185
330
 
@@ -190,7 +335,7 @@ You can limit auto-healing to specific test files or patterns:
190
335
  vitest run tests/e2e/ 2>&1 | tee test-output.txt
191
336
  ```
192
337
 
193
- ### Manual Approval
338
+ #### Manual Approval
194
339
 
195
340
  For safety, you can require manual approval before auto-heal runs:
196
341
 
@@ -202,7 +347,7 @@ jobs:
202
347
 
203
348
  Configure the environment in **Settings → Environments** with required reviewers.
204
349
 
205
- ### Limiting Changes
350
+ #### Limiting Changes
206
351
 
207
352
  Add instructions to constrain what the AI can change:
208
353
 
@@ -220,7 +365,7 @@ Add instructions to constrain what the AI can change:
220
365
  - Keep changes minimal
221
366
  ```
222
367
 
223
- ## Best Practices
368
+ ### Best Practices
224
369
 
225
370
  <AccordionGroup>
226
371
  <Accordion title="Always review auto-heal PRs">
@@ -250,7 +395,7 @@ Add instructions to constrain what the AI can change:
250
395
  </Accordion>
251
396
  </AccordionGroup>
252
397
 
253
- ## Limitations
398
+ ### Limitations
254
399
 
255
400
  Auto-healing works best for:
256
401
  - Element text changes
@@ -262,4 +407,8 @@ It may struggle with:
262
407
  - New features requiring new assertions
263
408
  - Complex multi-step interactions
264
409
 
265
- For significant changes, create new tests manually using the [TestDriver agent](/v7/copilot/creating-tests).
410
+ For significant changes, create new tests by going back to [Explore](/v7/generating-tests) and generating them with the TestDriver agent.
411
+
412
+ <Card title="View Your Runs" icon="chart-line" href="https://console.testdriver.ai">
413
+ Open the TestDriver console to monitor test runs, healing PRs, and CI results across your projects.
414
+ </Card>