@testdriverai/agent 7.11.229-canary → 7.11.231-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 +75 -18
- 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 +25 -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,414 +1,130 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Prevent"
|
|
2
|
+
title: "Prevent regressions"
|
|
3
3
|
sidebarTitle: "Prevent"
|
|
4
|
-
description: "Catch regressions
|
|
4
|
+
description: "Catch regressions before they merge, and fix tests when your app changes."
|
|
5
5
|
icon: "shield-check"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Stop regressions before they reach your main branch.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- Run your tests on every pull request.
|
|
11
|
+
- Let the TestDriver agent review each change.
|
|
12
|
+
- Ask the agent to fix a test when your app changes.
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
TestDriver tests don't use selectors, so many UI changes never break them.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
## Tests that adapt to UI changes
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
A TestDriver test describes elements the way a person would, such as "the Sign in button in the header". It finds them by looking at the screen.
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
These changes don't break the test, because the description still matches what's on screen:
|
|
19
21
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- Issue comments
|
|
22
|
+
- Restyling a button.
|
|
23
|
+
- Moving it.
|
|
24
|
+
- Rewriting the markup around it.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
A selector-based test would fail on the same change.
|
|
26
27
|
|
|
27
|
-
|
|
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>
|
|
28
|
+
When the screen does change, the [cache](/caching) notices that it no longer matches the last passing run. It asks the AI to find the element again and learns its new location for the next run.
|
|
31
29
|
|
|
32
|
-
|
|
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>
|
|
30
|
+
Descriptions that say what an element is and where it sits survive change best:
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
```javascript
|
|
33
|
+
// Survives restyling and layout changes
|
|
34
|
+
await testdriver.find('primary Sign up button in the hero section').click();
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
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.
|
|
36
|
+
// Too vague: may match the wrong button after a redesign
|
|
37
|
+
await testdriver.find('button').click();
|
|
61
38
|
```
|
|
62
39
|
|
|
63
|
-
|
|
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
|
|
40
|
+
## Run tests on every pull request
|
|
67
41
|
|
|
68
|
-
|
|
69
|
-
- Adding test coverage during code review
|
|
70
|
-
- Verifying bug fixes before merging
|
|
71
|
-
- Creating regression tests for new features
|
|
42
|
+
Run your suite in GitHub Actions, so a change that breaks a flow fails its pull request.
|
|
72
43
|
|
|
73
|
-
|
|
44
|
+
The `testdriverai/action` step authenticates with GitHub OIDC, so there's no API key secret to store. `npx testdriverai init` writes a workflow like this for you:
|
|
74
45
|
|
|
75
|
-
|
|
46
|
+
```yaml .github/workflows/testdriver.yml
|
|
47
|
+
name: TestDriver.ai Tests
|
|
76
48
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
The test will be created in a new branch and linked to the issue.
|
|
83
|
-
|
|
84
|
-
### Mobile App Support
|
|
49
|
+
on:
|
|
50
|
+
push:
|
|
51
|
+
branches: [main]
|
|
52
|
+
pull_request:
|
|
53
|
+
branches: [main]
|
|
85
54
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
55
|
+
jobs:
|
|
56
|
+
test:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
permissions:
|
|
59
|
+
id-token: write # lets the job mint the OIDC token TestDriver accepts
|
|
60
|
+
contents: read
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
- uses: actions/setup-node@v4
|
|
64
|
+
with:
|
|
65
|
+
node-version: '20'
|
|
66
|
+
cache: 'npm'
|
|
67
|
+
- run: npm ci
|
|
68
|
+
- name: Authenticate to TestDriver
|
|
69
|
+
uses: testdriverai/action@stable
|
|
70
|
+
- name: Run TestDriver tests
|
|
71
|
+
run: npx vitest run
|
|
72
|
+
```
|
|
92
73
|
|
|
93
|
-
|
|
74
|
+
OIDC needs the TestDriver GitHub app authorized for your organization.
|
|
94
75
|
|
|
95
|
-
|
|
76
|
+
For other CI providers and runner setups, see [Run tests in CI/CD](/ci-cd).
|
|
96
77
|
|
|
97
|
-
|
|
78
|
+
## Review every pull request
|
|
98
79
|
|
|
99
|
-
|
|
100
|
-
<Step title="Developer Opens PR">
|
|
101
|
-
A developer opens a pull request with a new feature.
|
|
102
|
-
</Step>
|
|
80
|
+
With the [TestDriver GitHub app](/quickstart-github) installed, the TestDriver agent reviews each pull request when it's opened and after every push.
|
|
103
81
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
@copilot Create a TestDriver test for this user registration flow.
|
|
108
|
-
Test both successful registration and validation errors.
|
|
109
|
-
```
|
|
110
|
-
</Step>
|
|
82
|
+
- It reads the change for bugs.
|
|
83
|
+
- When the change is something a user would see, it runs it in a sandbox to prove what it finds.
|
|
111
84
|
|
|
112
|
-
|
|
113
|
-
Copilot spawns TestDriver, creates the tests, and commits them to the PR branch.
|
|
114
|
-
</Step>
|
|
85
|
+
This catches regressions that your existing tests don't cover. See [the TestDriver agent](/agent) for what a review contains.
|
|
115
86
|
|
|
116
|
-
|
|
117
|
-
The new tests run automatically in CI, validating the feature works as expected.
|
|
118
|
-
</Step>
|
|
119
|
-
</Steps>
|
|
87
|
+
## Fix a test when your app changes
|
|
120
88
|
|
|
121
|
-
|
|
89
|
+
Sometimes a test fails because the app changed on purpose, such as a renamed button or a reworked flow. Ask the TestDriver agent to update the test.
|
|
122
90
|
|
|
123
|
-
|
|
91
|
+
On GitHub, mention it on the pull request or an issue:
|
|
124
92
|
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
---
|
|
93
|
+
```text
|
|
94
|
+
@testdriverai The checkout test fails after this redesign because the Submit button is now called Place order. Update the test.
|
|
95
|
+
```
|
|
139
96
|
|
|
140
|
-
|
|
97
|
+
The agent then:
|
|
141
98
|
|
|
142
|
-
|
|
143
|
-
|
|
99
|
+
1. Reruns the flow in a sandbox and sees the current screen.
|
|
100
|
+
2. Updates the test.
|
|
101
|
+
3. Opens a pull request with the fix for you to review.
|
|
144
102
|
|
|
145
|
-
|
|
103
|
+
You can make the same request from your editor through the [Claude Code plugin](/quickstart-claude) or the [VS Code extension](/quickstart-vscode).
|
|
146
104
|
|
|
147
105
|
<Warning>
|
|
148
|
-
|
|
106
|
+
Review the agent's fix before you merge it. A test updated to pass may no longer check what you meant. Confirm that the assertions still describe the behavior you want.
|
|
149
107
|
</Warning>
|
|
150
108
|
|
|
151
|
-
##
|
|
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
|
|
156
|
-
|
|
157
|
-
When a test fails in CI:
|
|
158
|
-
|
|
159
|
-
1. **GitHub Actions detects the failure**
|
|
160
|
-
2. **The AI agent spawns TestDriver** with access to the MCP server
|
|
161
|
-
3. **The agent investigates** by running the failing test and analyzing what changed
|
|
162
|
-
4. **The agent creates a fix** by updating the test code
|
|
163
|
-
5. **A pull request is opened** with the proposed changes for review
|
|
164
|
-
|
|
165
|
-
### Setting Up Auto-Healing
|
|
166
|
-
|
|
167
|
-
<Steps>
|
|
168
|
-
<Step title="Add Repository Secrets">
|
|
169
|
-
Add your TestDriver API key to your repository secrets:
|
|
170
|
-
|
|
171
|
-
1. Go to **Settings → Secrets and variables → Actions**
|
|
172
|
-
2. Click **New repository secret**
|
|
173
|
-
3. Add `TD_API_KEY` with your API key value
|
|
174
|
-
</Step>
|
|
175
|
-
|
|
176
|
-
<Step title="Create the Auto-Heal Workflow">
|
|
177
|
-
Add a GitHub Actions workflow that triggers on test failures:
|
|
178
|
-
|
|
179
|
-
```yaml .github/workflows/auto-heal.yml
|
|
180
|
-
name: Auto-Heal Tests
|
|
181
|
-
|
|
182
|
-
on:
|
|
183
|
-
workflow_run:
|
|
184
|
-
workflows: ["Tests"] # Your main test workflow
|
|
185
|
-
types: [completed]
|
|
186
|
-
branches: [main]
|
|
187
|
-
|
|
188
|
-
jobs:
|
|
189
|
-
auto-heal:
|
|
190
|
-
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
|
191
|
-
runs-on: ubuntu-latest
|
|
192
|
-
permissions:
|
|
193
|
-
contents: write
|
|
194
|
-
pull-requests: write
|
|
195
|
-
|
|
196
|
-
steps:
|
|
197
|
-
- uses: actions/checkout@v4
|
|
198
|
-
|
|
199
|
-
- name: Setup Node.js
|
|
200
|
-
uses: actions/setup-node@v4
|
|
201
|
-
with:
|
|
202
|
-
node-version: "20"
|
|
203
|
-
|
|
204
|
-
- name: Install dependencies
|
|
205
|
-
run: npm ci
|
|
206
|
-
|
|
207
|
-
- name: Run failing tests and capture output
|
|
208
|
-
id: tests
|
|
209
|
-
continue-on-error: true
|
|
210
|
-
run: |
|
|
211
|
-
vitest run 2>&1 | tee test-output.txt
|
|
212
|
-
echo "output<<EOF" >> $GITHUB_OUTPUT
|
|
213
|
-
cat test-output.txt >> $GITHUB_OUTPUT
|
|
214
|
-
echo "EOF" >> $GITHUB_OUTPUT
|
|
215
|
-
env:
|
|
216
|
-
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
217
|
-
|
|
218
|
-
- name: Invoke Copilot to fix tests
|
|
219
|
-
uses: github/copilot-action@v1
|
|
220
|
-
with:
|
|
221
|
-
prompt: |
|
|
222
|
-
@testdriver The following tests failed:
|
|
223
|
-
|
|
224
|
-
${{ steps.tests.outputs.output }}
|
|
225
|
-
|
|
226
|
-
Please investigate each failure by:
|
|
227
|
-
1. Running the failing test
|
|
228
|
-
2. Analyzing what changed in the UI or behavior
|
|
229
|
-
3. Updating the test code to fix the issue
|
|
230
|
-
|
|
231
|
-
Create a commit with your changes.
|
|
232
|
-
env:
|
|
233
|
-
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
234
|
-
|
|
235
|
-
- name: Create Pull Request
|
|
236
|
-
uses: peter-evans/create-pull-request@v5
|
|
237
|
-
with:
|
|
238
|
-
title: "Auto-heal: Fix failing tests"
|
|
239
|
-
body: |
|
|
240
|
-
This PR was automatically generated by the auto-heal workflow.
|
|
241
|
-
|
|
242
|
-
## Changes
|
|
243
|
-
The following tests were updated to fix failures detected in CI.
|
|
244
|
-
|
|
245
|
-
## Review
|
|
246
|
-
Please review the changes carefully before merging.
|
|
247
|
-
branch: auto-heal/${{ github.run_id }}
|
|
248
|
-
commit-message: "fix: auto-heal failing tests"
|
|
249
|
-
```
|
|
250
|
-
</Step>
|
|
251
|
-
|
|
252
|
-
<Step title="Configure Test Workflow">
|
|
253
|
-
Make sure your main test workflow has a name that matches the `workflows` trigger:
|
|
254
|
-
|
|
255
|
-
```yaml .github/workflows/tests.yml
|
|
256
|
-
name: Tests # Must match the workflow_run trigger
|
|
257
|
-
|
|
258
|
-
on:
|
|
259
|
-
push:
|
|
260
|
-
branches: [main]
|
|
261
|
-
pull_request:
|
|
262
|
-
|
|
263
|
-
jobs:
|
|
264
|
-
test:
|
|
265
|
-
runs-on: ubuntu-latest
|
|
266
|
-
steps:
|
|
267
|
-
- uses: actions/checkout@v4
|
|
268
|
-
- uses: actions/setup-node@v4
|
|
269
|
-
with:
|
|
270
|
-
node-version: "20"
|
|
271
|
-
- run: npm ci
|
|
272
|
-
- run: vitest run
|
|
273
|
-
env:
|
|
274
|
-
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
275
|
-
```
|
|
276
|
-
</Step>
|
|
277
|
-
</Steps>
|
|
278
|
-
|
|
279
|
-
### Example: Button Text Change
|
|
280
|
-
|
|
281
|
-
Here's what auto-healing looks like when a button's text changes:
|
|
282
|
-
|
|
283
|
-
<Steps>
|
|
284
|
-
<Step title="Application Changes">
|
|
285
|
-
A developer changes a button's text from "Submit" to "Send":
|
|
286
|
-
|
|
287
|
-
```html
|
|
288
|
-
<!-- Before -->
|
|
289
|
-
<button>Submit</button>
|
|
290
|
-
|
|
291
|
-
<!-- After -->
|
|
292
|
-
<button>Send</button>
|
|
293
|
-
```
|
|
294
|
-
</Step>
|
|
295
|
-
|
|
296
|
-
<Step title="Test Fails">
|
|
297
|
-
The test fails because it's looking for the old text:
|
|
298
|
-
|
|
299
|
-
```javascript
|
|
300
|
-
// This now fails
|
|
301
|
-
const submitButton = await testdriver.find("Submit button");
|
|
302
|
-
```
|
|
303
|
-
</Step>
|
|
304
|
-
|
|
305
|
-
<Step title="Auto-Heal Triggers">
|
|
306
|
-
The auto-heal workflow runs, and the AI agent investigates:
|
|
307
|
-
|
|
308
|
-
```
|
|
309
|
-
The test is looking for a "Submit button" but I see a "Send button"
|
|
310
|
-
on the page. The button functionality is the same, just the text changed.
|
|
311
|
-
I'll update the test to use the new text.
|
|
312
|
-
```
|
|
313
|
-
</Step>
|
|
314
|
-
|
|
315
|
-
<Step title="PR Created">
|
|
316
|
-
A pull request is opened with the fix:
|
|
317
|
-
|
|
318
|
-
```javascript
|
|
319
|
-
// Updated by auto-heal
|
|
320
|
-
const submitButton = await testdriver.find("Send button");
|
|
321
|
-
```
|
|
322
|
-
</Step>
|
|
323
|
-
</Steps>
|
|
324
|
-
|
|
325
|
-
### Configuration Options
|
|
326
|
-
|
|
327
|
-
#### Selective Auto-Healing
|
|
328
|
-
|
|
329
|
-
You can limit auto-healing to specific test files or patterns:
|
|
330
|
-
|
|
331
|
-
```yaml
|
|
332
|
-
- name: Run failing tests
|
|
333
|
-
run: |
|
|
334
|
-
# Only heal tests in the e2e directory
|
|
335
|
-
vitest run tests/e2e/ 2>&1 | tee test-output.txt
|
|
336
|
-
```
|
|
109
|
+
## When updating a test isn't enough
|
|
337
110
|
|
|
338
|
-
|
|
111
|
+
Updating a description or an assertion works well when an element is renamed, restyled, or moved.
|
|
339
112
|
|
|
340
|
-
|
|
113
|
+
When a flow changes substantially, such as a new step in checkout or a redesigned form, describe the new flow. Have the agent [generate a fresh test](/generating-tests) instead.
|
|
341
114
|
|
|
342
|
-
|
|
343
|
-
jobs:
|
|
344
|
-
auto-heal:
|
|
345
|
-
environment: auto-heal # Requires approval
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
Configure the environment in **Settings → Environments** with required reviewers.
|
|
349
|
-
|
|
350
|
-
#### Limiting Changes
|
|
351
|
-
|
|
352
|
-
Add instructions to constrain what the AI can change:
|
|
353
|
-
|
|
354
|
-
```yaml
|
|
355
|
-
- name: Invoke Copilot to fix tests
|
|
356
|
-
uses: github/copilot-action@v1
|
|
357
|
-
with:
|
|
358
|
-
prompt: |
|
|
359
|
-
@testdriver Fix the failing tests.
|
|
360
|
-
|
|
361
|
-
Rules:
|
|
362
|
-
- Only update element selectors and text matching
|
|
363
|
-
- Do not change test logic or assertions
|
|
364
|
-
- Do not add or remove tests
|
|
365
|
-
- Keep changes minimal
|
|
366
|
-
```
|
|
115
|
+
## Next steps
|
|
367
116
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
<
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
await testdriver.find("button");
|
|
383
|
-
```
|
|
384
|
-
</Accordion>
|
|
385
|
-
|
|
386
|
-
<Accordion title="Set up notifications">
|
|
387
|
-
Configure GitHub notifications or Slack integration to be alerted when auto-heal PRs are created.
|
|
388
|
-
</Accordion>
|
|
389
|
-
|
|
390
|
-
<Accordion title="Track heal rate">
|
|
391
|
-
Monitor how often tests need healing. High heal rates may indicate:
|
|
392
|
-
- Tests are too brittle
|
|
393
|
-
- Application is changing rapidly
|
|
394
|
-
- Element descriptions need improvement
|
|
395
|
-
</Accordion>
|
|
396
|
-
</AccordionGroup>
|
|
397
|
-
|
|
398
|
-
### Limitations
|
|
399
|
-
|
|
400
|
-
Auto-healing works best for:
|
|
401
|
-
- Element text changes
|
|
402
|
-
- Layout and styling updates
|
|
403
|
-
- Minor UI restructuring
|
|
404
|
-
|
|
405
|
-
It may struggle with:
|
|
406
|
-
- Major workflow changes
|
|
407
|
-
- New features requiring new assertions
|
|
408
|
-
- Complex multi-step interactions
|
|
409
|
-
|
|
410
|
-
For significant changes, create new tests by going back to [Explore](/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>
|
|
117
|
+
<CardGroup cols={2}>
|
|
118
|
+
<Card title="Run tests in CI/CD" icon="code-branch" href="/ci-cd">
|
|
119
|
+
Set up GitHub Actions and other CI providers.
|
|
120
|
+
</Card>
|
|
121
|
+
<Card title="The TestDriver agent" icon="hand-horns" href="/agent">
|
|
122
|
+
How the agent reviews pull requests and fixes tests.
|
|
123
|
+
</Card>
|
|
124
|
+
<Card title="Locate elements" icon="magnifying-glass" href="/locating-elements">
|
|
125
|
+
Write descriptions that keep working as your UI changes.
|
|
126
|
+
</Card>
|
|
127
|
+
<Card title="Debug a failing test" icon="bug" href="/debugging-with-screenshots">
|
|
128
|
+
See what the screen showed when a test failed.
|
|
129
|
+
</Card>
|
|
130
|
+
</CardGroup>
|