@testdriverai/mcp 7.9.150-test → 7.9.152-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/ai/skills/testdriver-caching/SKILL.md +13 -6
- package/ai/skills/testdriver-ci-cd/SKILL.md +20 -34
- package/ai/skills/testdriver-client/SKILL.md +5 -1
- package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +14 -4
- package/ai/skills/testdriver-find/SKILL.md +2 -0
- package/ai/skills/testdriver-generating-tests/SKILL.md +159 -8
- package/ai/skills/testdriver-machine-setup/SKILL.md +75 -8
- package/ai/skills/testdriver-making-assertions/SKILL.md +78 -2
- package/ai/skills/testdriver-performing-actions/SKILL.md +97 -2
- package/ai/skills/testdriver-quickstart/SKILL.md +47 -28
- package/ai/skills/testdriver-wait/SKILL.md +1 -1
- package/ai/skills/testdriver:generating-tests/SKILL.md +0 -11
- package/docs/changelog.mdx +1 -1
- package/docs/docs.json +14 -39
- package/docs/v7/assert.mdx +0 -1
- package/docs/v7/caching.mdx +14 -10
- package/docs/v7/ci-cd.mdx +20 -34
- package/docs/v7/client.mdx +1 -1
- package/docs/v7/copilot/auto-healing.mdx +167 -18
- package/docs/v7/copilot/running-tests.mdx +915 -54
- package/docs/v7/debugging-with-screenshots.mdx +17 -7
- package/docs/v7/generating-tests.mdx +166 -10
- package/docs/v7/making-assertions.mdx +81 -4
- package/docs/v7/performing-actions.mdx +100 -4
- package/docs/v7/quickstart.mdx +299 -21
- package/docs/v7/wait.mdx +1 -1
- package/package.json +3 -3
- package/docs/v7/ai/agent.mdx +0 -72
- package/docs/v7/ai/mcp.mdx +0 -228
- package/docs/v7/ai/skills.mdx +0 -73
- package/docs/v7/ai.mdx +0 -205
- package/docs/v7/copilot/creating-tests.mdx +0 -156
- package/docs/v7/copilot/github.mdx +0 -143
- package/docs/v7/copilot/setup.mdx +0 -143
- package/docs/v7/device-config.mdx +0 -317
- package/docs/v7/locating-elements.mdx +0 -71
- package/docs/v7/machine-setup.mdx +0 -331
- package/docs/v7/running-tests.mdx +0 -185
- package/docs/v7/waiting-for-elements.mdx +0 -90
package/docs/v7/ai/skills.mdx
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Skills"
|
|
3
|
-
sidebarTitle: "Skills"
|
|
4
|
-
description: "Composable instruction files that teach any AI client how to use TestDriver"
|
|
5
|
-
icon: "puzzle-piece"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
**Skills** are small, focused instruction files — one per TestDriver capability — that teach your AI client exactly how to use each part of the TestDriver SDK and MCP tools. They follow the [Anthropic `SKILL.md` format](https://code.claude.com/docs/en/skills): a folder per skill, each containing a `SKILL.md` with YAML frontmatter and a markdown body.
|
|
11
|
-
|
|
12
|
-
There are **106 skills**, generated directly from the TestDriver documentation, covering every action and concept: `find`, `click`, `type`, `assert`, `check`, `scroll`, `press-keys`, `provision`, caching, secrets, CI/CD, and more.
|
|
13
|
-
|
|
14
|
-
```text
|
|
15
|
-
.claude/skills/
|
|
16
|
-
├── testdriver-click/
|
|
17
|
-
│ └── SKILL.md
|
|
18
|
-
├── testdriver-find/
|
|
19
|
-
│ └── SKILL.md
|
|
20
|
-
├── testdriver-assert/
|
|
21
|
-
│ └── SKILL.md
|
|
22
|
-
└── … (103 more)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Each `SKILL.md` looks like:
|
|
26
|
-
|
|
27
|
-
```markdown
|
|
28
|
-
---
|
|
29
|
-
name: testdriver:click
|
|
30
|
-
description: Click at specific coordinates or on elements
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Element Click
|
|
34
|
-
|
|
35
|
-
When called on an Element object, clicks on the located element.
|
|
36
|
-
…
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Why skills
|
|
40
|
-
|
|
41
|
-
The [agent](/v7/ai/agent) is general; skills are specific. When the agent needs to perform an action — say, locate an element — it pulls in the `testdriver:find` skill, which contains the exact syntax, options, return shape, and gotchas for that one method. This keeps the agent accurate without bloating its base prompt, and lets clients load only the skills relevant to the current step.
|
|
42
|
-
|
|
43
|
-
## Installation
|
|
44
|
-
|
|
45
|
-
Skills are installed by `testdriverai init` along with the [agent](/v7/ai/agent) and [MCP server](/v7/ai/mcp):
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npx testdriverai init
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
They're written to the skills directory each client expects:
|
|
52
|
-
|
|
53
|
-
| Client | Skills location |
|
|
54
|
-
| --- | --- |
|
|
55
|
-
| Claude Code | `.claude/skills/<name>/SKILL.md` |
|
|
56
|
-
| Zed | `.agents/skills/<name>/SKILL.md` |
|
|
57
|
-
| Codex | referenced from `AGENTS.md` |
|
|
58
|
-
| VS Code · Cursor · Windsurf | folded into the agent rules/instructions |
|
|
59
|
-
|
|
60
|
-
Clients without a native skills concept (Cursor, VS Code, Windsurf) still get the agent definition, which references the same guidance inline.
|
|
61
|
-
|
|
62
|
-
## Authoring & regenerating
|
|
63
|
-
|
|
64
|
-
Skills are **generated, not hand-edited** — each is built from a `.mdx` page in the docs. Do not edit `SKILL.md` files directly (they carry a `DO NOT EDIT` marker). To change a skill, edit the corresponding documentation page and regenerate:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
node docs/_scripts/generate-skills.js
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Related
|
|
71
|
-
|
|
72
|
-
- [Agent](/v7/ai/agent) — composes skills into working tests
|
|
73
|
-
- [MCP Server](/v7/ai/mcp) — the tools the skills describe how to use
|
package/docs/v7/ai.mdx
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "ai()"
|
|
3
|
-
sidebarTitle: "ai"
|
|
4
|
-
description: "Execute natural language tasks using AI"
|
|
5
|
-
icon: "wand-magic-sparkles"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
The `ai()` method allows you to execute complex tasks using natural language descriptions. TestDriver's AI will figure out the steps needed to accomplish the task.
|
|
11
|
-
|
|
12
|
-
## Syntax
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
await testdriver.ai(task, options)
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Parameters
|
|
19
|
-
|
|
20
|
-
<ParamField path="task" type="string" required>
|
|
21
|
-
Natural language description of what to do
|
|
22
|
-
</ParamField>
|
|
23
|
-
|
|
24
|
-
<ParamField path="options" type="object">
|
|
25
|
-
Execution options
|
|
26
|
-
|
|
27
|
-
<Expandable title="properties">
|
|
28
|
-
<ParamField path="validateAndLoop" type="boolean" default="false">
|
|
29
|
-
Whether to validate completion and retry if incomplete
|
|
30
|
-
</ParamField>
|
|
31
|
-
</Expandable>
|
|
32
|
-
</ParamField>
|
|
33
|
-
|
|
34
|
-
## Returns
|
|
35
|
-
|
|
36
|
-
`Promise<string | void>` - Final AI response if `validateAndLoop` is true
|
|
37
|
-
|
|
38
|
-
## Examples
|
|
39
|
-
|
|
40
|
-
### Basic Usage
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
// Simple task execution
|
|
44
|
-
await testdriver.ai('Click the submit button');
|
|
45
|
-
|
|
46
|
-
// Complex multi-step task
|
|
47
|
-
await testdriver.ai('Fill out the contact form and submit it');
|
|
48
|
-
|
|
49
|
-
// Navigation task
|
|
50
|
-
await testdriver.ai('Go to the settings page and enable notifications');
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### With Validation
|
|
54
|
-
|
|
55
|
-
```javascript
|
|
56
|
-
// AI will verify the task completed successfully
|
|
57
|
-
const result = await testdriver.ai('Complete the checkout process', {
|
|
58
|
-
validateAndLoop: true
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
console.log('Task result:', result);
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Multi-Step Workflows
|
|
65
|
-
|
|
66
|
-
```javascript
|
|
67
|
-
// The AI will break down complex tasks
|
|
68
|
-
await testdriver.ai('Search for "laptop", add the first result to cart, and proceed to checkout');
|
|
69
|
-
|
|
70
|
-
// UI exploration
|
|
71
|
-
await testdriver.ai('Find and click all menu items to explore the application');
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Use Cases
|
|
75
|
-
|
|
76
|
-
<AccordionGroup>
|
|
77
|
-
<Accordion title="Exploratory Testing">
|
|
78
|
-
Use AI to explore unfamiliar applications:
|
|
79
|
-
|
|
80
|
-
```javascript
|
|
81
|
-
await testdriver.ai('Explore the main navigation menu');
|
|
82
|
-
await testdriver.ai('Try to find the user profile settings');
|
|
83
|
-
```
|
|
84
|
-
</Accordion>
|
|
85
|
-
|
|
86
|
-
<Accordion title="Complex Workflows">
|
|
87
|
-
Let AI handle multi-step processes:
|
|
88
|
-
|
|
89
|
-
```javascript
|
|
90
|
-
await testdriver.ai('Complete the multi-step registration form');
|
|
91
|
-
await testdriver.ai('Configure all the advanced settings to default values');
|
|
92
|
-
```
|
|
93
|
-
</Accordion>
|
|
94
|
-
|
|
95
|
-
<Accordion title="Flexible Interactions">
|
|
96
|
-
When exact element locations aren't critical:
|
|
97
|
-
|
|
98
|
-
```javascript
|
|
99
|
-
await testdriver.ai('Close any popup dialogs');
|
|
100
|
-
await testdriver.ai('Accept the cookie consent if it appears');
|
|
101
|
-
```
|
|
102
|
-
</Accordion>
|
|
103
|
-
</AccordionGroup>
|
|
104
|
-
|
|
105
|
-
## Best Practices
|
|
106
|
-
|
|
107
|
-
<Check>
|
|
108
|
-
**Be specific but flexible**: Give enough context without over-constraining the AI
|
|
109
|
-
|
|
110
|
-
```javascript
|
|
111
|
-
// ✅ Good
|
|
112
|
-
await testdriver.ai('Add the first product to the shopping cart');
|
|
113
|
-
|
|
114
|
-
// ❌ Too vague
|
|
115
|
-
await testdriver.ai('do something');
|
|
116
|
-
|
|
117
|
-
// ❌ Too specific (defeats the purpose)
|
|
118
|
-
await testdriver.ai('click at coordinates 500, 300');
|
|
119
|
-
```
|
|
120
|
-
</Check>
|
|
121
|
-
|
|
122
|
-
<Check>
|
|
123
|
-
**Use for exploration, not precision**: For critical assertions, use explicit methods
|
|
124
|
-
|
|
125
|
-
```javascript
|
|
126
|
-
// Use AI for setup
|
|
127
|
-
await testdriver.ai('Navigate to the login page');
|
|
128
|
-
|
|
129
|
-
// Use explicit methods for critical steps
|
|
130
|
-
const usernameField = await testdriver.find('username input');
|
|
131
|
-
await usernameField.click();
|
|
132
|
-
await testdriver.type('testuser');
|
|
133
|
-
|
|
134
|
-
await testdriver.assert('login page is displayed');
|
|
135
|
-
```
|
|
136
|
-
</Check>
|
|
137
|
-
|
|
138
|
-
<Warning>
|
|
139
|
-
**AI tasks may be slower**: The AI needs to analyze the screen and plan actions. For performance-critical tests, use explicit methods.
|
|
140
|
-
</Warning>
|
|
141
|
-
|
|
142
|
-
## When to Use AI vs Explicit Methods
|
|
143
|
-
|
|
144
|
-
### Use `ai()` when:
|
|
145
|
-
- Exploring unfamiliar applications
|
|
146
|
-
- Handling optional UI elements (popups, cookies, etc.)
|
|
147
|
-
- Prototyping tests quickly
|
|
148
|
-
- Tasks where exact steps may vary
|
|
149
|
-
|
|
150
|
-
### Use explicit methods when:
|
|
151
|
-
- Performance is critical
|
|
152
|
-
- You need precise control
|
|
153
|
-
- Making assertions
|
|
154
|
-
- Debugging test failures
|
|
155
|
-
- Repetitive, predictable actions
|
|
156
|
-
|
|
157
|
-
## Complete Example
|
|
158
|
-
|
|
159
|
-
```javascript
|
|
160
|
-
import { beforeAll, afterAll, describe, it } from 'vitest';
|
|
161
|
-
import TestDriver from 'testdriverai';
|
|
162
|
-
|
|
163
|
-
describe('E-commerce Flow with AI', () => {
|
|
164
|
-
let testdriver;
|
|
165
|
-
|
|
166
|
-
beforeAll(async () => {
|
|
167
|
-
client = new TestDriver(process.env.TD_API_KEY);
|
|
168
|
-
await testdriver.auth();
|
|
169
|
-
await testdriver.connect();
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
afterAll(async () => {
|
|
173
|
-
await testdriver.disconnect();
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it('should complete shopping flow using AI assistance', async () => {
|
|
177
|
-
await testdriver.focusApplication('Google Chrome');
|
|
178
|
-
|
|
179
|
-
// Use AI for navigation and exploration
|
|
180
|
-
await testdriver.ai('Browse to the electronics section');
|
|
181
|
-
await testdriver.ai('Find and add a laptop to the cart');
|
|
182
|
-
|
|
183
|
-
// Use explicit methods for critical steps
|
|
184
|
-
const cartIcon = await testdriver.find('shopping cart icon');
|
|
185
|
-
await cartIcon.click();
|
|
186
|
-
|
|
187
|
-
const total = await testdriver.extract('the cart total amount');
|
|
188
|
-
console.log('Cart total:', total);
|
|
189
|
-
|
|
190
|
-
// Use AI for checkout flow
|
|
191
|
-
await testdriver.ai('Proceed to checkout and fill in shipping details', {
|
|
192
|
-
validateAndLoop: true
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
// Explicit assertion
|
|
196
|
-
await testdriver.assert('order confirmation page is displayed');
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
## Related Methods
|
|
202
|
-
|
|
203
|
-
- [`find()`](/v7/find) - Locate specific elements
|
|
204
|
-
- [`assert()`](/v7/assert) - Make assertions
|
|
205
|
-
- [`extract()`](/v7/extract) - Extract information
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Creating Tests"
|
|
3
|
-
sidebarTitle: "Creating Tests"
|
|
4
|
-
description: "Use the TestDriver agent and MCP to create tests through natural language"
|
|
5
|
-
icon: "wand-magic-sparkles"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
With GitHub Copilot and TestDriver's MCP server, you can create tests by chatting with an AI agent. The agent spawns a virtual machine, executes actions, and writes test code for you.
|
|
9
|
-
|
|
10
|
-
## Start a Conversation
|
|
11
|
-
|
|
12
|
-
Open GitHub Copilot Chat in VS Code. If your project has no other agents configured, the TestDriver agent is used by default. Otherwise, select **testdriver** from the agent dropdown in the chat panel.
|
|
13
|
-
|
|
14
|
-
Describe what you want to test:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Create a test that logs into my app at https://myapp.com
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The agent will:
|
|
21
|
-
1. Start a new session and spawn a Linux virtual machine
|
|
22
|
-
2. Launch Chrome and navigate to your URL
|
|
23
|
-
3. Execute actions based on your instructions
|
|
24
|
-
4. Write the test code to a `.test.mjs` file
|
|
25
|
-
|
|
26
|
-
<Note>
|
|
27
|
-
The TestDriver agent appears in the agent selection dropdown if you have other agents configured (like `copilot-instructions.md` or other `.agent.md` files). Make sure to select **testdriver** to use TestDriver's MCP tools.
|
|
28
|
-
</Note>
|
|
29
|
-
|
|
30
|
-
## Live Preview Panel
|
|
31
|
-
|
|
32
|
-
When the agent starts a session, a **live preview panel** opens in VS Code. This lets you:
|
|
33
|
-
|
|
34
|
-
- **Watch tests execute** in real-time
|
|
35
|
-
- **Interact with the VM** — click, type, and navigate manually
|
|
36
|
-
- **Debug issues** — see exactly what the AI sees
|
|
37
|
-
|
|
38
|
-
<Note>
|
|
39
|
-
The live preview panel requires the TestDriver VS Code extension. Set `TD_PREVIEW=ide` in your MCP configuration to enable it. See the [device configuration docs](/v7/device-config) for all preview options.
|
|
40
|
-
</Note>
|
|
41
|
-
|
|
42
|
-
## Interactive Workflow
|
|
43
|
-
|
|
44
|
-
The recommended workflow for creating tests:
|
|
45
|
-
|
|
46
|
-
<Steps>
|
|
47
|
-
<Step title="Describe Your Test">
|
|
48
|
-
Tell the agent what you want to test:
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
Test the checkout flow on https://shop.example.com
|
|
52
|
-
```
|
|
53
|
-
</Step>
|
|
54
|
-
|
|
55
|
-
<Step title="Watch and Guide">
|
|
56
|
-
The agent will start executing. Watch the preview panel and provide guidance if needed:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
The login modal appeared. Use test@example.com and password123
|
|
60
|
-
```
|
|
61
|
-
</Step>
|
|
62
|
-
|
|
63
|
-
<Step title="Add Assertions">
|
|
64
|
-
Ask the agent to verify specific conditions:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
Assert that the order confirmation page is shown with the order number
|
|
68
|
-
```
|
|
69
|
-
</Step>
|
|
70
|
-
|
|
71
|
-
<Step title="Review the Code">
|
|
72
|
-
The agent writes test code as it works. Review the generated `.test.mjs` file and make any adjustments.
|
|
73
|
-
</Step>
|
|
74
|
-
</Steps>
|
|
75
|
-
|
|
76
|
-
## Example Conversation
|
|
77
|
-
|
|
78
|
-
Here's a complete example of creating a login test:
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
You: Create a test for the login flow at https://console.testdriver.ai
|
|
82
|
-
|
|
83
|
-
Agent: I'll create a test for the login flow. Starting a session...
|
|
84
|
-
[Screenshot: Login page loaded]
|
|
85
|
-
|
|
86
|
-
I can see the login page. Let me find the email input.
|
|
87
|
-
[Screenshot: Email input highlighted]
|
|
88
|
-
|
|
89
|
-
Now I'll type the email and find the password field...
|
|
90
|
-
|
|
91
|
-
You: Use test@example.com for the email
|
|
92
|
-
|
|
93
|
-
Agent: Got it. Typing test@example.com...
|
|
94
|
-
[Screenshot: Email entered]
|
|
95
|
-
|
|
96
|
-
Now entering the password and clicking Sign In...
|
|
97
|
-
[Screenshot: Dashboard loaded]
|
|
98
|
-
|
|
99
|
-
✅ Login successful! I've written the test to tests/login.test.mjs
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Generated Test Code
|
|
103
|
-
|
|
104
|
-
The agent generates standard Vitest test files:
|
|
105
|
-
|
|
106
|
-
```javascript tests/login.test.mjs
|
|
107
|
-
import { describe, expect, it } from "vitest";
|
|
108
|
-
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
109
|
-
|
|
110
|
-
describe("Login Flow", () => {
|
|
111
|
-
it("should log in successfully", async (context) => {
|
|
112
|
-
const testdriver = TestDriver(context);
|
|
113
|
-
|
|
114
|
-
await testdriver.provision.chrome({
|
|
115
|
-
url: "https://console.testdriver.ai"
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const emailInput = await testdriver.find("email input field");
|
|
119
|
-
await emailInput.click();
|
|
120
|
-
await testdriver.type("test@example.com");
|
|
121
|
-
|
|
122
|
-
const passwordInput = await testdriver.find("password input field");
|
|
123
|
-
await passwordInput.click();
|
|
124
|
-
await testdriver.type("password123");
|
|
125
|
-
|
|
126
|
-
const signInButton = await testdriver.find("Sign In button");
|
|
127
|
-
await signInButton.click();
|
|
128
|
-
|
|
129
|
-
const result = await testdriver.assert("dashboard is visible");
|
|
130
|
-
expect(result).toBeTruthy();
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Tips for Better Tests
|
|
136
|
-
|
|
137
|
-
<AccordionGroup>
|
|
138
|
-
<Accordion title="Be specific with element descriptions">
|
|
139
|
-
Instead of "click the button", say "click the blue Sign In button in the header". More context helps the AI find the right element.
|
|
140
|
-
</Accordion>
|
|
141
|
-
<Accordion title="Add waits for dynamic content">
|
|
142
|
-
If your app has animations or loading states, tell the agent to wait:
|
|
143
|
-
```
|
|
144
|
-
Wait for the loading spinner to disappear before continuing
|
|
145
|
-
```
|
|
146
|
-
</Accordion>
|
|
147
|
-
<Accordion title="Use assertions liberally">
|
|
148
|
-
Add assertions after each major action to catch regressions early:
|
|
149
|
-
```
|
|
150
|
-
Assert that the product was added to the cart
|
|
151
|
-
```
|
|
152
|
-
</Accordion>
|
|
153
|
-
<Accordion title="Break complex flows into steps">
|
|
154
|
-
For long workflows, create the test incrementally and verify each step works before moving on.
|
|
155
|
-
</Accordion>
|
|
156
|
-
</AccordionGroup>
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "GitHub Integration"
|
|
3
|
-
sidebarTitle: "GitHub"
|
|
4
|
-
description: "Use TestDriver from GitHub's web interface and mobile app"
|
|
5
|
-
icon: "github"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
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.
|
|
9
|
-
|
|
10
|
-
## How It Works
|
|
11
|
-
|
|
12
|
-
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:
|
|
13
|
-
|
|
14
|
-
- GitHub.com (web browser)
|
|
15
|
-
- GitHub Mobile app (iOS/Android)
|
|
16
|
-
- Pull request conversations
|
|
17
|
-
- Issue comments
|
|
18
|
-
|
|
19
|
-
## Using TestDriver in GitHub Web
|
|
20
|
-
|
|
21
|
-
<Steps>
|
|
22
|
-
<Step title="Navigate to Your Repository">
|
|
23
|
-
Open your repository on GitHub.com. Make sure you have the TestDriver agent file at `.github/agents/testdriver.agent.md`.
|
|
24
|
-
</Step>
|
|
25
|
-
|
|
26
|
-
<Step title="Start a Copilot Chat">
|
|
27
|
-
Click the **Copilot icon** in the GitHub interface to open a chat. You can find this in:
|
|
28
|
-
- The repository's Code tab
|
|
29
|
-
- Pull request pages
|
|
30
|
-
- Issue pages
|
|
31
|
-
</Step>
|
|
32
|
-
|
|
33
|
-
<Step title="Invoke the TestDriver Agent">
|
|
34
|
-
Start your message with `@testdriver`:
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
@testdriver Create a test that verifies the homepage loads correctly at https://myapp.com
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
The agent will spawn a sandbox environment and begin executing, just like in VS Code.
|
|
41
|
-
</Step>
|
|
42
|
-
|
|
43
|
-
<Step title="View Screenshots in Chat">
|
|
44
|
-
As the test runs, screenshots appear directly in the chat. You can see what the AI sees and provide guidance if needed.
|
|
45
|
-
</Step>
|
|
46
|
-
</Steps>
|
|
47
|
-
|
|
48
|
-
## Creating Tests from PR Comments
|
|
49
|
-
|
|
50
|
-
You can create tests directly from pull request reviews. Comment on a PR and mention Copilot:
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
@copilot create a TestDriver test that verifies this new feature works.
|
|
54
|
-
Test the checkout flow with a guest user.
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Copilot will:
|
|
58
|
-
1. Use the TestDriver MCP server
|
|
59
|
-
2. Create a test based on your description
|
|
60
|
-
3. Commit the test file to the PR branch
|
|
61
|
-
|
|
62
|
-
This is useful for:
|
|
63
|
-
- Adding test coverage during code review
|
|
64
|
-
- Verifying bug fixes before merging
|
|
65
|
-
- Creating regression tests for new features
|
|
66
|
-
|
|
67
|
-
## Creating Tests from Issues
|
|
68
|
-
|
|
69
|
-
You can also create tests from issue comments:
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
@copilot Use TestDriver to create a test that reproduces this bug.
|
|
73
|
-
Navigate to /settings, change the theme, and verify it persists after refresh.
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
The test will be created in a new branch and linked to the issue.
|
|
77
|
-
|
|
78
|
-
## Mobile App Support
|
|
79
|
-
|
|
80
|
-
The GitHub Mobile app supports Copilot chat, which means you can use TestDriver from your phone:
|
|
81
|
-
|
|
82
|
-
1. Open the GitHub app
|
|
83
|
-
2. Navigate to your repository
|
|
84
|
-
3. Tap the Copilot icon
|
|
85
|
-
4. Type `@testdriver` followed by your request
|
|
86
|
-
|
|
87
|
-
Screenshots and test progress appear in the chat, letting you create and debug tests on the go.
|
|
88
|
-
|
|
89
|
-
## Example: PR Review Workflow
|
|
90
|
-
|
|
91
|
-
Here's a complete workflow for adding tests during code review:
|
|
92
|
-
|
|
93
|
-
<Steps>
|
|
94
|
-
<Step title="Developer Opens PR">
|
|
95
|
-
A developer opens a pull request with a new feature.
|
|
96
|
-
</Step>
|
|
97
|
-
|
|
98
|
-
<Step title="Reviewer Requests Tests">
|
|
99
|
-
The reviewer comments:
|
|
100
|
-
```
|
|
101
|
-
@copilot Create a TestDriver test for this user registration flow.
|
|
102
|
-
Test both successful registration and validation errors.
|
|
103
|
-
```
|
|
104
|
-
</Step>
|
|
105
|
-
|
|
106
|
-
<Step title="Copilot Creates Tests">
|
|
107
|
-
Copilot spawns TestDriver, creates the tests, and commits them to the PR branch.
|
|
108
|
-
</Step>
|
|
109
|
-
|
|
110
|
-
<Step title="Tests Run in CI">
|
|
111
|
-
The new tests run automatically in CI, validating the feature works as expected.
|
|
112
|
-
</Step>
|
|
113
|
-
</Steps>
|
|
114
|
-
|
|
115
|
-
## Agent File Reference
|
|
116
|
-
|
|
117
|
-
The agent file at `.github/agents/testdriver.agent.md` contains the configuration for GitHub Copilot to use TestDriver. Here's the structure:
|
|
118
|
-
|
|
119
|
-
```yaml
|
|
120
|
-
---
|
|
121
|
-
name: testdriver
|
|
122
|
-
description: An expert at creating and refining automated tests using TestDriver.ai
|
|
123
|
-
mcp-servers:
|
|
124
|
-
testdriver:
|
|
125
|
-
command: npx
|
|
126
|
-
args:
|
|
127
|
-
- -p
|
|
128
|
-
- testdriverai
|
|
129
|
-
- testdriverai-mcp
|
|
130
|
-
env:
|
|
131
|
-
TD_API_KEY: ${TD_API_KEY}
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
# TestDriver Expert
|
|
135
|
-
|
|
136
|
-
You are an expert at writing automated tests using TestDriver...
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
The `TD_API_KEY` is pulled from your repository secrets when running in GitHub Actions or from your environment when using the web interface.
|
|
140
|
-
|
|
141
|
-
<Warning>
|
|
142
|
-
Make sure `TD_API_KEY` is set in your repository secrets for CI workflows. Go to **Settings → Secrets and variables → Actions** to add it.
|
|
143
|
-
</Warning>
|