testdriverai 7.8.0-test.7 → 7.8.0-test.71
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/agent/index.js +18 -5
- package/agent/lib/commands.js +3 -2
- package/agent/lib/http.js +162 -0
- package/agent/lib/logger.js +15 -0
- package/agent/lib/sandbox.js +554 -209
- package/agent/lib/sdk.js +5 -22
- package/agent/lib/system.js +25 -65
- package/ai/skills/testdriver-cache/SKILL.md +221 -0
- package/ai/skills/testdriver-errors/SKILL.md +246 -0
- package/ai/skills/testdriver-events/SKILL.md +356 -0
- package/ai/skills/testdriver-find/SKILL.md +14 -20
- package/ai/skills/testdriver-mcp/SKILL.md +7 -0
- package/ai/skills/testdriver-provision/SKILL.md +331 -0
- package/ai/skills/testdriver-redraw/SKILL.md +214 -0
- package/ai/skills/testdriver-running-tests/SKILL.md +1 -1
- package/ai/skills/testdriver-screenshots/SKILL.md +184 -0
- package/docs/_data/examples-manifest.json +46 -46
- package/docs/_scripts/extract-example-urls.js +67 -72
- package/docs/changelog.mdx +148 -8
- package/docs/docs.json +46 -38
- package/docs/images/content/vscode/v7-chat.png +0 -0
- package/docs/images/content/vscode/v7-choose-agent.png +0 -0
- package/docs/images/content/vscode/v7-full.png +0 -0
- package/docs/images/content/vscode/v7-onboarding.png +0 -0
- package/docs/v7/cache.mdx +223 -0
- package/docs/v7/copilot/auto-healing.mdx +265 -0
- package/docs/v7/copilot/creating-tests.mdx +156 -0
- package/docs/v7/copilot/github.mdx +143 -0
- package/docs/v7/copilot/running-tests.mdx +149 -0
- package/docs/v7/copilot/setup.mdx +143 -0
- package/docs/v7/enterprise.mdx +3 -110
- package/docs/v7/errors.mdx +248 -0
- package/docs/v7/events.mdx +358 -0
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/captcha-api.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +1 -1
- package/docs/v7/examples/drag-and-drop.mdx +1 -1
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/exec-output.mdx +85 -0
- package/docs/v7/examples/exec-pwsh.mdx +83 -0
- package/docs/v7/examples/focus-window.mdx +62 -0
- package/docs/v7/examples/hover-image.mdx +1 -1
- package/docs/v7/examples/hover-text.mdx +1 -1
- package/docs/v7/examples/installer.mdx +1 -1
- package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
- package/docs/v7/examples/match-image.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/scroll-keyboard.mdx +1 -1
- package/docs/v7/examples/scroll-until-image.mdx +1 -1
- package/docs/v7/examples/scroll-until-text.mdx +1 -1
- package/docs/v7/examples/scroll.mdx +1 -1
- package/docs/v7/examples/type.mdx +1 -1
- package/docs/v7/examples/windows-installer.mdx +1 -1
- package/docs/v7/find.mdx +14 -20
- package/docs/v7/{cloud.mdx → hosted.mdx} +43 -5
- package/docs/v7/mcp.mdx +9 -0
- package/docs/v7/provision.mdx +333 -0
- package/docs/v7/quickstart.mdx +30 -2
- package/docs/v7/redraw.mdx +216 -0
- package/docs/v7/running-tests.mdx +1 -1
- package/docs/v7/screenshots.mdx +186 -0
- package/docs/v7/self-hosted.mdx +127 -44
- package/docs/v7/test-results-json.mdx +258 -0
- package/examples/scroll-keyboard.test.mjs +1 -1
- package/examples/scroll.test.mjs +1 -12
- package/interfaces/logger.js +0 -12
- package/interfaces/vitest-plugin.mjs +170 -51
- package/lib/core/Dashcam.js +30 -23
- package/lib/environments.json +22 -0
- package/lib/github-comment.mjs +58 -40
- package/lib/init-project.js +5 -67
- package/lib/resolve-channel.js +42 -12
- package/lib/sentry.js +47 -23
- package/lib/vitest/hooks.mjs +63 -3
- package/{examples → manual}/drag-and-drop.test.mjs +1 -1
- package/manual/exec-stream-logs.test.mjs +25 -0
- package/mcp-server/dist/server.mjs +28 -8
- package/mcp-server/src/server.ts +31 -8
- package/package.json +4 -3
- package/sdk.d.ts +4 -0
- package/sdk.js +45 -15
- package/setup/aws/install-dev-runner.sh +79 -0
- package/setup/aws/spawn-runner.sh +165 -0
- package/test-sentry-span.js +35 -0
- package/vitest.config.mjs +22 -34
- package/vitest.runner.config.mjs +33 -0
- /package/{examples → manual}/flake-diffthreshold-001.test.mjs +0 -0
- /package/{examples → manual}/flake-diffthreshold-01.test.mjs +0 -0
- /package/{examples → manual}/flake-diffthreshold-05.test.mjs +0 -0
- /package/{examples → manual}/flake-noredraw-cache.test.mjs +0 -0
- /package/{examples → manual}/flake-noredraw-nocache.test.mjs +0 -0
- /package/{examples → manual}/flake-redraw-cache.test.mjs +0 -0
- /package/{examples → manual}/flake-redraw-nocache.test.mjs +0 -0
- /package/{examples → manual}/flake-rocket-match.test.mjs +0 -0
- /package/{examples → manual}/flake-shared.mjs +0 -0
- /package/{examples → manual}/no-provision.test.mjs +0 -0
- /package/{examples → manual}/scroll-until-text.test.mjs +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Redraw"
|
|
3
|
+
sidebarTitle: "Redraw"
|
|
4
|
+
description: "Wait for the screen to stabilize after interactions"
|
|
5
|
+
icon: "rotate"
|
|
6
|
+
mode: "wide"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
The redraw system waits for the screen to stabilize after an interaction before continuing. It detects when animations, page loads, and network requests have settled, preventing actions from being performed on a changing screen.
|
|
12
|
+
|
|
13
|
+
<Note>
|
|
14
|
+
**Redraw is disabled by default since v7.3.** Enable it explicitly if your tests interact with applications that have significant animations or loading states.
|
|
15
|
+
</Note>
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
Redraw uses a **two-phase detection** approach:
|
|
20
|
+
|
|
21
|
+
1. **Change Detection** — Compare the current frame to the initial screenshot taken right after the action. If the pixel diff exceeds 0.1%, the screen has changed.
|
|
22
|
+
2. **Stability Detection** — Compare consecutive frames using z-score analysis. When the diff between frames drops below 0.1% or the z-score is negative (current diff is below average), the screen has settled.
|
|
23
|
+
|
|
24
|
+
The screen is considered **settled** when both phases complete: the screen changed from the initial state AND consecutive frames are now stable.
|
|
25
|
+
|
|
26
|
+
```mermaid
|
|
27
|
+
flowchart TD
|
|
28
|
+
A[Action performed] --> B{Phase 1: Change Detection\ndiffFromInitial > 0.1%?}
|
|
29
|
+
B -- "Yes (screen changed)" --> C{Phase 2: Stability\nz-score < 0 or\ndiffPercent < 0.1%?}
|
|
30
|
+
C -- "Yes (frames stable)" --> D[Screen settled ✓]
|
|
31
|
+
B -- "No (waiting...)" --> B
|
|
32
|
+
C -- "No (waiting...)" --> C
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Polling
|
|
36
|
+
|
|
37
|
+
The system polls at **500ms intervals**, comparing screenshot frames. This reduces WebSocket traffic while still providing responsive detection.
|
|
38
|
+
|
|
39
|
+
### Pixel Comparison
|
|
40
|
+
|
|
41
|
+
Uses [pixelmatch](https://github.com/mapbox/pixelmatch) for per-pixel comparison with a threshold of `0.1` for pixel sensitivity. A frame diff above **0.1% of total pixels** indicates the screen has changed.
|
|
42
|
+
|
|
43
|
+
### Z-Score Analysis
|
|
44
|
+
|
|
45
|
+
Screen stability uses statistical analysis of the last **10 measurements**:
|
|
46
|
+
|
|
47
|
+
1. Calculate the mean and standard deviation of consecutive frame diffs
|
|
48
|
+
2. Compute the z-score: `(currentDiff - mean) / stddev`
|
|
49
|
+
3. Screen is stable when `diffPercent < 0.1%` or `z-score < 0` (current diff is below the average)
|
|
50
|
+
|
|
51
|
+
This approach adapts to the specific animation patterns of your application rather than using a fixed threshold.
|
|
52
|
+
|
|
53
|
+
## Per-Command Timeouts
|
|
54
|
+
|
|
55
|
+
Each command type has a specific redraw timeout:
|
|
56
|
+
|
|
57
|
+
| Command | Timeout | Reason |
|
|
58
|
+
|---------|---------|--------|
|
|
59
|
+
| `click` | 5000ms | Page navigations, modal openings |
|
|
60
|
+
| `hover` (within click) | 5000ms | Same as click |
|
|
61
|
+
| `hover` (standalone) | 2500ms | Tooltip animations |
|
|
62
|
+
| `scroll` | 5000ms | Lazy-loaded content |
|
|
63
|
+
| `type` | 5000ms | Autocomplete, validation |
|
|
64
|
+
| `pressKeys` | 5000ms | Keyboard shortcuts may trigger changes |
|
|
65
|
+
| `focusApplication` | 1000ms | Window focus animations |
|
|
66
|
+
|
|
67
|
+
If the timeout is reached before the screen settles, the command continues anyway. The timeout event is available via the `redraw:complete` event.
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
### Constructor Options
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
const testdriver = new TestDriver({
|
|
75
|
+
// Shorthand: enable/disable
|
|
76
|
+
redraw: true, // enable with defaults
|
|
77
|
+
redraw: false, // disable (default since v7.3)
|
|
78
|
+
|
|
79
|
+
// Full configuration
|
|
80
|
+
redraw: {
|
|
81
|
+
enabled: true,
|
|
82
|
+
screenRedraw: true, // enable screen pixel diff detection
|
|
83
|
+
networkMonitor: false, // enable network settling detection
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
<ParamField path="redraw" type="RedrawConfig | boolean" default={false}>
|
|
89
|
+
Redraw configuration. Pass `true`/`false` for shorthand, or an object for fine-grained control.
|
|
90
|
+
|
|
91
|
+
<Expandable title="properties">
|
|
92
|
+
<ParamField path="enabled" type="boolean" default={false}>
|
|
93
|
+
Enable or disable the redraw system. Default changed to `false` in v7.3.
|
|
94
|
+
</ParamField>
|
|
95
|
+
|
|
96
|
+
<ParamField path="screenRedraw" type="boolean" default={true}>
|
|
97
|
+
Enable pixel-diff-based screen change detection. If both `screenRedraw` and `networkMonitor` are `false`, redraw auto-disables.
|
|
98
|
+
</ParamField>
|
|
99
|
+
|
|
100
|
+
<ParamField path="networkMonitor" type="boolean" default={false}>
|
|
101
|
+
Enable network traffic monitoring for settling detection. Monitors WebSocket traffic on the sandbox to detect when network activity subsides.
|
|
102
|
+
</ParamField>
|
|
103
|
+
</Expandable>
|
|
104
|
+
</ParamField>
|
|
105
|
+
|
|
106
|
+
### Per-Command Override
|
|
107
|
+
|
|
108
|
+
Override redraw settings for individual commands:
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
// Enable redraw for a specific click
|
|
112
|
+
await testdriver.find('load more').click({
|
|
113
|
+
redraw: { enabled: true },
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Disable redraw for a fast interaction
|
|
117
|
+
await testdriver.find('checkbox').click({
|
|
118
|
+
redraw: false,
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Network Settling
|
|
123
|
+
|
|
124
|
+
When `networkMonitor` is enabled, the system also monitors sandbox network traffic:
|
|
125
|
+
|
|
126
|
+
- Polls for `totalBytesReceived` and `totalBytesSent` from the sandbox
|
|
127
|
+
- Keeps the last **60 measurements**
|
|
128
|
+
- Calculates z-scores for both RX and TX byte rates
|
|
129
|
+
- Network is **settled** when both RX and TX z-scores are negative (traffic is below average)
|
|
130
|
+
- Has a **10-second timeout** for network polling
|
|
131
|
+
- Non-critical: network errors are logged but never throw
|
|
132
|
+
|
|
133
|
+
The final settling condition requires **both** screen AND network to be settled (when both are enabled).
|
|
134
|
+
|
|
135
|
+
## Events
|
|
136
|
+
|
|
137
|
+
The redraw system emits events through the SDK emitter. See [Events](/v7/events) for the full event reference.
|
|
138
|
+
|
|
139
|
+
| Event | Description |
|
|
140
|
+
|---|---|
|
|
141
|
+
| `redraw:status` | Emitted on each poll with current screen diff, network stats, and timeout info |
|
|
142
|
+
| `redraw:complete` | Emitted when redraw resolves (settled or timed out) |
|
|
143
|
+
|
|
144
|
+
```javascript
|
|
145
|
+
testdriver.emitter.on('redraw:status', (status) => {
|
|
146
|
+
console.log(`Screen: ${status.redraw.text}`);
|
|
147
|
+
console.log(`Network: ${status.network.text}`);
|
|
148
|
+
console.log(`Timeout: ${status.timeout.text}`);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
testdriver.emitter.on('redraw:complete', (result) => {
|
|
152
|
+
if (result.isTimeout) {
|
|
153
|
+
console.warn(`Redraw timed out after ${result.timeElapsed}ms`);
|
|
154
|
+
} else {
|
|
155
|
+
console.log(`Screen settled in ${result.timeElapsed}ms`);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## When to Use Redraw
|
|
161
|
+
|
|
162
|
+
**Enable redraw when:**
|
|
163
|
+
- Testing single-page applications (SPAs) with route transitions
|
|
164
|
+
- Interacting with pages that lazy-load content on scroll
|
|
165
|
+
- Clicking buttons that trigger animations or modals
|
|
166
|
+
- Testing apps with significant network-driven UI updates
|
|
167
|
+
|
|
168
|
+
**Keep redraw disabled when:**
|
|
169
|
+
- Tests are already stable without it
|
|
170
|
+
- You want faster test execution
|
|
171
|
+
- Your application has minimal animations
|
|
172
|
+
- You're using explicit waits or assertions instead
|
|
173
|
+
|
|
174
|
+
## Types
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
interface RedrawConfig {
|
|
178
|
+
enabled?: boolean; // Default: false (since v7.3)
|
|
179
|
+
screenRedraw?: boolean; // Default: true
|
|
180
|
+
networkMonitor?: boolean; // Default: false
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface RedrawStatusEvent {
|
|
184
|
+
redraw: {
|
|
185
|
+
enabled: boolean;
|
|
186
|
+
settled: boolean;
|
|
187
|
+
hasChangedFromInitial: boolean;
|
|
188
|
+
consecutiveFramesStable: number;
|
|
189
|
+
diffFromInitial: number;
|
|
190
|
+
diffFromLast: number;
|
|
191
|
+
text: string;
|
|
192
|
+
};
|
|
193
|
+
network: {
|
|
194
|
+
enabled: boolean;
|
|
195
|
+
settled: boolean;
|
|
196
|
+
rxBytes: number;
|
|
197
|
+
txBytes: number;
|
|
198
|
+
text: string;
|
|
199
|
+
};
|
|
200
|
+
timeout: {
|
|
201
|
+
isTimeout: boolean;
|
|
202
|
+
elapsed: number;
|
|
203
|
+
max: number;
|
|
204
|
+
text: string;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
interface RedrawCompleteEvent {
|
|
209
|
+
screenSettled: boolean;
|
|
210
|
+
hasChangedFromInitial: boolean;
|
|
211
|
+
consecutiveFramesStable: number;
|
|
212
|
+
networkSettled: boolean;
|
|
213
|
+
isTimeout: boolean;
|
|
214
|
+
timeElapsed: number;
|
|
215
|
+
}
|
|
216
|
+
```
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Screenshots"
|
|
3
|
+
sidebarTitle: "Screenshots"
|
|
4
|
+
description: "Capture and manage screenshots during test execution"
|
|
5
|
+
icon: "camera"
|
|
6
|
+
mode: "wide"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
TestDriver can capture screenshots manually at any point during a test, or automatically before and after every command. Screenshots are saved to a structured directory for easy debugging.
|
|
12
|
+
|
|
13
|
+
## Manual Screenshots
|
|
14
|
+
|
|
15
|
+
Use `testdriver.screenshot()` to capture the current screen:
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
const path = await testdriver.screenshot();
|
|
19
|
+
console.log('Saved to:', path);
|
|
20
|
+
// .testdriver/screenshots/my-test/screenshot-1719849312345.png
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Options
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
await testdriver.screenshot(filename?)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
<ParamField path="filename" type="string">
|
|
30
|
+
Custom filename for the screenshot. `.png` is appended automatically if missing. If omitted, defaults to `screenshot-<timestamp>.png`.
|
|
31
|
+
</ParamField>
|
|
32
|
+
|
|
33
|
+
**Returns:** `Promise<string>` — the absolute file path of the saved screenshot.
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
// Default filename
|
|
37
|
+
await testdriver.screenshot();
|
|
38
|
+
// → .testdriver/screenshots/my-test/screenshot-1719849312345.png
|
|
39
|
+
|
|
40
|
+
// Custom filename
|
|
41
|
+
await testdriver.screenshot('login-page');
|
|
42
|
+
// → .testdriver/screenshots/my-test/login-page.png
|
|
43
|
+
|
|
44
|
+
// With .png extension
|
|
45
|
+
await testdriver.screenshot('dashboard-loaded.png');
|
|
46
|
+
// → .testdriver/screenshots/my-test/dashboard-loaded.png
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Auto Screenshots
|
|
50
|
+
|
|
51
|
+
Enable automatic screenshots before and after every command:
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
const testdriver = new TestDriver({
|
|
55
|
+
autoScreenshots: true,
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
<ParamField path="autoScreenshots" type="boolean" default={false}>
|
|
60
|
+
When `true`, captures a screenshot before and after every SDK command (`click`, `type`, `find`, `scroll`, `hover`, `pressKeys`, `assert`, `exec`, etc.). On error, an error-phase screenshot replaces the after-phase screenshot.
|
|
61
|
+
</ParamField>
|
|
62
|
+
|
|
63
|
+
### Filename Format
|
|
64
|
+
|
|
65
|
+
Auto-screenshots follow this naming convention:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
<seq>-<action>-<phase>-L<line>-<description>.png
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| Part | Description | Example |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `seq` | 3-digit zero-padded sequence number | `001` |
|
|
74
|
+
| `action` | Command name | `click`, `type`, `find` |
|
|
75
|
+
| `phase` | `before`, `after`, or `error` | `before` |
|
|
76
|
+
| `L<line>` | Source line number from your test file | `L42` |
|
|
77
|
+
| `description` | Sanitized from command arguments (max 30 chars) | `submit-button` |
|
|
78
|
+
|
|
79
|
+
**Examples:**
|
|
80
|
+
```
|
|
81
|
+
001-find-before-L15-login-button.png
|
|
82
|
+
002-find-after-L15-login-button.png
|
|
83
|
+
003-click-before-L16-login-button.png
|
|
84
|
+
004-click-after-L16-login-button.png
|
|
85
|
+
005-type-before-L18-username-field.png
|
|
86
|
+
006-type-error-L18-username-field.png
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Phases
|
|
90
|
+
|
|
91
|
+
| Phase | When | Description |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `before` | Before command executes | Captures the screen state before the action |
|
|
94
|
+
| `after` | After successful command | Captures the result of the action |
|
|
95
|
+
| `error` | After failed command | Captures the screen at the point of failure (replaces `after`) |
|
|
96
|
+
|
|
97
|
+
## Screenshot Directory
|
|
98
|
+
|
|
99
|
+
Screenshots are saved to:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
<cwd>/.testdriver/screenshots/<testFileName>/
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Where `<testFileName>` is the test file name without its extension. For example, a test at `tests/login.test.mjs` saves screenshots to `.testdriver/screenshots/login.test/`.
|
|
106
|
+
|
|
107
|
+
### Directory Cleanup
|
|
108
|
+
|
|
109
|
+
The screenshot directory for each test file is **automatically cleaned** at the start of a test run. This happens once per process per test file to prevent concurrent tests from the same file from interfering with each other.
|
|
110
|
+
|
|
111
|
+
## Debug Screenshots
|
|
112
|
+
|
|
113
|
+
Elements have a `saveDebugScreenshot()` method for debugging element detection:
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
const el = await testdriver.find('submit button');
|
|
117
|
+
|
|
118
|
+
// Save the screenshot that was used to detect this element
|
|
119
|
+
const debugPath = await el.saveDebugScreenshot();
|
|
120
|
+
console.log('Debug screenshot:', debugPath);
|
|
121
|
+
// → ./debug-screenshot-1719849312345.png
|
|
122
|
+
|
|
123
|
+
// Custom path
|
|
124
|
+
await el.saveDebugScreenshot('./my-debug.png');
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This saves the screenshot that was captured during the `find()` call, which can be useful for understanding what the AI "saw" when locating the element.
|
|
128
|
+
|
|
129
|
+
## Complete Example
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
import { describe, it, beforeAll, afterAll } from 'vitest';
|
|
133
|
+
import TestDriver from 'testdriverai';
|
|
134
|
+
|
|
135
|
+
describe('Screenshot Example', () => {
|
|
136
|
+
let testdriver;
|
|
137
|
+
|
|
138
|
+
beforeAll(async () => {
|
|
139
|
+
testdriver = new TestDriver({
|
|
140
|
+
autoScreenshots: true, // capture every step
|
|
141
|
+
});
|
|
142
|
+
await testdriver.ready();
|
|
143
|
+
await testdriver.provision.chrome({ url: 'https://example.com' });
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
afterAll(async () => {
|
|
147
|
+
await testdriver.disconnect();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('captures the login flow', async () => {
|
|
151
|
+
// Auto-screenshots capture before/after each command
|
|
152
|
+
|
|
153
|
+
// Manual screenshot for a specific moment
|
|
154
|
+
await testdriver.screenshot('initial-page-load');
|
|
155
|
+
|
|
156
|
+
const username = await testdriver.find('username input');
|
|
157
|
+
await username.click();
|
|
158
|
+
await testdriver.type('testuser@example.com');
|
|
159
|
+
|
|
160
|
+
await testdriver.screenshot('after-username-entry');
|
|
161
|
+
|
|
162
|
+
const password = await testdriver.find('password input');
|
|
163
|
+
await password.click();
|
|
164
|
+
await testdriver.type('password123');
|
|
165
|
+
|
|
166
|
+
await testdriver.find('login button').click();
|
|
167
|
+
|
|
168
|
+
await testdriver.screenshot('after-login-click');
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
After running, your screenshot directory will contain:
|
|
174
|
+
```
|
|
175
|
+
.testdriver/screenshots/login-flow.test/
|
|
176
|
+
├── initial-page-load.png
|
|
177
|
+
├── 001-find-before-L18-username-input.png
|
|
178
|
+
├── 002-find-after-L18-username-input.png
|
|
179
|
+
├── 003-click-before-L19-username-input.png
|
|
180
|
+
├── 004-click-after-L19-username-input.png
|
|
181
|
+
├── 005-type-before-L20-testuser-example-com.png
|
|
182
|
+
├── 006-type-after-L20-testuser-example-com.png
|
|
183
|
+
├── after-username-entry.png
|
|
184
|
+
├── 007-find-before-L24-password-input.png
|
|
185
|
+
├── ...
|
|
186
|
+
```
|
package/docs/v7/self-hosted.mdx
CHANGED
|
@@ -1,24 +1,50 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Self-Hosted"
|
|
2
|
+
title: "Self-Hosted (Enterprise)"
|
|
3
3
|
sidebarTitle: "Self-Hosted"
|
|
4
|
-
description: "
|
|
4
|
+
description: "Our enterprise solution with unlimited test execution, assisted setup, and dedicated support."
|
|
5
5
|
icon: "server"
|
|
6
|
+
mode: "wide"
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
Self-hosted
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
Self-hosted is our enterprise solution for teams that need unlimited test execution, infrastructure control, and dedicated support. Pricing is based on **parallel test capacity** with a flat license fee — no per-second billing.
|
|
10
|
+
|
|
11
|
+
<CardGroup cols={2}>
|
|
12
|
+
<Card title="Unlimited Execution" icon="infinity">
|
|
13
|
+
Run as many tests as you want with no device-second metering. Predictable monthly costs.
|
|
14
|
+
</Card>
|
|
15
|
+
<Card title="Assisted Setup & Support" icon="headset">
|
|
16
|
+
Our team helps you deploy, configure, and optimize your infrastructure. Dedicated engineering support included.
|
|
17
|
+
</Card>
|
|
18
|
+
<Card title="Full Control" icon="gear">
|
|
19
|
+
Use your own AI keys, custom hardware, specific software, and network configurations. RDP into test machines for debugging.
|
|
20
|
+
</Card>
|
|
21
|
+
<Card title="Security & Compliance" icon="shield-check">
|
|
22
|
+
Keep data in your environment. Air-gapped deployment available for regulated industries.
|
|
23
|
+
</Card>
|
|
24
|
+
</CardGroup>
|
|
25
|
+
|
|
26
|
+
## Deployment Options
|
|
27
|
+
|
|
28
|
+
Choose the level of control you need:
|
|
29
|
+
|
|
30
|
+
| Component | Standard | Air-Gapped |
|
|
31
|
+
|-----------|----------|------------|
|
|
32
|
+
| **Test Sandboxes** | Your AWS | Your infrastructure (any cloud or on-prem) |
|
|
33
|
+
| **Dashboard** | TestDriver hosted | Your infrastructure |
|
|
34
|
+
| **API** | TestDriver hosted | Your infrastructure |
|
|
35
|
+
| **AI Processing** | Your API keys | Your infrastructure |
|
|
36
|
+
| **Data Storage** | Your AWS account | 100% your infrastructure |
|
|
37
|
+
| **Network** | Internet access required | Fully air-gapped |
|
|
38
|
+
| **Cloud Providers** | AWS | AWS, Azure, GCP, on-prem |
|
|
39
|
+
|
|
40
|
+
### Standard Deployment
|
|
41
|
+
|
|
42
|
+
Run test sandboxes on your AWS infrastructure while using TestDriver's hosted dashboard and API:
|
|
43
|
+
|
|
44
|
+
- **Quick setup** via CloudFormation — deploy in hours
|
|
45
|
+
- **Dashboard access** at [console.testdriver.ai](https://console.testdriver.ai)
|
|
46
|
+
- **Your AI keys** — control costs with your own OpenAI, Anthropic, or other provider
|
|
47
|
+
- **Custom AMIs** — install specific software, configure networking
|
|
22
48
|
|
|
23
49
|
<Card
|
|
24
50
|
title="AWS Setup Guide"
|
|
@@ -28,39 +54,96 @@ Ready to self-host? Follow our comprehensive AWS setup guide:
|
|
|
28
54
|
Step-by-step instructions for deploying TestDriver on your AWS infrastructure using CloudFormation.
|
|
29
55
|
</Card>
|
|
30
56
|
|
|
57
|
+
### Air-Gapped Deployment
|
|
58
|
+
|
|
59
|
+
Deploy the entire TestDriver stack in your environment for complete isolation:
|
|
60
|
+
|
|
61
|
+
- **Full stack** — dashboard, API, and test infrastructure all in your environment
|
|
62
|
+
- **No external dependencies** — data never leaves your network perimeter
|
|
63
|
+
- **Any infrastructure** — AWS, Azure, GCP, or on-premises
|
|
64
|
+
- **Regulated industries** — government, defense, healthcare, finance
|
|
65
|
+
|
|
66
|
+
## Custom VM Images
|
|
67
|
+
|
|
68
|
+
Build test environments with your applications, dependencies, and user data pre-installed. You get full access to:
|
|
69
|
+
|
|
70
|
+
- **Golden VM** — our pre-configured base image with TestDriver agent, drivers, and optimizations
|
|
71
|
+
- **Packer scripts** — build custom AMIs with your applications, user data, and configurations
|
|
72
|
+
- **Faster test startup** — skip installation steps by baking dependencies into your image
|
|
73
|
+
- **Consistent environments** — every test runs on an identical, reproducible machine
|
|
74
|
+
|
|
75
|
+
<AccordionGroup>
|
|
76
|
+
<Accordion title="What can you customize?">
|
|
77
|
+
- Install applications (browsers, desktop apps, dev tools)
|
|
78
|
+
- Configure user accounts and credentials
|
|
79
|
+
- Set up network proxies and certificates
|
|
80
|
+
- Install fonts, language packs, and locales
|
|
81
|
+
- Pre-seed databases or test fixtures
|
|
82
|
+
- Configure Windows/Linux settings
|
|
83
|
+
</Accordion>
|
|
84
|
+
|
|
85
|
+
<Accordion title="How it works">
|
|
86
|
+
1. We provide our golden VM base image and Packer scripts
|
|
87
|
+
2. You customize the scripts to install your software and configuration
|
|
88
|
+
3. Run Packer to build your custom AMI
|
|
89
|
+
4. Configure TestDriver to use your custom AMI for test sandboxes
|
|
90
|
+
5. Tests spin up with everything pre-installed — no setup time wasted
|
|
91
|
+
</Accordion>
|
|
92
|
+
</AccordionGroup>
|
|
93
|
+
|
|
94
|
+
## Implementation Process
|
|
95
|
+
|
|
96
|
+
<Steps>
|
|
97
|
+
<Step title="Discovery Call">
|
|
98
|
+
Discuss your requirements, security constraints, and integration needs with our team.
|
|
99
|
+
</Step>
|
|
100
|
+
|
|
101
|
+
<Step title="Architecture Review">
|
|
102
|
+
Our engineers design a deployment architecture that meets your security and compliance requirements.
|
|
103
|
+
</Step>
|
|
104
|
+
|
|
105
|
+
<Step title="Deployment">
|
|
106
|
+
We work with your team to deploy TestDriver, including assisted setup and configuration.
|
|
107
|
+
</Step>
|
|
108
|
+
|
|
109
|
+
<Step title="Integration">
|
|
110
|
+
Connect TestDriver to your CI/CD pipelines, internal tools, and workflows.
|
|
111
|
+
</Step>
|
|
112
|
+
|
|
113
|
+
<Step title="Training & Handoff">
|
|
114
|
+
Comprehensive training for your team on operating and maintaining the deployment.
|
|
115
|
+
</Step>
|
|
116
|
+
</Steps>
|
|
117
|
+
|
|
118
|
+
## What's Included
|
|
31
119
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **Prefer predictable costs** — Budget with confidence using flat monthly fees
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## How It Works
|
|
42
|
-
|
|
43
|
-
With self-hosting, you run test sandboxes on your own AWS infrastructure. TestDriver still provides:
|
|
44
|
-
|
|
45
|
-
- **Dashboard** — View test results, analytics, and reports at [console.testdriver.ai](https://console.testdriver.ai)
|
|
46
|
-
- **API** — Orchestration and AI-powered test execution
|
|
47
|
-
- **License Management** — Your parallel test capacity
|
|
48
|
-
|
|
49
|
-
You provide:
|
|
50
|
-
|
|
51
|
-
- **AWS Infrastructure** — EC2 instances running in your account
|
|
52
|
-
- **AI API Keys** — Use your own OpenAI, Anthropic, or other AI provider keys
|
|
53
|
-
- **Custom Configuration** — Hardware specs, networking, installed software
|
|
120
|
+
- **Flat license fee** per parallel test slot
|
|
121
|
+
- **Unlimited test execution** — no device-second charges
|
|
122
|
+
- **Assisted setup** — our team helps you deploy and configure
|
|
123
|
+
- **Dedicated support** — direct access to our engineering team
|
|
124
|
+
- **Custom contract terms** — volume-based pricing, custom SLAs
|
|
125
|
+
- **Professional services** — implementation assistance and training
|
|
54
126
|
|
|
55
|
-
## Comparison vs
|
|
127
|
+
## Comparison: Hosted vs Self-Hosted
|
|
56
128
|
|
|
57
|
-
| Feature |
|
|
58
|
-
|
|
59
|
-
| **Setup Time** | Minutes | Hours |
|
|
129
|
+
| Feature | Hosted | Self-Hosted |
|
|
130
|
+
|---------|--------|-------------|
|
|
131
|
+
| **Setup Time** | Minutes | Hours (assisted) |
|
|
60
132
|
| **Pricing Model** | Device-seconds | Flat license fee |
|
|
61
|
-
| **Infrastructure
|
|
62
|
-
| **Device Location** | TestDriver cloud | Your AWS account |
|
|
133
|
+
| **Infrastructure** | TestDriver | Your AWS or any cloud |
|
|
63
134
|
| **AI API Keys** | TestDriver's | Your own |
|
|
64
135
|
| **Custom Software** | Limited | Full control |
|
|
65
136
|
| **Hardware Selection** | Standard | Your choice |
|
|
66
137
|
| **Debugging Access** | Replays only | Full RDP access |
|
|
138
|
+
| **Support** | Community/Standard | Dedicated engineering |
|
|
139
|
+
| **Air-Gapped Option** | No | Yes |
|
|
140
|
+
|
|
141
|
+
## Get Started
|
|
142
|
+
|
|
143
|
+
<Card
|
|
144
|
+
title="Schedule a Consultation"
|
|
145
|
+
icon="calendar"
|
|
146
|
+
href="https://testdriver.ai/demo"
|
|
147
|
+
>
|
|
148
|
+
Discuss your requirements with our team and get a custom proposal for your self-hosted deployment.
|
|
149
|
+
</Card>
|