@testdriverai/agent 7.11.240-test → 7.11.241-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-agent/SKILL.md +174 -91
- package/ai/skills/testdriver-assert/SKILL.md +73 -269
- package/ai/skills/testdriver-aws-setup/SKILL.md +194 -312
- package/ai/skills/testdriver-bring-your-own-machine/SKILL.md +137 -204
- package/ai/skills/testdriver-cache/SKILL.md +142 -149
- package/ai/skills/testdriver-caching/SKILL.md +97 -87
- package/ai/skills/testdriver-captcha/SKILL.md +126 -111
- package/ai/skills/testdriver-ci-cd/SKILL.md +153 -542
- package/ai/skills/testdriver-click/SKILL.md +74 -229
- package/ai/skills/testdriver-client/SKILL.md +175 -229
- package/ai/skills/testdriver-customizing-devices/SKILL.md +72 -250
- package/ai/skills/testdriver-dashcam/SKILL.md +71 -404
- package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +103 -369
- package/ai/skills/testdriver-double-click/SKILL.md +46 -67
- package/ai/skills/testdriver-errors/SKILL.md +102 -176
- package/ai/skills/testdriver-events/SKILL.md +170 -327
- package/ai/skills/testdriver-exec/SKILL.md +92 -256
- package/ai/skills/testdriver-extract/SKILL.md +69 -170
- package/ai/skills/testdriver-find/SKILL.md +140 -736
- package/ai/skills/testdriver-focus-application/SKILL.md +69 -246
- package/ai/skills/testdriver-generating-tests/SKILL.md +102 -136
- package/ai/skills/testdriver-hosted/SKILL.md +79 -143
- package/ai/skills/testdriver-hover/SKILL.md +62 -235
- package/ai/skills/testdriver-locating-elements/SKILL.md +71 -366
- package/ai/skills/testdriver-making-assertions/SKILL.md +114 -72
- package/ai/skills/testdriver-mcp-setup/SKILL.md +79 -62
- package/ai/skills/testdriver-mouse-down/SKILL.md +46 -124
- package/ai/skills/testdriver-mouse-up/SKILL.md +45 -128
- package/ai/skills/testdriver-options/SKILL.md +73 -46
- package/ai/skills/testdriver-parse/SKILL.md +95 -184
- package/ai/skills/testdriver-performing-actions/SKILL.md +101 -91
- package/ai/skills/testdriver-press-keys/SKILL.md +59 -299
- package/ai/skills/testdriver-provision/SKILL.md +135 -179
- package/ai/skills/testdriver-quickstart/SKILL.md +24 -8
- package/ai/skills/testdriver-quickstart-claude/SKILL.md +84 -0
- package/ai/skills/testdriver-quickstart-github/SKILL.md +62 -32
- package/ai/skills/testdriver-quickstart-manual/SKILL.md +59 -32
- package/ai/skills/testdriver-quickstart-vscode/SKILL.md +96 -0
- package/ai/skills/testdriver-redraw/SKILL.md +100 -164
- package/ai/skills/testdriver-reusable-code/SKILL.md +95 -199
- package/ai/skills/testdriver-right-click/SKILL.md +45 -88
- package/ai/skills/testdriver-screenshot/SKILL.md +47 -201
- package/ai/skills/testdriver-screenshots/SKILL.md +86 -136
- package/ai/skills/testdriver-scroll/SKILL.md +71 -154
- package/ai/skills/testdriver-secrets/SKILL.md +94 -90
- package/ai/skills/testdriver-self-hosted/SKILL.md +82 -140
- package/ai/skills/testdriver-test-results-json/SKILL.md +165 -202
- package/ai/skills/testdriver-type/SKILL.md +56 -304
- package/ai/skills/testdriver-variables/SKILL.md +119 -80
- package/ai/skills/testdriver-wait/SKILL.md +31 -29
- package/ai/skills/testdriver-what-is-testdriver/SKILL.md +80 -32
- package/package.json +1 -1
|
@@ -1,451 +1,118 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: testdriver:dashcam
|
|
3
|
-
description:
|
|
3
|
+
description: Every test is recorded as a video replay with logs, linked when the test ends.
|
|
4
4
|
---
|
|
5
5
|
<!-- Generated from dashcam.mdx. DO NOT EDIT. -->
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Dashcam records the sandbox screen while your test runs and saves it as a replay you can watch in the TestDriver console.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- Recording is on by default. You don't need to configure anything.
|
|
10
|
+
- The replay includes the console output from your test and, for websites, the page's network traffic.
|
|
11
|
+
- When the test ends, TestDriver prints a link to the replay.
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## How recording works
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
1. **A provision method starts it.** Every [provision method](/provision) starts Dashcam after it launches your app: `chrome()`, `chromeExtension()`, `vscode()`, `installer()`, `electron()`, and `dashcam()`.
|
|
16
|
+
2. **The test runs.** Everything on the sandbox screen is recorded.
|
|
17
|
+
3. **The test ends.** The [Vitest hook](/client#testdriver-context-options) stops the recording, uploads your test's console output to the replay, and prints the link:
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```javascript
|
|
18
|
-
import { test } from 'vitest';
|
|
19
|
-
import { chrome } from 'testdriverai/presets';
|
|
20
|
-
|
|
21
|
-
test('my test', async (context) => {
|
|
22
|
-
const { testdriver, dashcam } = await chrome(context, {
|
|
23
|
-
url: 'https://example.com'
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Test executes with recording automatically
|
|
27
|
-
await testdriver.find('login button').then(el => el.click());
|
|
28
|
-
|
|
29
|
-
// Dashcam URL available after test
|
|
30
|
-
console.log('Replay:', dashcam.url);
|
|
31
|
-
});
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Manual Setup
|
|
35
|
-
|
|
36
|
-
For more control, make a Dashcam instance directly:
|
|
37
|
-
|
|
38
|
-
```javascript
|
|
39
|
-
import TestDriver from 'testdriverai';
|
|
40
|
-
import Dashcam from 'testdriverai/lib/core/Dashcam.js';
|
|
41
|
-
|
|
42
|
-
const client = await TestDriver.create({ os: 'linux' });
|
|
43
|
-
const dashcam = new Dashcam(client, {
|
|
44
|
-
apiKey: process.env.DASHCAM_API_KEY
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
await dashcam.auth();
|
|
48
|
-
await dashcam.start();
|
|
49
|
-
|
|
50
|
-
// Run your tests
|
|
51
|
-
|
|
52
|
-
const url = await dashcam.stop();
|
|
53
|
-
console.log('Replay URL:', url);
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Constructor
|
|
57
|
-
|
|
58
|
-
Create a new Dashcam instance:
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
new Dashcam(client, options)
|
|
19
|
+
```text
|
|
20
|
+
🎥 Dashcam URL: https://console.testdriver.ai/replay/6789abcdef0123456789abcd
|
|
62
21
|
```
|
|
63
22
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<ParamField path="client" type="TestDriver" required>
|
|
67
|
-
TestDriver client instance
|
|
68
|
-
</ParamField>
|
|
69
|
-
|
|
70
|
-
<ParamField path="options" type="object">
|
|
71
|
-
Configuration options
|
|
72
|
-
|
|
73
|
-
<Expandable title="options properties">
|
|
74
|
-
<ParamField path="apiKey" type="string">
|
|
75
|
-
Dashcam API key for authentication. Set via `TD_API_KEY` environment variable.
|
|
76
|
-
</ParamField>
|
|
23
|
+
`chrome()` also records the network traffic for the domain of the URL it opens.
|
|
77
24
|
|
|
78
|
-
|
|
79
|
-
Automatically start recording after authentication
|
|
80
|
-
</ParamField>
|
|
25
|
+
When Vitest retries a failed test, each attempt gets its own recording and link.
|
|
81
26
|
|
|
82
|
-
|
|
83
|
-
Log configurations to add automatically
|
|
84
|
-
</ParamField>
|
|
85
|
-
</Expandable>
|
|
86
|
-
</ParamField>
|
|
27
|
+
## Add a log file to the replay
|
|
87
28
|
|
|
88
|
-
|
|
29
|
+
Call `provision.dashcam()` to show a log file from the sandbox next to the video. Call it before the method that launches your app, so the log is set up before recording starts:
|
|
89
30
|
|
|
90
|
-
|
|
31
|
+
```javascript tests/checkout.test.mjs
|
|
32
|
+
import { describe, expect, it } from 'vitest';
|
|
33
|
+
import { TestDriver } from 'testdriverai/vitest/hooks';
|
|
91
34
|
|
|
92
|
-
|
|
35
|
+
describe('Checkout', () => {
|
|
36
|
+
it('records the app log', async (context) => {
|
|
37
|
+
const testdriver = TestDriver(context);
|
|
93
38
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</ParamField>
|
|
101
|
-
|
|
102
|
-
**Returns:** `Promise<void>`
|
|
103
|
-
|
|
104
|
-
**Example:**
|
|
105
|
-
```javascript
|
|
106
|
-
await dashcam.auth('your-api-key');
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### start()
|
|
110
|
-
|
|
111
|
-
Start recording:
|
|
112
|
-
|
|
113
|
-
```javascript
|
|
114
|
-
await dashcam.start()
|
|
115
|
-
```
|
|
39
|
+
await testdriver.provision.dashcam({
|
|
40
|
+
title: 'Checkout flow',
|
|
41
|
+
logPath: '/tmp/my-app.log',
|
|
42
|
+
logName: 'App log',
|
|
43
|
+
});
|
|
44
|
+
await testdriver.provision.chrome({ url: 'https://testdriver-sandbox.vercel.app/login' });
|
|
116
45
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
await dashcam.start();
|
|
122
|
-
console.log('Recording started');
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### stop()
|
|
126
|
-
|
|
127
|
-
Stop recording and retrieve replay URL:
|
|
128
|
-
|
|
129
|
-
```javascript
|
|
130
|
-
await dashcam.stop()
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**Returns:** `Promise<string|null>` - Replay URL if available
|
|
134
|
-
|
|
135
|
-
**Example:**
|
|
136
|
-
```javascript
|
|
137
|
-
const url = await dashcam.stop();
|
|
138
|
-
if (url) {
|
|
139
|
-
console.log('Watch replay:', url);
|
|
140
|
-
} else {
|
|
141
|
-
console.log('No replay URL available');
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### addFileLog()
|
|
146
|
-
|
|
147
|
-
Track a log file in the recording:
|
|
148
|
-
|
|
149
|
-
```javascript
|
|
150
|
-
await dashcam.addFileLog(path, name)
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
<ParamField path="path" type="string" required>
|
|
154
|
-
Path to the log file
|
|
155
|
-
</ParamField>
|
|
156
|
-
|
|
157
|
-
<ParamField path="name" type="string" required>
|
|
158
|
-
Display name for the log in Dashcam
|
|
159
|
-
</ParamField>
|
|
160
|
-
|
|
161
|
-
**Returns:** `Promise<void>`
|
|
162
|
-
|
|
163
|
-
**Example:**
|
|
164
|
-
```javascript
|
|
165
|
-
// Linux/Mac
|
|
166
|
-
await dashcam.addFileLog('/tmp/app.log', 'Application Log');
|
|
167
|
-
|
|
168
|
-
// Windows
|
|
169
|
-
await dashcam.addFileLog('C:\\logs\\app.log', 'Application Log');
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### addApplicationLog()
|
|
173
|
-
|
|
174
|
-
Track application-specific logs:
|
|
175
|
-
|
|
176
|
-
```javascript
|
|
177
|
-
await dashcam.addApplicationLog(application, name)
|
|
46
|
+
const result = await testdriver.assert('the login form is visible');
|
|
47
|
+
expect(result).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
178
50
|
```
|
|
179
51
|
|
|
180
|
-
|
|
181
|
-
Application name to track
|
|
182
|
-
</ParamField>
|
|
52
|
+
TestDriver creates the file if it doesn't exist. Anything your app writes to it appears in the replay.
|
|
183
53
|
|
|
184
|
-
<ParamField path="
|
|
185
|
-
|
|
54
|
+
<ParamField path="logPath" type="string">
|
|
55
|
+
The log file in the sandbox. Defaults to `/tmp/testdriver.log` on Linux, or `C:\Users\testdriver\testdriver.log` on Windows.
|
|
186
56
|
</ParamField>
|
|
187
57
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
**Example:**
|
|
191
|
-
```javascript
|
|
192
|
-
await dashcam.addApplicationLog('Google Chrome', 'Browser Logs');
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### addWebLog()
|
|
196
|
-
|
|
197
|
-
Track web request logs by URL pattern:
|
|
198
|
-
|
|
199
|
-
```javascript
|
|
200
|
-
await dashcam.addWebLog(pattern, name)
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
<ParamField path="pattern" type="string" required>
|
|
204
|
-
URL pattern to match (e.g., `"*example.com*"`)
|
|
58
|
+
<ParamField path="logName" type="string" default="TestDriver Log">
|
|
59
|
+
The log's name in the replay.
|
|
205
60
|
</ParamField>
|
|
206
61
|
|
|
207
|
-
<ParamField path="
|
|
208
|
-
|
|
62
|
+
<ParamField path="webLogs" type="boolean" default="true">
|
|
63
|
+
Also record network traffic. It covers the domain opened with `chrome()` if that ran first, or all traffic otherwise.
|
|
209
64
|
</ParamField>
|
|
210
65
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
**Example:**
|
|
214
|
-
```javascript
|
|
215
|
-
await dashcam.addWebLog('*example.com*', 'Web Logs');
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### addLog()
|
|
219
|
-
|
|
220
|
-
Generic method to add any type of log:
|
|
221
|
-
|
|
222
|
-
```javascript
|
|
223
|
-
await dashcam.addLog(config)
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
<ParamField path="config" type="object" required>
|
|
227
|
-
Log configuration
|
|
228
|
-
|
|
229
|
-
<Expandable title="config properties">
|
|
230
|
-
<ParamField path="name" type="string" required>
|
|
231
|
-
Display name for the log
|
|
232
|
-
</ParamField>
|
|
233
|
-
|
|
234
|
-
<ParamField path="type" type="string" required>
|
|
235
|
-
Log type: `'file'`, `'application'`, or `'web'`
|
|
236
|
-
</ParamField>
|
|
237
|
-
|
|
238
|
-
<ParamField path="path" type="string">
|
|
239
|
-
File path (required for type='file')
|
|
240
|
-
</ParamField>
|
|
241
|
-
|
|
242
|
-
<ParamField path="application" type="string">
|
|
243
|
-
Application name (required for type='application')
|
|
244
|
-
</ParamField>
|
|
245
|
-
|
|
246
|
-
<ParamField path="pattern" type="string">
|
|
247
|
-
URL pattern to match (required for type='web', e.g., `"*example.com*"`)
|
|
248
|
-
</ParamField>
|
|
249
|
-
</Expandable>
|
|
66
|
+
<ParamField path="title" type="string">
|
|
67
|
+
The recording's title. Defaults to the test file's name and the test's name, such as `checkout - records the app log`.
|
|
250
68
|
</ParamField>
|
|
251
69
|
|
|
252
|
-
|
|
70
|
+
## Turn recording off
|
|
253
71
|
|
|
254
|
-
|
|
255
|
-
```javascript
|
|
256
|
-
await dashcam.addLog({
|
|
257
|
-
name: 'Test Output',
|
|
258
|
-
type: 'file',
|
|
259
|
-
path: '/tmp/test.log'
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
await dashcam.addLog({
|
|
263
|
-
name: 'Chrome Logs',
|
|
264
|
-
type: 'application',
|
|
265
|
-
application: 'Google Chrome'
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
await dashcam.addLog({
|
|
269
|
-
name: 'Web Logs',
|
|
270
|
-
type: 'web',
|
|
271
|
-
pattern: '*example.com*'
|
|
272
|
-
});
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### isRecording()
|
|
276
|
-
|
|
277
|
-
Check if currently recording:
|
|
72
|
+
Pass `dashcam: false` when you create the client:
|
|
278
73
|
|
|
279
74
|
```javascript
|
|
280
|
-
|
|
75
|
+
const testdriver = TestDriver(context, { dashcam: false });
|
|
281
76
|
```
|
|
282
77
|
|
|
283
|
-
|
|
78
|
+
Provision methods then skip recording, and the test prints no replay link.
|
|
284
79
|
|
|
285
|
-
|
|
286
|
-
```javascript
|
|
287
|
-
if (await dashcam.isRecording()) {
|
|
288
|
-
console.log('Recording in progress');
|
|
289
|
-
}
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
## Properties
|
|
293
|
-
|
|
294
|
-
### recording
|
|
80
|
+
## Control the recording yourself
|
|
295
81
|
|
|
296
|
-
|
|
82
|
+
`testdriver.dashcam` gives you direct control of the recorder. Most tests don't need it, because the provision methods and the Vitest hook handle recording for you.
|
|
297
83
|
|
|
298
84
|
```javascript
|
|
299
|
-
dashcam.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
### apiKey
|
|
85
|
+
await testdriver.dashcam.addApplicationLog('Google Chrome', 'Browser logs');
|
|
86
|
+
await testdriver.dashcam.start();
|
|
303
87
|
|
|
304
|
-
|
|
88
|
+
// ...test steps...
|
|
305
89
|
|
|
306
|
-
|
|
307
|
-
|
|
90
|
+
const replayUrl = await testdriver.dashcam.stop();
|
|
91
|
+
console.log(replayUrl);
|
|
308
92
|
```
|
|
309
93
|
|
|
310
|
-
|
|
94
|
+
| Method | What it does |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `start()` | Starts recording. Does nothing if it's already recording. |
|
|
97
|
+
| `stop()` | Stops recording and resolves to the replay URL, or `null` if there isn't one. |
|
|
98
|
+
| `isRecording()` | Resolves to `true` while recording. |
|
|
99
|
+
| `setTitle(title)` | Sets the title. Call it before `start()`. |
|
|
100
|
+
| `addFileLog(path, name)` | Adds a log file from the sandbox to the replay. |
|
|
101
|
+
| `addApplicationLog(application, name)` | Adds an application's logs to the replay. |
|
|
102
|
+
| `addWebLog(pattern, name)` | Records network traffic for URLs matching `pattern`, such as `'*example.com*'`. |
|
|
103
|
+
| `getElapsedTime()` | Milliseconds since recording started, or `null` when not recording. |
|
|
311
104
|
|
|
312
|
-
|
|
105
|
+
Add logs before you call `start()`. If you call `stop()` yourself, the Vitest hook doesn't print the link, so log it as shown above.
|
|
313
106
|
|
|
314
|
-
|
|
315
|
-
dashcam.client // TestDriver instance
|
|
316
|
-
```
|
|
107
|
+
With `dashcam: false`, these methods do nothing and `stop()` resolves to `null`.
|
|
317
108
|
|
|
318
|
-
|
|
109
|
+
<Note>
|
|
110
|
+
Older tests may use `chrome()` from `testdriverai/presets` to get a `dashcam` object. Presets are deprecated. Use `TestDriver(context)` and a provision method instead.
|
|
111
|
+
</Note>
|
|
319
112
|
|
|
320
|
-
|
|
113
|
+
## Related
|
|
321
114
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
test('record test execution', async () => {
|
|
328
|
-
const client = await TestDriver.create({ os: 'linux' });
|
|
329
|
-
const dashcam = new Dashcam(client);
|
|
330
|
-
|
|
331
|
-
await dashcam.auth();
|
|
332
|
-
await dashcam.start();
|
|
333
|
-
|
|
334
|
-
// Run your test
|
|
335
|
-
await client.find('button').then(el => el.click());
|
|
336
|
-
|
|
337
|
-
const url = await dashcam.stop();
|
|
338
|
-
console.log('Replay:', url);
|
|
339
|
-
|
|
340
|
-
await client.cleanup();
|
|
341
|
-
});
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### With Log Tracking
|
|
345
|
-
|
|
346
|
-
```javascript
|
|
347
|
-
test('record with logs', async () => {
|
|
348
|
-
const client = await TestDriver.create({ os: 'linux' });
|
|
349
|
-
const dashcam = new Dashcam(client);
|
|
350
|
-
|
|
351
|
-
await dashcam.auth();
|
|
352
|
-
|
|
353
|
-
// Add log files before starting
|
|
354
|
-
await dashcam.addFileLog('/tmp/testdriver.log', 'TestDriver Log');
|
|
355
|
-
await dashcam.addFileLog('/tmp/app.log', 'Application Log');
|
|
356
|
-
|
|
357
|
-
await dashcam.start();
|
|
358
|
-
|
|
359
|
-
// Test execution
|
|
360
|
-
await client.find('login button').then(el => el.click());
|
|
361
|
-
|
|
362
|
-
const url = await dashcam.stop();
|
|
363
|
-
console.log('Replay with logs:', url);
|
|
364
|
-
|
|
365
|
-
await client.cleanup();
|
|
366
|
-
});
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Auto-start Configuration
|
|
370
|
-
|
|
371
|
-
```javascript
|
|
372
|
-
test('auto-start recording', async () => {
|
|
373
|
-
const client = await TestDriver.create({ os: 'linux' });
|
|
374
|
-
const dashcam = new Dashcam(client, {
|
|
375
|
-
autoStart: true,
|
|
376
|
-
logs: [
|
|
377
|
-
{
|
|
378
|
-
name: 'App Log',
|
|
379
|
-
type: 'file',
|
|
380
|
-
path: '/tmp/app.log'
|
|
381
|
-
}
|
|
382
|
-
]
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
await dashcam.auth(); // Automatically starts recording
|
|
386
|
-
|
|
387
|
-
// Test execution
|
|
388
|
-
await client.find('submit button').then(el => el.click());
|
|
389
|
-
|
|
390
|
-
const url = await dashcam.stop();
|
|
391
|
-
console.log('Replay:', url);
|
|
392
|
-
|
|
393
|
-
await client.cleanup();
|
|
394
|
-
});
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
### Using with Presets
|
|
398
|
-
|
|
399
|
-
```javascript
|
|
400
|
-
import { chrome } from 'testdriverai/presets';
|
|
401
|
-
|
|
402
|
-
test('preset with dashcam', async (context) => {
|
|
403
|
-
const { testdriver, dashcam } = await chrome(context, {
|
|
404
|
-
url: 'https://example.com',
|
|
405
|
-
dashcam: true // Enabled by default
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
// Test runs with automatic recording
|
|
409
|
-
await testdriver.find('button').then(el => el.click());
|
|
410
|
-
|
|
411
|
-
// URL automatically available
|
|
412
|
-
console.log('Replay:', dashcam.url);
|
|
413
|
-
});
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
### Disabling Dashcam in Presets
|
|
417
|
-
|
|
418
|
-
```javascript
|
|
419
|
-
test('without dashcam', async (context) => {
|
|
420
|
-
const { testdriver } = await chrome(context, {
|
|
421
|
-
url: 'https://example.com',
|
|
422
|
-
dashcam: false // Disable recording
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
// Test runs without recording (faster)
|
|
426
|
-
await testdriver.find('button').then(el => el.click());
|
|
427
|
-
});
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
## Platform Differences
|
|
431
|
-
|
|
432
|
-
### Windows
|
|
433
|
-
|
|
434
|
-
On Windows, Dashcam uses PowerShell commands and installs via npm:
|
|
435
|
-
|
|
436
|
-
```javascript
|
|
437
|
-
// Windows-specific paths
|
|
438
|
-
await dashcam.addFileLog(
|
|
439
|
-
'C:\\Users\\testdriver\\Documents\\testdriver.log',
|
|
440
|
-
'TestDriver Log'
|
|
441
|
-
);
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
### Linux/Mac
|
|
445
|
-
|
|
446
|
-
On Linux/Mac, Dashcam uses shell commands:
|
|
447
|
-
|
|
448
|
-
```javascript
|
|
449
|
-
// Unix-specific paths
|
|
450
|
-
await dashcam.addFileLog('/tmp/testdriver.log', 'TestDriver Log');
|
|
451
|
-
```
|
|
115
|
+
- [Launch apps](/provision): the provision methods that start recording
|
|
116
|
+
- [Debug a failing test](/debugging-with-screenshots): use the replay to find out why a test failed
|
|
117
|
+
- [Test result JSON](/test-results-json): read the replay URL from a file after the run
|
|
118
|
+
- [Options](/options#preview-and-recording): every client option
|