testdriverai 7.1.4 → 7.2.2
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/acceptance.yaml +81 -0
- package/.github/workflows/publish.yaml +44 -0
- package/agent/index.js +18 -19
- package/agent/interface.js +4 -0
- package/agent/lib/commands.js +321 -121
- package/agent/lib/redraw.js +99 -39
- package/agent/lib/sandbox.js +98 -6
- package/agent/lib/sdk.js +25 -0
- package/agent/lib/system.js +2 -1
- package/agent/lib/validation.js +6 -6
- package/docs/docs.json +211 -101
- package/docs/snippets/tests/type-repeated-replay.mdx +1 -1
- package/docs/v7/_drafts/caching-selectors.mdx +24 -0
- package/docs/v7/api/act.mdx +1 -1
- package/docs/v7/api/assert.mdx +1 -1
- package/docs/v7/api/assertions.mdx +7 -7
- package/docs/v7/api/elements.mdx +78 -0
- package/docs/v7/api/find.mdx +38 -0
- package/docs/v7/api/focusApplication.mdx +2 -2
- package/docs/v7/api/hover.mdx +2 -2
- package/docs/v7/features/ai-native.mdx +57 -71
- package/docs/v7/features/application-logs.mdx +353 -0
- package/docs/v7/features/browser-logs.mdx +414 -0
- package/docs/v7/features/cache-management.mdx +402 -0
- package/docs/v7/features/continuous-testing.mdx +346 -0
- package/docs/v7/features/coverage.mdx +508 -0
- package/docs/v7/features/data-driven-testing.mdx +441 -0
- package/docs/v7/features/easy-to-write.mdx +2 -73
- package/docs/v7/features/enterprise.mdx +155 -39
- package/docs/v7/features/fast.mdx +63 -81
- package/docs/v7/features/managed-sandboxes.mdx +384 -0
- package/docs/v7/features/network-monitoring.mdx +568 -0
- package/docs/v7/features/observable.mdx +3 -22
- package/docs/v7/features/parallel-execution.mdx +381 -0
- package/docs/v7/features/powerful.mdx +1 -1
- package/docs/v7/features/reports.mdx +414 -0
- package/docs/v7/features/sandbox-customization.mdx +229 -0
- package/docs/v7/features/scalable.mdx +217 -2
- package/docs/v7/features/stable.mdx +106 -147
- package/docs/v7/features/system-performance.mdx +616 -0
- package/docs/v7/features/test-analytics.mdx +373 -0
- package/docs/v7/features/test-cases.mdx +393 -0
- package/docs/v7/features/test-replays.mdx +408 -0
- package/docs/v7/features/test-reports.mdx +308 -0
- package/docs/v7/getting-started/{running-and-debugging.mdx → debugging-tests.mdx} +12 -142
- package/docs/v7/getting-started/quickstart.mdx +22 -305
- package/docs/v7/getting-started/running-tests.mdx +173 -0
- package/docs/v7/overview/what-is-testdriver.mdx +2 -14
- package/docs/v7/presets/chrome-extension.mdx +147 -122
- package/interfaces/cli/commands/init.js +3 -3
- package/interfaces/cli/lib/base.js +3 -2
- package/interfaces/logger.js +0 -2
- package/interfaces/shared-test-state.mjs +0 -5
- package/interfaces/vitest-plugin.mjs +70 -50
- package/lib/core/Dashcam.js +60 -85
- package/lib/vitest/hooks.mjs +42 -50
- package/package.json +1 -1
- package/sdk-log-formatter.js +350 -175
- package/sdk.d.ts +36 -3
- package/sdk.js +431 -116
- package/setup/aws/cloudformation.yaml +2 -2
- package/setup/aws/self-hosted.yml +1 -1
- package/test/testdriver/chrome-extension.test.mjs +55 -72
- package/test/testdriver/element-not-found.test.mjs +2 -1
- package/test/testdriver/hover-image.test.mjs +1 -1
- package/test/testdriver/scroll-until-text.test.mjs +10 -6
- package/test/testdriver/setup/lifecycleHelpers.mjs +19 -24
- package/test/testdriver/setup/testHelpers.mjs +18 -23
- package/vitest.config.mjs +3 -3
- package/.github/workflows/linux-tests.yml +0 -28
- package/docs/v7/getting-started/generating-tests.mdx +0 -525
- package/test/testdriver/auto-cache-key-demo.test.mjs +0 -56
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Continuous Testing"
|
|
3
|
+
description: "Seamless CI/CD integration for automated testing at scale"
|
|
4
|
+
icon: "arrows-spin"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
TestDriver integrates seamlessly with all major CI/CD platforms, enabling automated testing from small projects to enterprise test suites with thousands of tests.
|
|
8
|
+
|
|
9
|
+
## Works with Vitest
|
|
10
|
+
|
|
11
|
+
Full integration with Vitest's powerful features:
|
|
12
|
+
|
|
13
|
+
```javascript vitest.config.mjs
|
|
14
|
+
import { defineConfig } from 'vitest/config';
|
|
15
|
+
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
test: {
|
|
18
|
+
testTimeout: 120000,
|
|
19
|
+
hookTimeout: 120000,
|
|
20
|
+
maxConcurrency: 10, // Run 10 tests in parallel
|
|
21
|
+
minThreads: 2,
|
|
22
|
+
maxThreads: 10,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<CardGroup cols={2}>
|
|
28
|
+
<Card title="Parallel Execution" icon="layer-group">
|
|
29
|
+
Run multiple tests simultaneously for maximum throughput:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Run all tests in parallel
|
|
33
|
+
npx vitest run
|
|
34
|
+
|
|
35
|
+
# Control concurrency
|
|
36
|
+
npx vitest run --max-concurrency=5
|
|
37
|
+
```
|
|
38
|
+
</Card>
|
|
39
|
+
|
|
40
|
+
<Card title="Watch Mode" icon="eye">
|
|
41
|
+
Instant feedback during development:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Run in watch mode
|
|
45
|
+
npx vitest
|
|
46
|
+
|
|
47
|
+
# Only run changed tests
|
|
48
|
+
npx vitest --changed
|
|
49
|
+
```
|
|
50
|
+
</Card>
|
|
51
|
+
</CardGroup>
|
|
52
|
+
|
|
53
|
+
[See complete Vitest integration guide](/v7/guides/vitest)
|
|
54
|
+
|
|
55
|
+
## CI/CD Compatible
|
|
56
|
+
|
|
57
|
+
TestDriver integrates seamlessly with all major CI/CD platforms:
|
|
58
|
+
|
|
59
|
+
<Tabs>
|
|
60
|
+
<Tab title="GitHub Actions">
|
|
61
|
+
```yaml .github/workflows/test.yml
|
|
62
|
+
name: E2E Tests
|
|
63
|
+
|
|
64
|
+
on: [push, pull_request]
|
|
65
|
+
|
|
66
|
+
jobs:
|
|
67
|
+
test:
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v3
|
|
71
|
+
- uses: actions/setup-node@v3
|
|
72
|
+
- run: npm install
|
|
73
|
+
- run: npx vitest run
|
|
74
|
+
env:
|
|
75
|
+
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
[GitHub Actions guide](/v7/guides/ci-cd/github-actions)
|
|
79
|
+
</Tab>
|
|
80
|
+
|
|
81
|
+
<Tab title="GitLab CI">
|
|
82
|
+
```yaml .gitlab-ci.yml
|
|
83
|
+
test:
|
|
84
|
+
image: node:20
|
|
85
|
+
script:
|
|
86
|
+
- npm install
|
|
87
|
+
- npx vitest run
|
|
88
|
+
variables:
|
|
89
|
+
TD_API_KEY: $TD_API_KEY
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
[GitLab CI guide](/v7/guides/ci-cd/gitlab)
|
|
93
|
+
</Tab>
|
|
94
|
+
|
|
95
|
+
<Tab title="CircleCI">
|
|
96
|
+
```yaml .circleci/config.yml
|
|
97
|
+
version: 2.1
|
|
98
|
+
jobs:
|
|
99
|
+
test:
|
|
100
|
+
docker:
|
|
101
|
+
- image: cimg/node:20.0
|
|
102
|
+
steps:
|
|
103
|
+
- checkout
|
|
104
|
+
- run: npm install
|
|
105
|
+
- run: npx vitest run
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
[CircleCI guide](/v7/guides/ci-cd/circleci)
|
|
109
|
+
</Tab>
|
|
110
|
+
|
|
111
|
+
<Tab title="Jenkins">
|
|
112
|
+
```groovy Jenkinsfile
|
|
113
|
+
pipeline {
|
|
114
|
+
agent any
|
|
115
|
+
stages {
|
|
116
|
+
stage('Test') {
|
|
117
|
+
steps {
|
|
118
|
+
sh 'npm install'
|
|
119
|
+
sh 'npx vitest run'
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
[Jenkins guide](/v7/guides/ci-cd/jenkins)
|
|
127
|
+
</Tab>
|
|
128
|
+
</Tabs>
|
|
129
|
+
|
|
130
|
+
## JUnit Reports
|
|
131
|
+
|
|
132
|
+
Generate JUnit XML reports for test result aggregation:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Generate JUnit report
|
|
136
|
+
npx vitest run --reporter=junit --outputFile=test-results.xml
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```xml test-results.xml
|
|
140
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
141
|
+
<testsuites name="vitest tests" tests="12" failures="0" errors="0" time="125.3">
|
|
142
|
+
<testsuite name="login.test.js" tests="3" failures="0" time="31.2">
|
|
143
|
+
<testcase name="user can login" time="12.4" />
|
|
144
|
+
<testcase name="invalid credentials show error" time="9.8" />
|
|
145
|
+
<testcase name="password reset works" time="9.0" />
|
|
146
|
+
</testsuite>
|
|
147
|
+
<!-- More test suites -->
|
|
148
|
+
</testsuites>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
<Check>
|
|
152
|
+
JUnit reports integrate with Jenkins, Azure DevOps, TeamCity, and other CI platforms for test result visualization.
|
|
153
|
+
</Check>
|
|
154
|
+
|
|
155
|
+
## Scale to Thousands of Tests
|
|
156
|
+
|
|
157
|
+
TestDriver handles large test suites efficiently:
|
|
158
|
+
|
|
159
|
+
<Card title="Enterprise Test Suite Example" icon="building">
|
|
160
|
+
```
|
|
161
|
+
Project: E-commerce Platform
|
|
162
|
+
Total tests: 3,847
|
|
163
|
+
Test files: 412
|
|
164
|
+
Parallel runners: 20
|
|
165
|
+
Total duration: 18 minutes
|
|
166
|
+
|
|
167
|
+
Breakdown:
|
|
168
|
+
- Unit tests: 2,134 (3 min)
|
|
169
|
+
- Integration: 891 (7 min)
|
|
170
|
+
- E2E (TestDriver): 822 (18 min)
|
|
171
|
+
|
|
172
|
+
Cost per run: $4.32
|
|
173
|
+
Runs per day: 50
|
|
174
|
+
Monthly cost: $6,480
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
With caching enabled:
|
|
178
|
+
```
|
|
179
|
+
E2E duration: 8 minutes (2.25x faster)
|
|
180
|
+
Cost per run: $1.89 (56% reduction)
|
|
181
|
+
Monthly cost: $2,835 (saves $3,645/month)
|
|
182
|
+
```
|
|
183
|
+
</Card>
|
|
184
|
+
|
|
185
|
+
## Test Sharding
|
|
186
|
+
|
|
187
|
+
Distribute tests across multiple machines:
|
|
188
|
+
|
|
189
|
+
<Tabs>
|
|
190
|
+
<Tab title="GitHub Actions Matrix">
|
|
191
|
+
```yaml .github/workflows/test.yml
|
|
192
|
+
strategy:
|
|
193
|
+
matrix:
|
|
194
|
+
shard: [1, 2, 3, 4, 5]
|
|
195
|
+
steps:
|
|
196
|
+
- run: npx vitest run --shard=${{ matrix.shard }}/5
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Runs 5 parallel jobs, each handling 1/5 of tests.
|
|
200
|
+
</Tab>
|
|
201
|
+
|
|
202
|
+
<Tab title="GitLab CI Parallel">
|
|
203
|
+
```yaml .gitlab-ci.yml
|
|
204
|
+
test:
|
|
205
|
+
parallel: 5
|
|
206
|
+
script:
|
|
207
|
+
- npx vitest run --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL
|
|
208
|
+
```
|
|
209
|
+
</Tab>
|
|
210
|
+
|
|
211
|
+
<Tab title="Manual Sharding">
|
|
212
|
+
```bash
|
|
213
|
+
# Machine 1
|
|
214
|
+
npx vitest run --shard=1/4
|
|
215
|
+
|
|
216
|
+
# Machine 2
|
|
217
|
+
npx vitest run --shard=2/4
|
|
218
|
+
|
|
219
|
+
# Machine 3
|
|
220
|
+
npx vitest run --shard=3/4
|
|
221
|
+
|
|
222
|
+
# Machine 4
|
|
223
|
+
npx vitest run --shard=4/4
|
|
224
|
+
```
|
|
225
|
+
</Tab>
|
|
226
|
+
</Tabs>
|
|
227
|
+
|
|
228
|
+
## Team Collaboration
|
|
229
|
+
|
|
230
|
+
Built for teams with multiple developers:
|
|
231
|
+
|
|
232
|
+
<AccordionGroup>
|
|
233
|
+
<Accordion title="Shared Test Cache">
|
|
234
|
+
Tests automatically benefit from each other's cache entries:
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
// Developer A runs test
|
|
238
|
+
await testdriver.find('submit button').click();
|
|
239
|
+
// Creates cache entry
|
|
240
|
+
|
|
241
|
+
// Developer B runs test later
|
|
242
|
+
await testdriver.find('submit button').click();
|
|
243
|
+
// Uses Developer A's cache ⚡
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Per-team cache sharing accelerates everyone's tests.
|
|
247
|
+
</Accordion>
|
|
248
|
+
|
|
249
|
+
<Accordion title="Dashcam Replays">
|
|
250
|
+
Share test replays with your team:
|
|
251
|
+
|
|
252
|
+
```javascript
|
|
253
|
+
test('shareable replay', async (context) => {
|
|
254
|
+
const { testdriver, dashcam } = await chrome(context, { url });
|
|
255
|
+
|
|
256
|
+
await testdriver.find('button').click();
|
|
257
|
+
|
|
258
|
+
// Share replay URL with team
|
|
259
|
+
console.log('Replay:', dashcam.url);
|
|
260
|
+
// https://console.testdriver.ai/dashcam/abc123
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
View replays at [app.testdriver.ai](https://app.testdriver.ai)
|
|
265
|
+
</Accordion>
|
|
266
|
+
|
|
267
|
+
<Accordion title="Sandbox Management">
|
|
268
|
+
Long-running sandboxes for team debugging:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Spawn a sandbox for the team
|
|
272
|
+
testdriver sandbox spawn --timeout 7200000
|
|
273
|
+
|
|
274
|
+
# Team members can connect
|
|
275
|
+
export TESTDRIVER_SANDBOX_ID=i-0abc123def
|
|
276
|
+
npx vitest run
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
[Learn about sandbox management](/agents.md#sandbox-management)
|
|
280
|
+
</Accordion>
|
|
281
|
+
</AccordionGroup>
|
|
282
|
+
|
|
283
|
+
## Cost Optimization
|
|
284
|
+
|
|
285
|
+
TestDriver scales cost-effectively:
|
|
286
|
+
|
|
287
|
+
<Card title="Pricing Model" icon="dollar-sign">
|
|
288
|
+
- **API calls:** Pay per AI vision analysis
|
|
289
|
+
- **Sandbox time:** Pay per minute of VM usage
|
|
290
|
+
- **Caching:** Reduces both costs dramatically
|
|
291
|
+
- **Shared cache:** Team benefits from collective cache
|
|
292
|
+
|
|
293
|
+
**Example costs:**
|
|
294
|
+
- Single test run: $0.04 - $0.12
|
|
295
|
+
- 100-test suite: $4 - $12 (first run)
|
|
296
|
+
- Cached suite: $0.50 - $2 (90%+ savings)
|
|
297
|
+
</Card>
|
|
298
|
+
|
|
299
|
+
## Enterprise Scale
|
|
300
|
+
|
|
301
|
+
TestDriver supports the largest testing operations:
|
|
302
|
+
|
|
303
|
+
- **Unlimited tests** in enterprise plans
|
|
304
|
+
- **Unlimited sandbox hours** for large suites
|
|
305
|
+
- **Unlimited team members** for collaboration
|
|
306
|
+
- **Priority infrastructure** for faster execution
|
|
307
|
+
- **Dedicated support** for optimization help
|
|
308
|
+
- **Custom SLA** for guaranteed uptime
|
|
309
|
+
|
|
310
|
+
[Contact sales](https://testdriver.ai/enterprise) for enterprise pricing.
|
|
311
|
+
|
|
312
|
+
## Learn More
|
|
313
|
+
|
|
314
|
+
<CardGroup cols={2}>
|
|
315
|
+
<Card
|
|
316
|
+
title="Vitest Integration"
|
|
317
|
+
icon="flask-vial"
|
|
318
|
+
href="/v7/guides/vitest"
|
|
319
|
+
>
|
|
320
|
+
Complete Vitest guide
|
|
321
|
+
</Card>
|
|
322
|
+
|
|
323
|
+
<Card
|
|
324
|
+
title="CI/CD Setup"
|
|
325
|
+
icon="arrows-spin"
|
|
326
|
+
href="/v7/guides/ci-cd/overview"
|
|
327
|
+
>
|
|
328
|
+
CI/CD integration guides
|
|
329
|
+
</Card>
|
|
330
|
+
|
|
331
|
+
<Card
|
|
332
|
+
title="Performance Optimization"
|
|
333
|
+
icon="gauge-high"
|
|
334
|
+
href="/v7/guides/performance"
|
|
335
|
+
>
|
|
336
|
+
Optimize test performance
|
|
337
|
+
</Card>
|
|
338
|
+
|
|
339
|
+
<Card
|
|
340
|
+
title="Self-Hosting"
|
|
341
|
+
icon="server"
|
|
342
|
+
href="/v7/guides/self-hosting"
|
|
343
|
+
>
|
|
344
|
+
Run on your infrastructure
|
|
345
|
+
</Card>
|
|
346
|
+
</CardGroup>
|