testdriverai 7.9.32-test → 7.9.34-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/ai/skills/testdriver:ai/SKILL.md +204 -0
  2. package/ai/skills/testdriver:assert/SKILL.md +315 -0
  3. package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
  4. package/ai/skills/testdriver:cache/SKILL.md +221 -0
  5. package/ai/skills/testdriver:caching/SKILL.md +124 -0
  6. package/ai/skills/testdriver:captcha/SKILL.md +158 -0
  7. package/ai/skills/testdriver:ci-cd/SKILL.md +602 -0
  8. package/ai/skills/testdriver:click/SKILL.md +286 -0
  9. package/ai/skills/testdriver:client/SKILL.md +477 -0
  10. package/ai/skills/testdriver:customizing-devices/SKILL.md +319 -0
  11. package/ai/skills/testdriver:dashcam/SKILL.md +451 -0
  12. package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +415 -0
  13. package/ai/skills/testdriver:device-config/SKILL.md +317 -0
  14. package/ai/skills/testdriver:double-click/SKILL.md +102 -0
  15. package/ai/skills/testdriver:elements/SKILL.md +605 -0
  16. package/ai/skills/testdriver:enterprise/SKILL.md +7 -0
  17. package/ai/skills/testdriver:errors/SKILL.md +246 -0
  18. package/ai/skills/testdriver:events/SKILL.md +356 -0
  19. package/ai/skills/testdriver:exec/SKILL.md +317 -0
  20. package/ai/skills/testdriver:find/SKILL.md +860 -0
  21. package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
  22. package/ai/skills/testdriver:generating-tests/SKILL.md +36 -0
  23. package/ai/skills/testdriver:hosted/SKILL.md +156 -0
  24. package/ai/skills/testdriver:hover/SKILL.md +278 -0
  25. package/ai/skills/testdriver:locating-elements/SKILL.md +71 -0
  26. package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
  27. package/ai/skills/testdriver:mcp/SKILL.md +7 -0
  28. package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
  29. package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
  30. package/ai/skills/testdriver:parse/SKILL.md +236 -0
  31. package/ai/skills/testdriver:performing-actions/SKILL.md +53 -0
  32. package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
  33. package/ai/skills/testdriver:provision/SKILL.md +331 -0
  34. package/ai/skills/testdriver:quickstart/SKILL.md +172 -0
  35. package/ai/skills/testdriver:redraw/SKILL.md +214 -0
  36. package/ai/skills/testdriver:reusable-code/SKILL.md +249 -0
  37. package/ai/skills/testdriver:right-click/SKILL.md +123 -0
  38. package/ai/skills/testdriver:running-tests/SKILL.md +185 -0
  39. package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
  40. package/ai/skills/testdriver:screenshots/SKILL.md +184 -0
  41. package/ai/skills/testdriver:scroll/SKILL.md +205 -0
  42. package/ai/skills/testdriver:secrets/SKILL.md +115 -0
  43. package/ai/skills/testdriver:self-hosted/SKILL.md +147 -0
  44. package/ai/skills/testdriver:test-results-json/SKILL.md +257 -0
  45. package/ai/skills/testdriver:testdriver/SKILL.md +624 -0
  46. package/ai/skills/testdriver:type/SKILL.md +357 -0
  47. package/ai/skills/testdriver:variables/SKILL.md +111 -0
  48. package/ai/skills/testdriver:wait/SKILL.md +50 -0
  49. package/ai/skills/testdriver:waiting-for-elements/SKILL.md +90 -0
  50. package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  51. package/docs/_data/examples-manifest.json +42 -42
  52. package/docs/v7/debugging-with-screenshots.mdx +14 -0
  53. package/docs/v7/examples/ai.mdx +1 -1
  54. package/docs/v7/examples/assert.mdx +1 -1
  55. package/docs/v7/examples/chrome-extension.mdx +2 -2
  56. package/docs/v7/examples/element-not-found.mdx +1 -1
  57. package/docs/v7/examples/exec-output.mdx +1 -1
  58. package/docs/v7/examples/exec-pwsh.mdx +1 -1
  59. package/docs/v7/examples/findall-coffee-icons.mdx +1 -1
  60. package/docs/v7/examples/focus-window.mdx +1 -1
  61. package/docs/v7/examples/hover-image.mdx +1 -1
  62. package/docs/v7/examples/hover-text-with-description.mdx +1 -1
  63. package/docs/v7/examples/hover-text.mdx +1 -1
  64. package/docs/v7/examples/installer.mdx +1 -1
  65. package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
  66. package/docs/v7/examples/parse.mdx +1 -1
  67. package/docs/v7/examples/press-keys.mdx +1 -1
  68. package/docs/v7/examples/prompt.mdx +1 -1
  69. package/docs/v7/examples/scroll-keyboard.mdx +1 -1
  70. package/docs/v7/examples/scroll-until-image.mdx +1 -1
  71. package/docs/v7/examples/scroll.mdx +1 -1
  72. package/docs/v7/examples/type.mdx +1 -1
  73. package/docs/v7/examples/windows-installer.mdx +1 -1
  74. package/docs/v7/find.mdx +33 -0
  75. package/examples/chrome-extension.test.mjs +1 -1
  76. package/package.json +1 -1
  77. package/setup/aws/spawn-runner.sh +24 -3
@@ -0,0 +1,451 @@
1
+ ---
2
+ name: testdriver:dashcam
3
+ description: Record test execution with video and logs
4
+ ---
5
+ <!-- Generated from dashcam.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
8
+
9
+ Dashcam provides automatic video recording and log aggregation for your tests. It captures screen recordings, application logs, and test execution details that can be reviewed later.
10
+
11
+ ## Basic Usage
12
+
13
+ ### With Presets
14
+
15
+ Most presets automatically include Dashcam:
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, create 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)
62
+ ```
63
+
64
+ ### Parameters
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" default="4e93d8bf-3886-4d26-a144-116c4063522d">
75
+ Dashcam API key for authentication
76
+ </ParamField>
77
+
78
+ <ParamField path="autoStart" type="boolean" default={false}>
79
+ Automatically start recording after authentication
80
+ </ParamField>
81
+
82
+ <ParamField path="logs" type="array" default={[]}>
83
+ Log configurations to add automatically
84
+ </ParamField>
85
+ </Expandable>
86
+ </ParamField>
87
+
88
+ ## Methods
89
+
90
+ ### auth()
91
+
92
+ Authenticate with Dashcam service:
93
+
94
+ ```javascript
95
+ await dashcam.auth(apiKey)
96
+ ```
97
+
98
+ <ParamField path="apiKey" type="string" optional>
99
+ Override the API key set in constructor
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
+ ```
116
+
117
+ **Returns:** `Promise<void>`
118
+
119
+ **Example:**
120
+ ```javascript
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)
178
+ ```
179
+
180
+ <ParamField path="application" type="string" required>
181
+ Application name to track
182
+ </ParamField>
183
+
184
+ <ParamField path="name" type="string" required>
185
+ Display name for the log
186
+ </ParamField>
187
+
188
+ **Returns:** `Promise<void>`
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*"`)
205
+ </ParamField>
206
+
207
+ <ParamField path="name" type="string" required>
208
+ Display name for the log
209
+ </ParamField>
210
+
211
+ **Returns:** `Promise<void>`
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>
250
+ </ParamField>
251
+
252
+ **Returns:** `Promise<void>`
253
+
254
+ **Example:**
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:
278
+
279
+ ```javascript
280
+ await dashcam.isRecording()
281
+ ```
282
+
283
+ **Returns:** `Promise<boolean>` - True if recording is active
284
+
285
+ **Example:**
286
+ ```javascript
287
+ if (await dashcam.isRecording()) {
288
+ console.log('Recording in progress');
289
+ }
290
+ ```
291
+
292
+ ## Properties
293
+
294
+ ### recording
295
+
296
+ Current recording state:
297
+
298
+ ```javascript
299
+ dashcam.recording // boolean
300
+ ```
301
+
302
+ ### apiKey
303
+
304
+ Configured API key:
305
+
306
+ ```javascript
307
+ dashcam.apiKey // string
308
+ ```
309
+
310
+ ### client
311
+
312
+ Associated TestDriver client:
313
+
314
+ ```javascript
315
+ dashcam.client // TestDriver instance
316
+ ```
317
+
318
+ ## Complete Examples
319
+
320
+ ### Basic Recording
321
+
322
+ ```javascript
323
+ import { test } from 'vitest';
324
+ import TestDriver from 'testdriverai';
325
+ import Dashcam from 'testdriverai/lib/core/Dashcam.js';
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
+ ```