testdriverai 7.2.9 → 7.2.11
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/testdriver.yml +127 -0
- package/.testdriver/last-sandbox +7 -0
- package/agent/events.js +1 -0
- package/agent/index.js +71 -54
- package/agent/lib/sandbox.js +11 -1
- package/agents.md +393 -0
- package/debug/01-table-initial.png +0 -0
- package/debug/02-after-ai-explore.png +0 -0
- package/debug/02-after-scroll.png +0 -0
- package/docs/docs.json +87 -126
- package/docs/v7/_drafts/caching.mdx +2 -2
- package/docs/v7/{getting-started → _drafts}/installation.mdx +0 -66
- package/docs/v7/{features/coverage.mdx → _drafts/powerful.mdx} +1 -90
- package/docs/v7/{features → _drafts}/scalable.mdx +126 -4
- package/docs/v7/_drafts/screenshot.mdx +155 -0
- package/docs/v7/_drafts/writing-tests.mdx +25 -0
- package/docs/v7/{api/act.mdx → ai.mdx} +27 -27
- package/docs/v7/{api/assert.mdx → assert.mdx} +3 -3
- package/docs/v7/aws-setup.mdx +338 -0
- package/docs/v7/caching.mdx +128 -0
- package/docs/v7/ci-cd.mdx +605 -0
- package/docs/v7/{api/click.mdx → click.mdx} +4 -4
- package/docs/v7/cloud.mdx +120 -0
- package/docs/v7/customizing-devices.mdx +129 -0
- package/docs/v7/{api/dashcam.mdx → dashcam.mdx} +0 -78
- package/docs/v7/{api/doubleClick.mdx → double-click.mdx} +5 -5
- package/docs/v7/{api/elements.mdx → elements.mdx} +1 -54
- package/docs/v7/enterprise.mdx +116 -0
- package/docs/v7/examples.mdx +5 -0
- package/docs/v7/{api/exec.mdx → exec.mdx} +3 -3
- package/docs/v7/{api/find.mdx → find.mdx} +17 -21
- package/docs/v7/{api/focusApplication.mdx → focus-application.mdx} +3 -3
- package/docs/v7/generating-tests.mdx +36 -0
- package/docs/v7/{api/hover.mdx → hover.mdx} +3 -3
- package/docs/v7/locating-elements.mdx +71 -0
- package/docs/v7/making-assertions.mdx +32 -0
- package/docs/v7/{api/mouseDown.mdx → mouse-down.mdx} +7 -7
- package/docs/v7/{api/mouseUp.mdx → mouse-up.mdx} +8 -8
- package/docs/v7/performing-actions.mdx +51 -0
- package/docs/v7/{api/pressKeys.mdx → press-keys.mdx} +3 -3
- package/docs/v7/quickstart.mdx +162 -0
- package/docs/v7/reusable-code.mdx +240 -0
- package/docs/v7/{api/rightClick.mdx → right-click.mdx} +5 -5
- package/docs/v7/running-tests.mdx +181 -0
- package/docs/v7/{api/scroll.mdx → scroll.mdx} +3 -3
- package/docs/v7/secrets.mdx +115 -0
- package/docs/v7/self-hosted.mdx +66 -0
- package/docs/v7/{api/type.mdx → type.mdx} +3 -3
- package/docs/v7/variables.mdx +111 -0
- package/docs/v7/waiting-for-elements.mdx +66 -0
- package/docs/v7/what-is-testdriver.mdx +54 -0
- package/lib/vitest/hooks.mjs +80 -68
- package/package.json +1 -1
- package/sdk.d.ts +22 -9
- package/sdk.js +177 -44
- package/test/manual/reconnect-provision.test.mjs +49 -0
- package/test/manual/reconnect-signin.test.mjs +41 -0
- package/test/testdriver/ai.test.mjs +30 -0
- package/test/testdriver/setup/testHelpers.mjs +0 -1
- package/test/testdriver/windows-installer.test.mjs +61 -0
- package/tests/table-sort-enrollments.test.mjs +72 -0
- package/tests/table-sort-experiment.test.mjs +42 -0
- package/tests/table-sort-setup.test.mjs +59 -0
- package/vitest.config.mjs +1 -0
- package/docs/v7/api/assertions.mdx +0 -403
- package/docs/v7/api/sandbox.mdx +0 -404
- package/docs/v7/features/ai-native.mdx +0 -413
- package/docs/v7/features/application-logs.mdx +0 -353
- package/docs/v7/features/browser-logs.mdx +0 -414
- package/docs/v7/features/cache-management.mdx +0 -402
- package/docs/v7/features/continuous-testing.mdx +0 -346
- package/docs/v7/features/data-driven-testing.mdx +0 -441
- package/docs/v7/features/easy-to-write.mdx +0 -280
- package/docs/v7/features/enterprise.mdx +0 -656
- package/docs/v7/features/fast.mdx +0 -406
- package/docs/v7/features/managed-sandboxes.mdx +0 -384
- package/docs/v7/features/network-monitoring.mdx +0 -568
- package/docs/v7/features/parallel-execution.mdx +0 -381
- package/docs/v7/features/powerful.mdx +0 -531
- package/docs/v7/features/sandbox-customization.mdx +0 -229
- package/docs/v7/features/stable.mdx +0 -473
- package/docs/v7/features/system-performance.mdx +0 -616
- package/docs/v7/features/test-analytics.mdx +0 -373
- package/docs/v7/features/test-cases.mdx +0 -393
- package/docs/v7/features/test-replays.mdx +0 -408
- package/docs/v7/features/test-reports.mdx +0 -308
- package/docs/v7/getting-started/debugging-tests.mdx +0 -382
- package/docs/v7/getting-started/quickstart.mdx +0 -90
- package/docs/v7/getting-started/running-tests.mdx +0 -173
- package/docs/v7/getting-started/setting-up-in-ci.mdx +0 -612
- package/docs/v7/getting-started/writing-tests.mdx +0 -534
- package/docs/v7/overview/what-is-testdriver.mdx +0 -386
- package/docs/v7/presets/chrome-extension.mdx +0 -248
- package/docs/v7/presets/chrome.mdx +0 -300
- package/docs/v7/presets/electron.mdx +0 -460
- package/docs/v7/presets/vscode.mdx +0 -417
- package/docs/v7/presets/webapp.mdx +0 -393
- package/vitest.config.js +0 -18
- /package/docs/v7/{commands → _drafts/commands}/assert.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/exec.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/focus-application.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/hover-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/hover-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/if.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/match-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/press-keys.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/remember.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/run.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll-until-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll-until-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/type.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait-for-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait-for-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait.mdx +0 -0
- /package/docs/v7/{getting-started → _drafts}/configuration.mdx +0 -0
- /package/docs/v7/{features → _drafts}/observable.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/linux.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/macos.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/windows.mdx +0 -0
- /package/docs/v7/{playwright.mdx → _drafts/playwright.mdx} +0 -0
- /package/docs/v7/{overview → _drafts}/readme.mdx +0 -0
- /package/docs/v7/{features → _drafts}/reports.mdx +0 -0
- /package/docs/v7/{api/client.mdx → client.mdx} +0 -0
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "VS Code Extensions"
|
|
3
|
-
sidebarTitle: "VS Code Extensions"
|
|
4
|
-
description: "Automatically launch and test Visual Studio Code extensions"
|
|
5
|
-
icon: "code"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
The `vscode()` preset automatically sets up Visual Studio Code with TestDriver and Dashcam recording. Perfect for testing VS Code extensions and IDE workflows.
|
|
11
|
-
|
|
12
|
-
<Note>
|
|
13
|
-
**Recommended Pattern (v7.1+):** Use `TestDriver()` hook + `provision.vscode()` for more flexibility:
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
import { TestDriver } from 'testdriverai/vitest/hooks';
|
|
17
|
-
|
|
18
|
-
test('my test', async (context) => {
|
|
19
|
-
const testdriver = TestDriver(context);
|
|
20
|
-
await testdriver.provision.vscode({
|
|
21
|
-
workspace: '/tmp/project',
|
|
22
|
-
extensions: ['ms-python.python']
|
|
23
|
-
});
|
|
24
|
-
// ...
|
|
25
|
-
});
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
The `vscode()` preset is still supported but the direct API provides better control and clearer lifecycle management.
|
|
29
|
-
</Note>
|
|
30
|
-
|
|
31
|
-
## Quick Start
|
|
32
|
-
|
|
33
|
-
```javascript
|
|
34
|
-
import { test } from 'vitest';
|
|
35
|
-
import { vscode } from 'testdriverai/presets';
|
|
36
|
-
|
|
37
|
-
test('extension test', async (context) => {
|
|
38
|
-
const { vscode } = await vscode(context, {
|
|
39
|
-
workspace: '/tmp/test-project',
|
|
40
|
-
extensions: ['ms-python.python']
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
await vscode.find('File menu').click();
|
|
44
|
-
await vscode.find('New File').click();
|
|
45
|
-
await vscode.find('Python file type').click();
|
|
46
|
-
});
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Signature
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
vscode(context, options): Promise<VSCodeResult>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Parameters
|
|
56
|
-
|
|
57
|
-
<ParamField path="context" type="object" required>
|
|
58
|
-
Vitest test context - automatically passed to your test function
|
|
59
|
-
</ParamField>
|
|
60
|
-
|
|
61
|
-
<ParamField path="options" type="object">
|
|
62
|
-
Configuration options for VS Code
|
|
63
|
-
|
|
64
|
-
<Expandable title="properties">
|
|
65
|
-
<ParamField path="workspace" type="string">
|
|
66
|
-
Path to workspace/folder to open in VS Code
|
|
67
|
-
</ParamField>
|
|
68
|
-
|
|
69
|
-
<ParamField path="extensions" type="string[]" default={[]}>
|
|
70
|
-
Array of extension IDs to install before launching
|
|
71
|
-
</ParamField>
|
|
72
|
-
|
|
73
|
-
<ParamField path="dashcam" type="boolean" default={true}>
|
|
74
|
-
Enable Dashcam test recording
|
|
75
|
-
</ParamField>
|
|
76
|
-
|
|
77
|
-
<ParamField path="os" type="'linux' | 'mac' | 'windows'" default="linux">
|
|
78
|
-
Target operating system for the test
|
|
79
|
-
</ParamField>
|
|
80
|
-
</Expandable>
|
|
81
|
-
</ParamField>
|
|
82
|
-
|
|
83
|
-
### Returns
|
|
84
|
-
|
|
85
|
-
<ResponseField name="testdriver" type="TestDriver" required>
|
|
86
|
-
TestDriver instance ready to use
|
|
87
|
-
</ResponseField>
|
|
88
|
-
|
|
89
|
-
<ResponseField name="vscode" type="TestDriver" required>
|
|
90
|
-
Alias for testdriver (semantic clarity for VS Code testing)
|
|
91
|
-
</ResponseField>
|
|
92
|
-
|
|
93
|
-
<ResponseField name="dashcam" type="Dashcam">
|
|
94
|
-
Dashcam instance for test recording (if enabled)
|
|
95
|
-
</ResponseField>
|
|
96
|
-
|
|
97
|
-
## Examples
|
|
98
|
-
|
|
99
|
-
### Basic Extension Testing
|
|
100
|
-
|
|
101
|
-
```javascript
|
|
102
|
-
import { test } from 'vitest';
|
|
103
|
-
import { vscode } from 'testdriverai/presets';
|
|
104
|
-
|
|
105
|
-
test('python extension creates new file', async (context) => {
|
|
106
|
-
const { vscode } = await vscode(context, {
|
|
107
|
-
workspace: '/tmp/python-project',
|
|
108
|
-
extensions: ['ms-python.python']
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// Open command palette
|
|
112
|
-
await vscode.pressKeys(['cmd', 'shift', 'p']);
|
|
113
|
-
|
|
114
|
-
// Create new Python file
|
|
115
|
-
await vscode.type('Python: Create New File');
|
|
116
|
-
await vscode.pressKeys(['enter']);
|
|
117
|
-
|
|
118
|
-
// Verify file was created
|
|
119
|
-
await vscode.assert('Untitled Python file is open');
|
|
120
|
-
});
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Testing Multiple Extensions
|
|
124
|
-
|
|
125
|
-
```javascript
|
|
126
|
-
import { test } from 'vitest';
|
|
127
|
-
import { vscode } from 'testdriverai/presets';
|
|
128
|
-
|
|
129
|
-
test('eslint and prettier integration', async (context) => {
|
|
130
|
-
const { vscode } = await vscode(context, {
|
|
131
|
-
workspace: '/tmp/js-project',
|
|
132
|
-
extensions: [
|
|
133
|
-
'dbaeumer.vscode-eslint',
|
|
134
|
-
'esbenp.prettier-vscode'
|
|
135
|
-
]
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// Open a JavaScript file
|
|
139
|
-
await vscode.find('File').click();
|
|
140
|
-
await vscode.find('Open File').click();
|
|
141
|
-
await vscode.type('src/index.js');
|
|
142
|
-
await vscode.pressKeys(['enter']);
|
|
143
|
-
|
|
144
|
-
// Format document
|
|
145
|
-
await vscode.pressKeys(['shift', 'alt', 'f']);
|
|
146
|
-
|
|
147
|
-
await vscode.assert('Document is formatted');
|
|
148
|
-
});
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Empty Workspace
|
|
152
|
-
|
|
153
|
-
```javascript
|
|
154
|
-
import { test } from 'vitest';
|
|
155
|
-
import { vscode } from 'testdriverai/presets';
|
|
156
|
-
|
|
157
|
-
test('empty workspace welcome screen', async (context) => {
|
|
158
|
-
const { vscode } = await vscode(context, {
|
|
159
|
-
// No workspace specified - opens to welcome screen
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
await vscode.find('Open Folder button').click();
|
|
163
|
-
await vscode.type('/tmp/my-project');
|
|
164
|
-
await vscode.pressKeys(['enter']);
|
|
165
|
-
|
|
166
|
-
await vscode.assert('Folder is opened');
|
|
167
|
-
});
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Testing on Different Operating Systems
|
|
171
|
-
|
|
172
|
-
```javascript
|
|
173
|
-
import { test } from 'vitest';
|
|
174
|
-
import { vscode } from 'testdriverai/presets';
|
|
175
|
-
|
|
176
|
-
test('windows vscode test', async (context) => {
|
|
177
|
-
const { vscode } = await vscode(context, {
|
|
178
|
-
workspace: 'C:\\Users\\TestUser\\project',
|
|
179
|
-
os: 'windows'
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
await vscode.find('Explorer view').click();
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
test('mac vscode test', async (context) => {
|
|
186
|
-
const { vscode } = await vscode(context, {
|
|
187
|
-
workspace: '/Users/testuser/project',
|
|
188
|
-
os: 'mac'
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
await vscode.find('Explorer view').click();
|
|
192
|
-
});
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Extension Settings
|
|
196
|
-
|
|
197
|
-
```javascript
|
|
198
|
-
import { test } from 'vitest';
|
|
199
|
-
import { vscode } from 'testdriverai/presets';
|
|
200
|
-
|
|
201
|
-
test('configure extension settings', async (context) => {
|
|
202
|
-
const { vscode } = await vscode(context, {
|
|
203
|
-
extensions: ['ms-python.python']
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
// Open settings
|
|
207
|
-
await vscode.pressKeys(['cmd', ',']);
|
|
208
|
-
|
|
209
|
-
// Search for Python settings
|
|
210
|
-
await vscode.find('Search settings').type('python.linting');
|
|
211
|
-
|
|
212
|
-
// Enable linting
|
|
213
|
-
await vscode.find('Python > Linting: Enabled checkbox').click();
|
|
214
|
-
|
|
215
|
-
await vscode.assert('Linting is enabled');
|
|
216
|
-
});
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Debugging Workflow
|
|
220
|
-
|
|
221
|
-
```javascript
|
|
222
|
-
import { test } from 'vitest';
|
|
223
|
-
import { vscode } from 'testdriverai/presets';
|
|
224
|
-
|
|
225
|
-
test('debug javascript file', async (context) => {
|
|
226
|
-
const { vscode, dashcam } = await vscode(context, {
|
|
227
|
-
workspace: '/tmp/debug-test',
|
|
228
|
-
extensions: ['ms-vscode.js-debug']
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
// Open file
|
|
232
|
-
await vscode.find('index.js in Explorer').click();
|
|
233
|
-
|
|
234
|
-
// Set breakpoint
|
|
235
|
-
await vscode.find('line 10 gutter').click();
|
|
236
|
-
|
|
237
|
-
// Start debugging
|
|
238
|
-
await vscode.pressKeys(['F5']);
|
|
239
|
-
|
|
240
|
-
// Wait for breakpoint
|
|
241
|
-
await vscode.assert('Debugger paused at breakpoint');
|
|
242
|
-
|
|
243
|
-
// Step over
|
|
244
|
-
await vscode.pressKeys(['F10']);
|
|
245
|
-
|
|
246
|
-
await vscode.assert('Debugger moved to next line');
|
|
247
|
-
|
|
248
|
-
// Dashcam captures entire debug session
|
|
249
|
-
});
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## What It Does
|
|
253
|
-
|
|
254
|
-
When you call `vscode()`, it automatically:
|
|
255
|
-
|
|
256
|
-
1. **Initializes TestDriver** - Creates and connects to sandbox
|
|
257
|
-
2. **Sets up Dashcam** - Authenticates and starts recording (if enabled)
|
|
258
|
-
3. **Installs Extensions** - Downloads and installs specified extensions
|
|
259
|
-
4. **Launches VS Code** - Opens VS Code with your workspace
|
|
260
|
-
5. **Waits for Ready** - Ensures VS Code is focused and loaded
|
|
261
|
-
6. **Returns Instances** - Provides ready-to-use testdriver, vscode alias, and dashcam
|
|
262
|
-
|
|
263
|
-
At test end:
|
|
264
|
-
- Dashcam automatically stops and saves replay URL
|
|
265
|
-
- TestDriver automatically disconnects
|
|
266
|
-
- All cleanup is handled for you
|
|
267
|
-
|
|
268
|
-
## Common Patterns
|
|
269
|
-
|
|
270
|
-
### File Explorer Interaction
|
|
271
|
-
|
|
272
|
-
```javascript
|
|
273
|
-
test('create new folder', async (context) => {
|
|
274
|
-
const { vscode } = await vscode(context, {
|
|
275
|
-
workspace: '/tmp/test-workspace'
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
// Right-click in Explorer
|
|
279
|
-
await vscode.find('Explorer view').click({ button: 'right' });
|
|
280
|
-
await vscode.find('New Folder').click();
|
|
281
|
-
await vscode.type('src');
|
|
282
|
-
await vscode.pressKeys(['enter']);
|
|
283
|
-
|
|
284
|
-
await vscode.assert('src folder appears in Explorer');
|
|
285
|
-
});
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Terminal Commands
|
|
289
|
-
|
|
290
|
-
```javascript
|
|
291
|
-
test('run npm install', async (context) => {
|
|
292
|
-
const { vscode } = await vscode(context, {
|
|
293
|
-
workspace: '/tmp/node-project'
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
// Open integrated terminal
|
|
297
|
-
await vscode.pressKeys(['ctrl', '`']);
|
|
298
|
-
|
|
299
|
-
// Run command
|
|
300
|
-
await vscode.type('npm install');
|
|
301
|
-
await vscode.pressKeys(['enter']);
|
|
302
|
-
|
|
303
|
-
// Wait for completion
|
|
304
|
-
await vscode.assert('node_modules folder created');
|
|
305
|
-
});
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### Search and Replace
|
|
309
|
-
|
|
310
|
-
```javascript
|
|
311
|
-
test('find and replace', async (context) => {
|
|
312
|
-
const { vscode } = await vscode(context, {
|
|
313
|
-
workspace: '/tmp/project'
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
// Open file
|
|
317
|
-
await vscode.find('app.js').click();
|
|
318
|
-
|
|
319
|
-
// Open find/replace
|
|
320
|
-
await vscode.pressKeys(['cmd', 'h']);
|
|
321
|
-
|
|
322
|
-
// Enter search term
|
|
323
|
-
await vscode.find('Find input').type('oldFunction');
|
|
324
|
-
|
|
325
|
-
// Enter replacement
|
|
326
|
-
await vscode.find('Replace input').type('newFunction');
|
|
327
|
-
|
|
328
|
-
// Replace all
|
|
329
|
-
await vscode.find('Replace All button').click();
|
|
330
|
-
|
|
331
|
-
await vscode.assert('All occurrences replaced');
|
|
332
|
-
});
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Git Integration
|
|
336
|
-
|
|
337
|
-
```javascript
|
|
338
|
-
test('commit changes', async (context) => {
|
|
339
|
-
const { vscode } = await vscode(context, {
|
|
340
|
-
workspace: '/tmp/git-project',
|
|
341
|
-
extensions: ['vscode.git']
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
// Open Source Control
|
|
345
|
-
await vscode.find('Source Control icon').click();
|
|
346
|
-
|
|
347
|
-
// Stage changes
|
|
348
|
-
await vscode.find('Stage All Changes button').click();
|
|
349
|
-
|
|
350
|
-
// Enter commit message
|
|
351
|
-
await vscode.find('Commit message input').type('Initial commit');
|
|
352
|
-
|
|
353
|
-
// Commit
|
|
354
|
-
await vscode.find('Commit button').click();
|
|
355
|
-
|
|
356
|
-
await vscode.assert('Changes committed');
|
|
357
|
-
});
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
## Extension ID Reference
|
|
361
|
-
|
|
362
|
-
Common extension IDs for testing:
|
|
363
|
-
|
|
364
|
-
| Extension | ID |
|
|
365
|
-
|-----------|-----|
|
|
366
|
-
| Python | `ms-python.python` |
|
|
367
|
-
| ESLint | `dbaeumer.vscode-eslint` |
|
|
368
|
-
| Prettier | `esbenp.prettier-vscode` |
|
|
369
|
-
| GitLens | `eamodio.gitlens` |
|
|
370
|
-
| Live Server | `ritwickdey.liveserver` |
|
|
371
|
-
| Docker | `ms-azuretools.vscode-docker` |
|
|
372
|
-
| REST Client | `humao.rest-client` |
|
|
373
|
-
| Debugger for Chrome | `msjsdiag.debugger-for-chrome` |
|
|
374
|
-
|
|
375
|
-
Find more extension IDs on the [VS Code Marketplace](https://marketplace.visualstudio.com/).
|
|
376
|
-
|
|
377
|
-
## Using with provision()
|
|
378
|
-
|
|
379
|
-
The `vscode()` preset can also be called via the unified `provision()` function:
|
|
380
|
-
|
|
381
|
-
```javascript
|
|
382
|
-
import { provision } from 'testdriverai/presets';
|
|
383
|
-
|
|
384
|
-
test('using provision', async (context) => {
|
|
385
|
-
const { vscode } = await provision('vscode', {
|
|
386
|
-
workspace: '/tmp/project',
|
|
387
|
-
extensions: ['ms-python.python']
|
|
388
|
-
}, context);
|
|
389
|
-
|
|
390
|
-
// Same functionality as vscode() directly
|
|
391
|
-
});
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
## Error Handling
|
|
395
|
-
|
|
396
|
-
```javascript
|
|
397
|
-
test('handles missing extension', async (context) => {
|
|
398
|
-
try {
|
|
399
|
-
const { vscode } = await vscode(context, {
|
|
400
|
-
extensions: ['non.existent.extension']
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
// Will throw error if extension installation fails
|
|
404
|
-
} catch (error) {
|
|
405
|
-
// Cleanup still happens automatically
|
|
406
|
-
expect(error.message).toContain('extension');
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
## See Also
|
|
412
|
-
|
|
413
|
-
- [Provision API](/v7/progressive-apis/PROVISION) - Overview of all presets
|
|
414
|
-
- [Chrome Preset](/v7/presets/chrome) - Testing web applications
|
|
415
|
-
- [Electron Preset](/v7/presets/electron) - Testing Electron apps
|
|
416
|
-
- [Vitest Integration](/v7/guides/vitest) - Complete Vitest setup guide
|
|
417
|
-
- [Hooks API](/v7/progressive-apis/HOOKS) - Manual lifecycle control
|