testdriverai 7.2.2 → 7.2.9
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/.github/workflows/publish.yaml +15 -7
- package/.github/workflows/testdriver.yml +36 -0
- package/agent/index.js +28 -109
- package/bin/testdriverai.js +8 -0
- package/debugger/index.html +37 -0
- package/docs/docs.json +2 -11
- package/docs/v7/_drafts/architecture.mdx +1 -26
- package/docs/v7/_drafts/provision.mdx +251 -188
- package/docs/v7/_drafts/quick-start-test-recording.mdx +0 -1
- package/docs/v7/_drafts/test-recording.mdx +0 -6
- package/docs/v7/api/act.mdx +1 -0
- package/docs/v7/getting-started/quickstart.mdx +9 -16
- package/interfaces/cli/commands/init.js +33 -19
- package/interfaces/cli/lib/base.js +24 -0
- package/interfaces/cli.js +8 -1
- package/interfaces/logger.js +8 -3
- package/interfaces/vitest-plugin.mjs +16 -71
- package/lib/sentry.js +343 -0
- package/lib/vitest/hooks.mjs +23 -31
- package/package.json +4 -3
- package/sdk-log-formatter.js +41 -0
- package/sdk.js +335 -94
- package/test/testdriver/act.test.mjs +30 -0
- package/test/testdriver/assert.test.mjs +1 -1
- package/test/testdriver/hover-text.test.mjs +1 -1
- package/test/testdriver/installer.test.mjs +47 -0
- package/test/testdriver/launch-vscode-linux.test.mjs +55 -0
- package/test/testdriver/setup/testHelpers.mjs +8 -118
- package/tests/example.test.js +33 -0
- package/tests/login.js +28 -0
- package/vitest.config.js +18 -0
- package/vitest.config.mjs +1 -0
- package/agent/lib/cache.js +0 -142
|
@@ -1,266 +1,329 @@
|
|
|
1
1
|
# Provision API
|
|
2
2
|
|
|
3
|
-
The `provision
|
|
3
|
+
The `provision` object provides easy setup methods for common applications. These methods automatically handle TestDriver initialization, Dashcam recording, and application launching.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
7
|
```javascript
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { describe, it, expect } from 'vitest';
|
|
9
|
+
import { TestDriver } from 'testdriverai/lib/vitest/hooks.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
describe('My Test Suite', () => {
|
|
12
|
+
it('should test Chrome browser', async (context) => {
|
|
13
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
14
|
+
|
|
15
|
+
await testdriver.provision.chrome({
|
|
16
|
+
url: 'https://example.com'
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
await testdriver.find('Login button').click();
|
|
20
|
+
});
|
|
17
21
|
});
|
|
18
22
|
```
|
|
19
23
|
|
|
20
|
-
##
|
|
21
|
-
|
|
22
|
-
```typescript
|
|
23
|
-
provision(appType, options, context)
|
|
24
|
-
```
|
|
24
|
+
## Available Methods
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
26
|
+
- `provision.chrome()` - Launch Chrome browser with URL
|
|
27
|
+
- `provision.vscode()` - Launch VS Code with optional extensions
|
|
28
|
+
- `provision.installer()` - Download and install applications
|
|
29
|
+
- `provision.electron()` - Launch Electron applications
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
- `testdriver` - TestDriver instance ready to use
|
|
33
|
-
- `dashcam` - Dashcam instance (if enabled)
|
|
34
|
-
- Additional app-specific properties (like `vscode`, `app`)
|
|
31
|
+
---
|
|
35
32
|
|
|
36
|
-
##
|
|
33
|
+
## provision.chrome()
|
|
37
34
|
|
|
38
|
-
|
|
35
|
+
Launch Google Chrome with automatic Dashcam recording.
|
|
39
36
|
|
|
40
37
|
```javascript
|
|
41
|
-
|
|
38
|
+
await testdriver.provision.chrome({
|
|
42
39
|
url: 'https://myapp.com',
|
|
43
|
-
maximized: true,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
os: 'linux' // Target OS (default: 'linux')
|
|
47
|
-
}, context);
|
|
48
|
-
|
|
49
|
-
await testdriver.find('username').type('user@example.com');
|
|
50
|
-
await testdriver.find('Login').click();
|
|
40
|
+
maximized: true,
|
|
41
|
+
extensionPath: '/path/to/extension'
|
|
42
|
+
});
|
|
51
43
|
```
|
|
52
44
|
|
|
53
45
|
**Options:**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
| Option | Type | Default | Description |
|
|
47
|
+
|--------|------|---------|-------------|
|
|
48
|
+
| `url` | string | `'http://testdriver-sandbox.vercel.app/'` | URL to navigate to |
|
|
49
|
+
| `maximized` | boolean | `true` | Start browser maximized |
|
|
50
|
+
| `extensionPath` | string | - | Path to Chrome extension to load |
|
|
59
51
|
|
|
60
|
-
**
|
|
61
|
-
- `testdriver` - TestDriver instance
|
|
62
|
-
- `dashcam` - Dashcam instance (if enabled)
|
|
63
|
-
|
|
64
|
-
### VS Code
|
|
52
|
+
**Example:**
|
|
65
53
|
|
|
66
54
|
```javascript
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
await
|
|
75
|
-
await
|
|
55
|
+
it('should login to my app', async (context) => {
|
|
56
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
57
|
+
|
|
58
|
+
await testdriver.provision.chrome({
|
|
59
|
+
url: 'https://myapp.com/login'
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
await testdriver.find('email input').type('user@example.com');
|
|
63
|
+
await testdriver.find('password input').type('password123');
|
|
64
|
+
await testdriver.find('Login button').click();
|
|
65
|
+
|
|
66
|
+
const result = await testdriver.assert('Dashboard is visible');
|
|
67
|
+
expect(result).toBeTruthy();
|
|
68
|
+
});
|
|
76
69
|
```
|
|
77
70
|
|
|
78
|
-
|
|
79
|
-
- `workspace` - Workspace/folder path to open (optional)
|
|
80
|
-
- `extensions` - Array of extension IDs to install (optional)
|
|
81
|
-
- `dashcam` - Enable Dashcam recording (default: `true`)
|
|
82
|
-
- `os` - Target OS (default: `'linux'`)
|
|
71
|
+
---
|
|
83
72
|
|
|
84
|
-
|
|
85
|
-
- `testdriver` - TestDriver instance
|
|
86
|
-
- `vscode` - Alias for testdriver (semantic clarity)
|
|
87
|
-
- `dashcam` - Dashcam instance (if enabled)
|
|
73
|
+
## provision.vscode()
|
|
88
74
|
|
|
89
|
-
|
|
75
|
+
Launch Visual Studio Code with optional extension installation. Automatically starts Dashcam recording.
|
|
90
76
|
|
|
91
77
|
```javascript
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
os: 'linux'
|
|
97
|
-
}, context);
|
|
98
|
-
|
|
99
|
-
await app.find('main window').click();
|
|
78
|
+
await testdriver.provision.vscode({
|
|
79
|
+
workspace: '/path/to/project',
|
|
80
|
+
extensions: ['esbenp.prettier-vscode', 'ms-python.python']
|
|
81
|
+
});
|
|
100
82
|
```
|
|
101
83
|
|
|
102
84
|
**Options:**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
85
|
+
| Option | Type | Default | Description |
|
|
86
|
+
|--------|------|---------|-------------|
|
|
87
|
+
| `workspace` | string | - | Workspace/folder path to open |
|
|
88
|
+
| `extensions` | string[] | `[]` | VS Code extension IDs to install |
|
|
107
89
|
|
|
108
|
-
**
|
|
109
|
-
- `testdriver` - TestDriver instance
|
|
110
|
-
- `app` - Alias for testdriver (semantic clarity)
|
|
111
|
-
- `dashcam` - Dashcam instance (if enabled)
|
|
112
|
-
|
|
113
|
-
### Web App
|
|
114
|
-
|
|
115
|
-
Generic wrapper for web applications (currently uses Chrome):
|
|
90
|
+
**Example - Basic Launch:**
|
|
116
91
|
|
|
117
92
|
```javascript
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
93
|
+
it('should launch VS Code', async (context) => {
|
|
94
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
95
|
+
|
|
96
|
+
await testdriver.provision.vscode();
|
|
97
|
+
|
|
98
|
+
const result = await testdriver.assert(
|
|
99
|
+
'Visual Studio Code window is visible on screen'
|
|
100
|
+
);
|
|
101
|
+
expect(result).toBeTruthy();
|
|
102
|
+
});
|
|
122
103
|
```
|
|
123
104
|
|
|
124
|
-
|
|
105
|
+
**Example - Install Extensions:**
|
|
125
106
|
|
|
126
107
|
```javascript
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const { testdriver, dashcam } = await provision('chrome', {
|
|
134
|
-
url: 'https://myapp.com/login',
|
|
135
|
-
maximized: true
|
|
136
|
-
}, context);
|
|
137
|
-
|
|
138
|
-
// Interact with the application
|
|
139
|
-
await testdriver.find('email input').type('user@example.com');
|
|
140
|
-
await testdriver.find('password input').type('password123');
|
|
141
|
-
await testdriver.find('Login button').click();
|
|
142
|
-
|
|
143
|
-
// Verify results
|
|
144
|
-
const result = await testdriver.assert('Welcome message is visible');
|
|
145
|
-
expect(result).toBeTruthy();
|
|
146
|
-
|
|
147
|
-
// Dashcam automatically stops and saves replay at test end
|
|
148
|
-
// No cleanup needed - handled automatically!
|
|
108
|
+
it('should install and use a VS Code extension', async (context) => {
|
|
109
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
110
|
+
|
|
111
|
+
// Launch VS Code with extensions installed
|
|
112
|
+
await testdriver.provision.vscode({
|
|
113
|
+
extensions: ['esbenp.prettier-vscode']
|
|
149
114
|
});
|
|
115
|
+
|
|
116
|
+
// Open the extensions panel
|
|
117
|
+
await testdriver.pressKeys(['ctrl', 'shift', 'x']);
|
|
118
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
119
|
+
|
|
120
|
+
const result = await testdriver.assert(
|
|
121
|
+
'Prettier extension is visible in the extensions panel'
|
|
122
|
+
);
|
|
123
|
+
expect(result).toBeTruthy();
|
|
150
124
|
});
|
|
151
125
|
```
|
|
152
126
|
|
|
153
|
-
|
|
127
|
+
---
|
|
154
128
|
|
|
155
|
-
|
|
129
|
+
## provision.installer()
|
|
156
130
|
|
|
157
|
-
|
|
158
|
-
2. **Sets up Dashcam** - Authenticates and starts recording (if enabled)
|
|
159
|
-
3. **Launches application** - Opens the specified app with your configuration
|
|
160
|
-
4. **Focuses window** - Ensures the app is ready for interaction
|
|
161
|
-
5. **Returns ready-to-use instances** - Everything is set up and ready
|
|
131
|
+
Download and install applications from a URL. Automatically detects file type and runs the appropriate install command.
|
|
162
132
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
133
|
+
```javascript
|
|
134
|
+
const filePath = await testdriver.provision.installer({
|
|
135
|
+
url: 'https://example.com/app.deb',
|
|
136
|
+
appName: 'MyApp'
|
|
137
|
+
});
|
|
138
|
+
```
|
|
169
139
|
|
|
170
|
-
|
|
140
|
+
**Options:**
|
|
141
|
+
| Option | Type | Default | Description |
|
|
142
|
+
|--------|------|---------|-------------|
|
|
143
|
+
| `url` | string | **required** | URL to download the installer from |
|
|
144
|
+
| `filename` | string | auto-detected | Filename to save as |
|
|
145
|
+
| `appName` | string | - | Application name to focus after install |
|
|
146
|
+
| `launch` | boolean | `true` | Whether to launch/focus the app after installation |
|
|
147
|
+
|
|
148
|
+
**Returns:** `Promise<string>` - Path to the downloaded file
|
|
149
|
+
|
|
150
|
+
**Supported File Types:**
|
|
151
|
+
|
|
152
|
+
| Platform | Extensions | Install Command |
|
|
153
|
+
|----------|------------|-----------------|
|
|
154
|
+
| Linux | `.deb` | `sudo dpkg -i && apt-get install -f -y` |
|
|
155
|
+
| Linux | `.rpm` | `sudo rpm -i` |
|
|
156
|
+
| Linux | `.appimage` | `chmod +x` |
|
|
157
|
+
| Linux | `.sh` | `chmod +x && execute` |
|
|
158
|
+
| Windows | `.msi` | `msiexec /i /quiet /norestart` |
|
|
159
|
+
| Windows | `.exe` | `Start-Process /S` |
|
|
160
|
+
| macOS | `.dmg` | `hdiutil attach && cp to /Applications` |
|
|
161
|
+
| macOS | `.pkg` | `installer -pkg -target /` |
|
|
162
|
+
|
|
163
|
+
**Example - Install .deb Package:**
|
|
171
164
|
|
|
172
165
|
```javascript
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
it('should install a .deb package', async (context) => {
|
|
167
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
168
|
+
|
|
169
|
+
const filePath = await testdriver.provision.installer({
|
|
170
|
+
url: 'https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_amd64.deb'
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// Verify installation
|
|
174
|
+
await testdriver.exec('sh', 'bat --version', 10000);
|
|
175
|
+
});
|
|
176
|
+
```
|
|
180
177
|
|
|
181
|
-
|
|
182
|
-
await dashcam.auth();
|
|
183
|
-
await dashcam.start();
|
|
178
|
+
**Example - Download Only (No Auto-Launch):**
|
|
184
179
|
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
```javascript
|
|
181
|
+
it('should download a script', async (context) => {
|
|
182
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
183
|
+
|
|
184
|
+
const filePath = await testdriver.provision.installer({
|
|
185
|
+
url: 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh',
|
|
186
|
+
launch: false
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
// Run custom post-download commands
|
|
190
|
+
await testdriver.exec('sh', `source "${filePath}"`, 30000);
|
|
191
|
+
});
|
|
192
|
+
```
|
|
187
193
|
|
|
188
|
-
|
|
194
|
+
**Example - Custom Post-Install:**
|
|
189
195
|
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
```javascript
|
|
197
|
+
it('should run AppImage with custom flags', async (context) => {
|
|
198
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
199
|
+
|
|
200
|
+
const filePath = await testdriver.provision.installer({
|
|
201
|
+
url: 'https://example.com/app.AppImage',
|
|
202
|
+
launch: false
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// Run with custom arguments
|
|
206
|
+
await testdriver.exec('sh', `"${filePath}" --no-sandbox &`, 10000);
|
|
207
|
+
|
|
208
|
+
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
209
|
+
|
|
210
|
+
const result = await testdriver.assert('App window is visible');
|
|
211
|
+
expect(result).toBeTruthy();
|
|
212
|
+
});
|
|
192
213
|
```
|
|
193
214
|
|
|
194
|
-
|
|
215
|
+
---
|
|
195
216
|
|
|
196
|
-
##
|
|
217
|
+
## provision.electron()
|
|
197
218
|
|
|
198
|
-
|
|
219
|
+
Launch an Electron application.
|
|
199
220
|
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const { testdriver } = await provision('chrome', {
|
|
205
|
-
url: 'https://example.com',
|
|
206
|
-
maximized: true,
|
|
207
|
-
os: 'linux' // ✅ Type-safe: only 'linux' | 'mac' | 'windows'
|
|
208
|
-
}, context);
|
|
209
|
-
|
|
210
|
-
// ✅ Full autocomplete for testdriver methods
|
|
211
|
-
await testdriver.find('button').click();
|
|
221
|
+
```javascript
|
|
222
|
+
await testdriver.provision.electron({
|
|
223
|
+
appPath: '/path/to/app',
|
|
224
|
+
args: ['--enable-logging']
|
|
212
225
|
});
|
|
213
226
|
```
|
|
214
227
|
|
|
215
|
-
|
|
228
|
+
**Options:**
|
|
229
|
+
| Option | Type | Default | Description |
|
|
230
|
+
|--------|------|---------|-------------|
|
|
231
|
+
| `appPath` | string | **required** | Path to Electron application |
|
|
232
|
+
| `args` | string[] | `[]` | Additional command-line arguments |
|
|
216
233
|
|
|
217
|
-
|
|
234
|
+
**Example:**
|
|
218
235
|
|
|
219
236
|
```javascript
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
workspace: '/path/to/project'
|
|
237
|
+
it('should launch Electron app', async (context) => {
|
|
238
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
239
|
+
|
|
240
|
+
await testdriver.provision.electron({
|
|
241
|
+
appPath: '/path/to/my-electron-app',
|
|
242
|
+
args: ['--enable-logging']
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
await testdriver.find('main window').click();
|
|
230
246
|
});
|
|
231
247
|
```
|
|
232
248
|
|
|
233
|
-
|
|
249
|
+
---
|
|
234
250
|
|
|
235
|
-
##
|
|
251
|
+
## How Provision Methods Work
|
|
252
|
+
|
|
253
|
+
When you call a provision method:
|
|
236
254
|
|
|
237
|
-
1. **
|
|
238
|
-
2. **
|
|
239
|
-
3. **
|
|
240
|
-
4. **
|
|
241
|
-
5. **
|
|
255
|
+
1. **Waits for connection** - Calls `ready()` to ensure sandbox is connected
|
|
256
|
+
2. **Sets up Dashcam** - Creates log file and adds to Dashcam monitoring
|
|
257
|
+
3. **Starts recording** - Automatically starts Dashcam if not already recording
|
|
258
|
+
4. **Launches application** - Opens the specified app with your configuration
|
|
259
|
+
5. **Focuses window** - Ensures the app is ready for interaction
|
|
242
260
|
|
|
243
|
-
|
|
261
|
+
At test end:
|
|
262
|
+
- Dashcam automatically stops and saves replay URL
|
|
263
|
+
- TestDriver automatically disconnects
|
|
264
|
+
- All cleanup is handled for you
|
|
265
|
+
|
|
266
|
+
## Complete Example
|
|
244
267
|
|
|
245
268
|
```javascript
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
269
|
+
import { describe, it, expect } from 'vitest';
|
|
270
|
+
import { TestDriver } from 'testdriverai/lib/vitest/hooks.mjs';
|
|
271
|
+
|
|
272
|
+
describe('Application Testing', () => {
|
|
273
|
+
it('should test Chrome login flow', async (context) => {
|
|
274
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
275
|
+
|
|
276
|
+
await testdriver.provision.chrome({
|
|
277
|
+
url: 'https://myapp.com/login'
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
await testdriver.find('email').type('user@example.com');
|
|
281
|
+
await testdriver.find('password').type('password123');
|
|
282
|
+
await testdriver.find('Login').click();
|
|
251
283
|
|
|
252
|
-
await testdriver.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
284
|
+
const result = await testdriver.assert('Welcome message is visible');
|
|
285
|
+
expect(result).toBeTruthy();
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('should test VS Code extension', async (context) => {
|
|
289
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
290
|
+
|
|
291
|
+
await testdriver.provision.vscode({
|
|
292
|
+
extensions: ['ms-python.python']
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
await testdriver.pressKeys(['ctrl', 'shift', 'p']);
|
|
296
|
+
await testdriver.type('Python: Select Interpreter');
|
|
297
|
+
await testdriver.pressKeys(['enter']);
|
|
298
|
+
|
|
299
|
+
const result = await testdriver.assert('Python interpreter selector is visible');
|
|
300
|
+
expect(result).toBeTruthy();
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it('should install and test CLI tool', async (context) => {
|
|
304
|
+
const testdriver = TestDriver(context, { newSandbox: true });
|
|
305
|
+
|
|
306
|
+
await testdriver.provision.installer({
|
|
307
|
+
url: 'https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_amd64.deb'
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// Verify the tool works
|
|
311
|
+
await testdriver.exec('sh', 'bat --help', 10000);
|
|
312
|
+
});
|
|
258
313
|
});
|
|
259
314
|
```
|
|
260
315
|
|
|
316
|
+
## Best Practices
|
|
317
|
+
|
|
318
|
+
1. **Use `newSandbox: true`** - Each test gets a clean environment
|
|
319
|
+
2. **Enable Dashcam** - Great for debugging test failures (enabled by default)
|
|
320
|
+
3. **Check assertions** - Always verify the expected state after actions
|
|
321
|
+
4. **Use appropriate provision method** - Match the method to your test target
|
|
322
|
+
5. **Handle async properly** - All provision methods return Promises
|
|
323
|
+
|
|
261
324
|
## See Also
|
|
262
325
|
|
|
263
|
-
- [Hooks API](./
|
|
264
|
-
- [
|
|
265
|
-
- [
|
|
266
|
-
- [
|
|
326
|
+
- [Hooks API](./hooks.mdx) - TestDriver initialization
|
|
327
|
+
- [Find API](../api/find.mdx) - Element finding
|
|
328
|
+
- [Exec API](../api/exec.mdx) - Running shell commands
|
|
329
|
+
- [Assert API](../api/assert.mdx) - AI-powered assertions
|
|
@@ -185,7 +185,6 @@ await client.completeTestRun({
|
|
|
185
185
|
**API (Backend)**
|
|
186
186
|
- `api/models/TdTestRun.js` - Test run model
|
|
187
187
|
- `api/models/TdTestCase.js` - Test case model
|
|
188
|
-
- `api/models/TdSandbox.js` - Sandbox tracking model
|
|
189
188
|
- `api/controllers/testdriver/testdriver-test-run-create.js` - Create test run endpoint
|
|
190
189
|
- `api/controllers/testdriver/testdriver-test-run-complete.js` - Complete test run endpoint
|
|
191
190
|
- `api/controllers/testdriver/testdriver-test-case-create.js` - Record test case endpoint
|
|
@@ -376,12 +376,6 @@ const run2 = await client.createTestRun({
|
|
|
376
376
|
- Associated dashcam replay
|
|
377
377
|
- Timing and duration
|
|
378
378
|
|
|
379
|
-
### TdSandbox
|
|
380
|
-
- VM/sandbox lifecycle tracking
|
|
381
|
-
- Platform and OS information
|
|
382
|
-
- Dashcam integration status
|
|
383
|
-
- Cost and usage metrics
|
|
384
|
-
|
|
385
379
|
### Replay
|
|
386
380
|
- Dashcam recordings
|
|
387
381
|
- Linked to test runs and cases
|
package/docs/v7/api/act.mdx
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Quick Start"
|
|
3
3
|
sidebarTitle: "Quickstart"
|
|
4
|
-
description: "
|
|
4
|
+
description: "Run your first computer-use test in minutes."
|
|
5
5
|
icon: "rocket"
|
|
6
6
|
mode: "wide"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
TestDriver makes it easy to write automated computer-use tests for web browsers, desktop apps, and more.
|
|
9
|
+
TestDriver makes it easy to write automated computer-use tests for web browsers, desktop apps, and more. Follow the directions below to run your first TestDriver test.
|
|
10
|
+
|
|
11
|
+
<Tip><a href="https://discord.com/invite/cWDFW8DzPm" target="_blank" rel="noreferrer">Join our Discord</a> if you have any questions or need help getting started!</Tip>
|
|
12
|
+
|
|
13
|
+
## Get Started in 3 Steps
|
|
10
14
|
|
|
11
15
|
<Steps>
|
|
12
16
|
<Step title="Create a TestDriver Account">
|
|
@@ -20,7 +24,7 @@ TestDriver makes it easy to write automated computer-use tests for web browsers,
|
|
|
20
24
|
arrow
|
|
21
25
|
horizontal
|
|
22
26
|
>
|
|
23
|
-
|
|
27
|
+
No credit-card required!
|
|
24
28
|
</Card>
|
|
25
29
|
|
|
26
30
|
</Step>
|
|
@@ -41,10 +45,10 @@ TestDriver makes it easy to write automated computer-use tests for web browsers,
|
|
|
41
45
|
TestDriver uses Vitest as the test runner. To run your test, use:
|
|
42
46
|
|
|
43
47
|
```bash
|
|
44
|
-
|
|
48
|
+
vitest run
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
This will spawn a sandbox, launch Chrome,
|
|
51
|
+
This will spawn a sandbox, launch Chrome, and run the example test!
|
|
48
52
|
|
|
49
53
|
</Step>
|
|
50
54
|
</Steps>
|
|
@@ -84,14 +88,3 @@ TestDriver makes it easy to write automated computer-use tests for web browsers,
|
|
|
84
88
|
Choose your complexity level
|
|
85
89
|
</Card>
|
|
86
90
|
</CardGroup>
|
|
87
|
-
|
|
88
|
-
## Why TestDriver v7?
|
|
89
|
-
|
|
90
|
-
The v7 SDK offers advantages over YAML-based testing:
|
|
91
|
-
|
|
92
|
-
- ✅ **Type Safety** - Full TypeScript support with IntelliSense
|
|
93
|
-
- ✅ **Programmatic Control** - Use variables, loops, and functions
|
|
94
|
-
- ✅ **Better Debugging** - Stack traces point to your actual code
|
|
95
|
-
- ✅ **Automatic Lifecycle** - Presets handle setup and cleanup
|
|
96
|
-
- ✅ **Framework Integration** - Works with Vitest, Jest, Mocha, etc.
|
|
97
|
-
- ✅ **Video Replays** - Automatic Dashcam recording included
|