testdriverai 7.5.26 → 7.6.0-test.1

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/CHANGELOG.md CHANGED
@@ -1,31 +1,40 @@
1
- ## 7.5.26 (2026-03-11)
1
+ ## 7.6.0-test.1 (2026-03-12)
2
+
3
+ 🔧 Maintenance
4
+
5
+ - Improve CI/CD workflow reliability and testing coverage [SDK] (eb86a515)
6
+ - Update MCP server implementation for better stability [SDK] (eb86a515)
7
+
8
+ 📝 Documentation
9
+
10
+ - Add new visual documentation for content parsing functionality [SDK] (eb86a515)
11
+
12
+ ## 7.6.0-test.0 (2026-03-12)
2
13
 
3
14
  ## ✨ Features
4
15
 
5
- - Add stable and canary deployment channels for better release management [API] (50347881)
6
- - Add version API endpoint to provide deployment channel information [API] (50347881)
7
- - Add new AI skill for waiting operations in test automation [SDK] (50347881)
8
- - Add customer testimonials section to marketing site (50347881)
9
- - Add contact and demo pages to marketing site (50347881)
10
- - Add user limit checking for team invitations [API] (50347881)
11
- - Improve test analytics dashboard with enhanced data visualization [Web] (50347881)
12
- - Improve test case management interface with better filtering and search [Web] (50347881)
13
- - Improve test run detail view with more comprehensive information [Web] (50347881)
14
- - Add PostHog analytics integration for better user tracking (50347881)
16
+ - Add stable/canary deployment channels with separate environments for production and development branches [API] (64542a8d)
17
+ - Add /version API endpoint returning deployment channel information [API] (64542a8d)
18
+ - Implement user limits and team member invitation controls [API] (6381290a)
19
+ - Add comprehensive GitHub Copilot skills and agent documentation for AI-assisted test development [SDK] (5ff15796)
20
+ - Add testimonials section with customer logos and quotes to marketing site [Web] (6381290a)
21
+ - Add contact and demo pages to marketing site [Web] (6381290a)
22
+ - Improve test environment management with better configuration and deployment workflows [Runner] (5c96e056)
15
23
 
16
24
  ## 🐛 Bug Fixes
17
25
 
18
- - Fix network logs screenshot filename in marketing assets (50347881)
19
- - Improve invite validation flow for team management [API] (50347881)
26
+ - Fix environment configuration and Tailscale connectivity issues [Runner] (5c96e056)
27
+ - Resolve Redis URL configuration problems across environments [API] (eca334be)
28
+ - Fix Vite API endpoint configuration for proper environment targeting [Web] (bf7fdf54)
20
29
 
21
30
  ## 🔧 Maintenance
22
31
 
23
- - Update pricing configuration with shared pricing data structure (50347881)
24
- - Enhance release workflow to support dual-branch publishing (50347881)
25
- - Update environment configuration for stable and canary deployments (50347881)
26
- - Improve sandbox agent error handling and logging [Runner] (50347881)
27
- - Update SDK examples with better configuration handling [SDK] (50347881)
28
- - Enhance debugger interface with improved styling [SDK] (50347881)
32
+ - Update pricing configuration and plans structure [API] (6381290a)
33
+ - Improve deployment workflows with promotion pipelines between test, canary, and stable branches [CI/CD] (1994d769)
34
+ - Add toast notification system for better user feedback [Web] (multiple commits)
35
+ - Rename TestAnalytics to TestMetrics for clarity [Web] (multiple commits)
36
+ - Remove outdated marketing articles and legal pages [Web] (6381290a)
37
+ - Update terms of service with new date [Web] (6381290a)
29
38
 
30
39
  ## 7.5.25 (2026-03-09)
31
40
 
package/README.md CHANGED
@@ -63,6 +63,7 @@ This will:
63
63
  - Create a project folder
64
64
  - Install dependencies (Vitest + TestDriver)
65
65
  - Set up your API key
66
+ - Configure MCP for your AI assistant (VS Code, Cursor, Claude Desktop, etc.)
66
67
  - Generate an example test
67
68
 
68
69
  ### Step 3: Run Your First Test
@@ -16,12 +16,14 @@ function parseValue(value) {
16
16
  return value;
17
17
  }
18
18
 
19
+ const channelConfig = require("../../channel.json");
20
+
19
21
  // Factory function that creates a config instance
20
22
  const createConfig = (environment = {}) => {
21
23
  // Start with defaults
22
24
  const config = {
23
25
  TD_ANALYTICS: true,
24
- TD_API_ROOT: "https://v6.testdriver.ai",
26
+ TD_API_ROOT: channelConfig.channels[channelConfig.active],
25
27
  TD_API_KEY: null,
26
28
  TD_PROFILE: false,
27
29
  TD_RESOLUTION: [1366, 768],
@@ -915,10 +915,12 @@ const createSandbox = function (emitter, analytics, sessionInstance) {
915
915
  }
916
916
 
917
917
  try {
918
- if (this._cmdChannel) this._cmdChannel.detach().catch(() => {});
919
- if (this._respChannel) this._respChannel.detach().catch(() => {});
920
- if (this._ctrlChannel) this._ctrlChannel.detach().catch(() => {});
921
- if (this._filesChannel) this._filesChannel.detach().catch(() => {});
918
+ await Promise.allSettled([
919
+ this._cmdChannel?.detach(),
920
+ this._respChannel?.detach(),
921
+ this._ctrlChannel?.detach(),
922
+ this._filesChannel?.detach(),
923
+ ].filter(Boolean));
922
924
  } catch (e) {
923
925
  /* ignore */
924
926
  }
@@ -578,9 +578,6 @@ await testdriver.pressKeys(["pagedown"]);
578
578
  ### Executing Code in Sandbox
579
579
 
580
580
  ```javascript
581
- // JavaScript
582
- const result = await testdriver.exec("js", "return document.title", 5000);
583
-
584
581
  // Shell (Linux)
585
582
  const output = await testdriver.exec("sh", "ls -la", 5000);
586
583
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: testdriver:exec
3
- description: Execute code or shell commands in the sandbox
3
+ description: Execute shell or PowerShell commands in the sandbox
4
4
  ---
5
5
  <!-- Generated from exec.mdx. DO NOT EDIT. -->
6
6
 
7
7
  ## Overview
8
8
 
9
- Execute JavaScript code in the browser or PowerShell commands in the Windows sandbox environment.
9
+ Execute shell commands (Linux) or PowerShell commands (Windows) in the sandbox environment.
10
10
 
11
11
  ## Syntax
12
12
 
@@ -17,7 +17,7 @@ await testdriver.exec(language, code, timeout, silent)
17
17
  ## Parameters
18
18
 
19
19
  <ParamField path="language" type="string" required>
20
- Language to execute: `'js'` (JavaScript) or `'pwsh'` (PowerShell)
20
+ Language to execute: `'sh'` (Shell/Linux) or `'pwsh'` (PowerShell/Windows)
21
21
  </ParamField>
22
22
 
23
23
  <ParamField path="code" type="string" required>
@@ -36,57 +36,40 @@ await testdriver.exec(language, code, timeout, silent)
36
36
 
37
37
  `Promise<string>` - Command output
38
38
 
39
- ## JavaScript Execution
39
+ ## Shell Execution (Linux)
40
40
 
41
- Execute JavaScript in the browser context (Windows sandbox only).
41
+ Execute shell commands in the Linux sandbox.
42
42
 
43
- ### DOM Manipulation
43
+ ### Basic Commands
44
44
 
45
45
  ```javascript
46
- // Click an element via JavaScript
47
- await testdriver.exec('js', `
48
- document.querySelector('#submit-button').click();
49
- `, 5000);
46
+ // List files
47
+ const files = await testdriver.exec('sh', 'ls -la', 5000);
50
48
 
51
- // Fill a form
52
- await testdriver.exec('js', `
53
- document.querySelector('#username').value = 'testuser';
54
- document.querySelector('#password').value = 'password123';
55
- document.querySelector('#login-form').submit();
56
- `, 5000);
49
+ // Check current directory
50
+ const pwd = await testdriver.exec('sh', 'pwd', 5000);
57
51
 
58
- // Scroll to element
59
- await testdriver.exec('js', `
60
- document.querySelector('#footer').scrollIntoView();
61
- `, 5000);
52
+ // Run a script
53
+ await testdriver.exec('sh', './setup.sh', 60000);
62
54
  ```
63
55
 
64
- ### Reading Page Data
56
+ ### File Operations
65
57
 
66
58
  ```javascript
67
- // Get page title
68
- const title = await testdriver.exec('js', 'document.title', 5000);
69
- console.log('Page title:', title);
70
-
71
- // Get all links
72
- const links = await testdriver.exec('js', `
73
- Array.from(document.querySelectorAll('a'))
74
- .map(a => a.href)
75
- .join('\\n')
76
- `, 5000);
59
+ // Create a file
60
+ await testdriver.exec('sh', 'echo "Hello World" > test.txt', 5000);
77
61
 
78
- // Check if element exists
79
- const exists = await testdriver.exec('js', `
80
- document.querySelector('.error-message') !== null
81
- `, 5000);
62
+ // Read a file
63
+ const content = await testdriver.exec('sh', 'cat test.txt', 5000);
82
64
 
83
- // Get element text
84
- const text = await testdriver.exec('js', `
85
- document.querySelector('.notification').textContent
86
- `, 5000);
65
+ // Copy files
66
+ await testdriver.exec('sh', 'cp source.txt dest.txt', 5000);
67
+
68
+ // Delete files
69
+ await testdriver.exec('sh', 'rm test.txt', 5000);
87
70
  ```
88
71
 
89
- ## PowerShell Execution
72
+ ## PowerShell Execution (Windows)
90
73
 
91
74
  Execute PowerShell commands in the Windows sandbox.
92
75
 
@@ -399,9 +399,6 @@ await testdriver.scrollUntilImage("Product image at bottom");
399
399
  ### Executing Code in Sandbox
400
400
 
401
401
  ```javascript
402
- // JavaScript
403
- const result = await testdriver.exec("js", "return document.title", 5000);
404
-
405
402
  // Shell (Linux)
406
403
  const output = await testdriver.exec("sh", "ls -la", 5000);
407
404
 
@@ -568,9 +568,6 @@ await testdriver.pressKeys(["pagedown"]);
568
568
  ### Executing Code in Sandbox
569
569
 
570
570
  ```javascript
571
- // JavaScript
572
- const result = await testdriver.exec("js", "return document.title", 5000);
573
-
574
571
  // Shell (Linux)
575
572
  const output = await testdriver.exec("sh", "ls -la", 5000);
576
573
 
package/channel.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "active": "test",
3
+ "channels": {
4
+ "dev": "http://localhost:1337",
5
+ "test": "https://test-api-5rtk.onrender.com",
6
+ "canary": "https://canary-api-vpnz.onrender.com",
7
+ "latest": "https://api.testdriver.ai"
8
+ }
9
+ }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "exec"
3
3
  sidebarTitle: "exec"
4
- description: "Execute custom shell or Node.js scripts within your tests."
4
+ description: "Execute custom shell or PowerShell scripts within your tests."
5
5
  icon: "code"
6
6
  mode: "wide"
7
7
  ---
@@ -14,49 +14,43 @@ import Example from "/snippets/tests/exec-shell-yaml.mdx";
14
14
 
15
15
  ## Description
16
16
 
17
- The `exec` command allows you to execute custom Node.js scripts within your TestDriver tests. This is useful for tasks like generating dynamic data, interacting with APIs, or performing custom logic during a test. The output of the script can be stored in a variable for use in subsequent steps. It's important to note that the output from `exec` must be a `string`.
17
+ The `exec` command allows you to execute shell commands (Linux) or PowerShell commands (Windows) within your TestDriver tests. This is useful for launching applications, file operations, or performing system commands during a test.
18
18
 
19
19
  ## Arguments
20
20
 
21
21
  | Argument | Type | Description |
22
22
  | :------: | :------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
- | `lang` | `string` | The language of the script to execute. Supported values are `pwsh` and `js`. |
23
+ | `lang` | `string` | The language of the script to execute. Supported values are `sh` (Shell/Linux) or `pwsh` (PowerShell/Windows). |
24
24
  | `output` | `string` | The variable name to store the result of the script. This variable can be accessed as `${OUTPUT.<var>}` in future steps. |
25
- | `code` | `string` | The script to execute on Windows systems. For `js`, the script must define the output as `result`. |
25
+ | `code` | `string` | The script to execute. |
26
26
  | `silent` | `string` | Defaults to `false`. The command will print the output of the script. This is useful for suppressing unnecessary or private output in the test logs and it's useful for debugging. |
27
27
 
28
28
  ## Example usage
29
29
 
30
- This example demonstrates how to use the `exec` command to generate a TOTP (Time-based One-Time Password) using the `totp-generator` library.
30
+ This example demonstrates how to use the `exec` command to launch a calculator application.
31
31
 
32
- ```yaml otp-generator.yaml
32
+ ```yaml calculator.yaml
33
33
  version: 6.0.0
34
34
  steps:
35
35
  - commands:
36
36
  - command: exec
37
37
  lang: pwsh
38
38
  code: |
39
- npm install totp-generator
40
- - command: exec
41
- lang: js
42
- output: totp
43
- code: |
44
- const { TOTP } = require("totp-generator");
45
- let otp = TOTP.generate("JBSWY3DPEB3W64TMMQQQ").otp;
46
- console.log(otp);
47
- result = otp;
48
- - command: type
49
- text: ${OUTPUT.totp}
39
+ start /B calc.exe
40
+ timeout /t 5
41
+ - command: wait-for-text
42
+ text: "calculator"
43
+ timeout: 30000
50
44
  ```
51
45
 
52
46
  ## Additional details
53
47
 
54
- - Supported `lang` values are `js` or `pwsh`:
55
- - `js` code is executed in a Node.js [VM](https://nodejs.org/api/vm.html) internally on the host machine (for example the machine where your CI/CD runs, or your computer if using the local agent).
56
- - `pwsh` code is executed in the shell on target runner (which can be the cloud runner, local sandbox, or local machine, depending on where you run your tests).
48
+ - Supported `lang` values are `sh` or `pwsh`:
49
+ - `sh` code is executed in the shell on Linux sandboxes.
50
+ - `pwsh` code is executed in PowerShell on Windows sandboxes.
57
51
  - **Note:** You can also use `pwsh` in [lifecycle](/guide/lifecycle) scripts to install npm packages if you need them.
58
52
  - Otherwise, the `pwsh` code can be used within test steps to launch applications or perform simple commands (like writing text to a file on the machine to perform a simple file upload).
59
- - The `output`argument is assigned automatically by setting `result = somestringvalue` in the script you run.
53
+ - The `output` argument captures stdout from your script.
60
54
 
61
55
  ## Protips
62
56
 
@@ -372,20 +372,11 @@ await testdriver.scrollUntilText('Footer', 'down', 5000);
372
372
 
373
373
  ### exec(language, code, timeout, silent) - Execute Code
374
374
 
375
- Execute JavaScript or PowerShell in the sandbox.
375
+ Execute shell or PowerShell in the sandbox.
376
376
 
377
377
  ```javascript
378
- // JavaScript execution (in browser)
379
- const title = await testdriver.exec('js', 'document.title', 5000);
380
-
381
- await testdriver.exec('js', `
382
- document.querySelector('#username').value = 'testuser';
383
- `, 5000);
384
-
385
- // Get element text
386
- const text = await testdriver.exec('js', `
387
- document.querySelector('.notification').textContent
388
- `, 5000);
378
+ // Shell execution (Linux sandbox)
379
+ const output = await testdriver.exec('sh', 'ls -la', 5000);
389
380
 
390
381
  // PowerShell execution (Windows sandbox)
391
382
  await testdriver.exec('pwsh', 'npm install -g http-server', 30000);
@@ -843,7 +834,7 @@ Using explicit sandboxes provides:
843
834
  | `assert(text)` | Verify state | `await testdriver.assert('button is visible')` |
844
835
  | `pressKeys(keys)` | Keyboard shortcuts | `await testdriver.pressKeys(['ctrl', 'c'])` |
845
836
  | `scroll(dir, amt)` | Scroll page | `await testdriver.scroll('down', 500)` |
846
- | `exec(lang, code)` | Execute code | `await testdriver.exec('js', 'document.title', 5000)` |
837
+ | `exec(lang, code)` | Execute code | `await testdriver.exec('sh', 'ls -la', 5000)` |
847
838
  | `connect(opts)` | Connect to sandbox | `await testdriver.connect({ sandboxId: 'i-123' })` |
848
839
  | `disconnect()` | Close connection | `await testdriver.disconnect()` |
849
840
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "exec"
3
3
  sidebarTitle: "exec"
4
- description: "Execute custom shell or Node.js scripts within your tests."
4
+ description: "Execute custom shell or PowerShell scripts within your tests."
5
5
  icon: "code"
6
6
  mode: "wide"
7
7
  ---
@@ -14,49 +14,43 @@ import Example from "/snippets/tests/exec-shell-yaml.mdx";
14
14
 
15
15
  ## Description
16
16
 
17
- The `exec` command allows you to execute custom Node.js scripts within your TestDriver tests. This is useful for tasks like generating dynamic data, interacting with APIs, or performing custom logic during a test. The output of the script can be stored in a variable for use in subsequent steps. It's important to note that the output from `exec` must be a `string`.
17
+ The `exec` command allows you to execute shell commands (Linux) or PowerShell commands (Windows) within your TestDriver tests. This is useful for launching applications, file operations, or performing system commands during a test.
18
18
 
19
19
  ## Arguments
20
20
 
21
21
  | Argument | Type | Description |
22
22
  | :------: | :------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
- | `lang` | `string` | The language of the script to execute. Supported values are `pwsh` and `js`. |
23
+ | `lang` | `string` | The language of the script to execute. Supported values are `sh` (Shell/Linux) or `pwsh` (PowerShell/Windows). |
24
24
  | `output` | `string` | The variable name to store the result of the script. This variable can be accessed as `${OUTPUT.<var>}` in future steps. |
25
- | `code` | `string` | The script to execute on Windows systems. For `js`, the script must define the output as `result`. |
25
+ | `code` | `string` | The script to execute. |
26
26
  | `silent` | `string` | Defaults to `false`. The command will print the output of the script. This is useful for suppressing unnecessary or private output in the test logs and it's useful for debugging. |
27
27
 
28
28
  ## Example usage
29
29
 
30
- This example demonstrates how to use the `exec` command to generate a TOTP (Time-based One-Time Password) using the `totp-generator` library.
30
+ This example demonstrates how to use the `exec` command to launch a calculator application.
31
31
 
32
- ```yaml otp-generator.yaml
32
+ ```yaml calculator.yaml
33
33
  version: 6.0.0
34
34
  steps:
35
35
  - commands:
36
36
  - command: exec
37
37
  lang: pwsh
38
38
  code: |
39
- npm install totp-generator
40
- - command: exec
41
- lang: js
42
- output: totp
43
- code: |
44
- const { TOTP } = require("totp-generator");
45
- let otp = TOTP.generate("JBSWY3DPEB3W64TMMQQQ").otp;
46
- console.log(otp);
47
- result = otp;
48
- - command: type
49
- text: ${OUTPUT.totp}
39
+ start /B calc.exe
40
+ timeout /t 5
41
+ - command: wait-for-text
42
+ text: "calculator"
43
+ timeout: 30000
50
44
  ```
51
45
 
52
46
  ## Additional details
53
47
 
54
- - Supported `lang` values are `js` or `pwsh`:
55
- - `js` code is executed in a Node.js [VM](https://nodejs.org/api/vm.html) internally on the host machine (for example the machine where your CI/CD runs, or your computer if using the local agent).
56
- - `pwsh` code is executed in the shell on target runner (which can be the cloud runner, local sandbox, or local machine, depending on where you run your tests).
48
+ - Supported `lang` values are `sh` or `pwsh`:
49
+ - `sh` code is executed in the shell on Linux sandboxes.
50
+ - `pwsh` code is executed in PowerShell on Windows sandboxes.
57
51
  - **Note:** You can also use `pwsh` in [lifecycle](/guide/lifecycle) scripts to install npm packages if you need them.
58
52
  - Otherwise, the `pwsh` code can be used within test steps to launch applications or perform simple commands (like writing text to a file on the machine to perform a simple file upload).
59
- - The `output`argument is assigned automatically by setting `result = somestringvalue` in the script you run.
53
+ - The `output` argument captures stdout from your script.
60
54
 
61
55
  ## Protips
62
56
 
package/docs/v7/exec.mdx CHANGED
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  title: "exec()"
3
3
  sidebarTitle: "exec"
4
- description: "Execute code or shell commands in the sandbox"
4
+ description: "Execute shell or PowerShell commands in the sandbox"
5
5
  icon: "terminal"
6
6
  ---
7
7
 
8
8
  ## Overview
9
9
 
10
- Execute JavaScript code in the browser or PowerShell commands in the Windows sandbox environment.
10
+ Execute shell commands (Linux) or PowerShell commands (Windows) in the sandbox environment.
11
11
 
12
12
  ## Syntax
13
13
 
@@ -18,7 +18,7 @@ await testdriver.exec(language, code, timeout, silent)
18
18
  ## Parameters
19
19
 
20
20
  <ParamField path="language" type="string" required>
21
- Language to execute: `'js'` (JavaScript) or `'pwsh'` (PowerShell)
21
+ Language to execute: `'sh'` (Shell/Linux) or `'pwsh'` (PowerShell/Windows)
22
22
  </ParamField>
23
23
 
24
24
  <ParamField path="code" type="string" required>
@@ -37,57 +37,40 @@ await testdriver.exec(language, code, timeout, silent)
37
37
 
38
38
  `Promise<string>` - Command output
39
39
 
40
- ## JavaScript Execution
40
+ ## Shell Execution (Linux)
41
41
 
42
- Execute JavaScript in the browser context (Windows sandbox only).
42
+ Execute shell commands in the Linux sandbox.
43
43
 
44
- ### DOM Manipulation
44
+ ### Basic Commands
45
45
 
46
46
  ```javascript
47
- // Click an element via JavaScript
48
- await testdriver.exec('js', `
49
- document.querySelector('#submit-button').click();
50
- `, 5000);
47
+ // List files
48
+ const files = await testdriver.exec('sh', 'ls -la', 5000);
51
49
 
52
- // Fill a form
53
- await testdriver.exec('js', `
54
- document.querySelector('#username').value = 'testuser';
55
- document.querySelector('#password').value = 'password123';
56
- document.querySelector('#login-form').submit();
57
- `, 5000);
50
+ // Check current directory
51
+ const pwd = await testdriver.exec('sh', 'pwd', 5000);
58
52
 
59
- // Scroll to element
60
- await testdriver.exec('js', `
61
- document.querySelector('#footer').scrollIntoView();
62
- `, 5000);
53
+ // Run a script
54
+ await testdriver.exec('sh', './setup.sh', 60000);
63
55
  ```
64
56
 
65
- ### Reading Page Data
57
+ ### File Operations
66
58
 
67
59
  ```javascript
68
- // Get page title
69
- const title = await testdriver.exec('js', 'document.title', 5000);
70
- console.log('Page title:', title);
71
-
72
- // Get all links
73
- const links = await testdriver.exec('js', `
74
- Array.from(document.querySelectorAll('a'))
75
- .map(a => a.href)
76
- .join('\\n')
77
- `, 5000);
60
+ // Create a file
61
+ await testdriver.exec('sh', 'echo "Hello World" > test.txt', 5000);
78
62
 
79
- // Check if element exists
80
- const exists = await testdriver.exec('js', `
81
- document.querySelector('.error-message') !== null
82
- `, 5000);
63
+ // Read a file
64
+ const content = await testdriver.exec('sh', 'cat test.txt', 5000);
83
65
 
84
- // Get element text
85
- const text = await testdriver.exec('js', `
86
- document.querySelector('.notification').textContent
87
- `, 5000);
66
+ // Copy files
67
+ await testdriver.exec('sh', 'cp source.txt dest.txt', 5000);
68
+
69
+ // Delete files
70
+ await testdriver.exec('sh', 'rm test.txt', 5000);
88
71
  ```
89
72
 
90
- ## PowerShell Execution
73
+ ## PowerShell Execution (Windows)
91
74
 
92
75
  Execute PowerShell commands in the Windows sandbox.
93
76
 
@@ -216,7 +199,7 @@ await testdriver.exec('pwsh', '.\\setup.ps1', 60000, true);
216
199
 
217
200
  ```javascript
218
201
  // Quick operations: 5000ms
219
- await testdriver.exec('js', 'document.title', 5000);
202
+ await testdriver.exec('sh', 'ls -la', 5000);
220
203
 
221
204
  // Installations: 30000-60000ms
222
205
  await testdriver.exec('pwsh', 'npm install -g package', 30000);
@@ -289,27 +272,20 @@ describe('Code Execution', () => {
289
272
  await testdriver.disconnect();
290
273
  });
291
274
 
292
- it('should execute JavaScript in browser', async () => {
293
- await testdriver.focusApplication('Google Chrome');
275
+ it('should execute shell commands on Linux', async () => {
276
+ // List directory
277
+ const files = await testdriver.exec('sh', 'ls -la', 5000);
278
+ console.log('Files:', files);
294
279
 
295
- // Get page info via JavaScript
296
- const title = await testdriver.exec('js', 'document.title', 5000);
297
- console.log('Page title:', title);
280
+ // Create a file
281
+ await testdriver.exec('sh', 'echo "Hello World" > test.txt', 5000);
298
282
 
299
- // Manipulate DOM
300
- await testdriver.exec('js', `
301
- document.querySelector('#username').value = 'testuser';
302
- `, 5000);
303
-
304
- // Verify
305
- const value = await testdriver.exec('js', `
306
- document.querySelector('#username').value
307
- `, 5000);
308
-
309
- expect(value).toBe('testuser');
283
+ // Read the file
284
+ const content = await testdriver.exec('sh', 'cat test.txt', 5000);
285
+ expect(content).toContain('Hello World');
310
286
  });
311
287
 
312
- it('should install and use tools', async () => {
288
+ it('should install and use tools on Windows', async () => {
313
289
  // Install tool
314
290
  await testdriver.exec('pwsh', 'npm install -g http-server', 30000, true);
315
291
 
@@ -331,10 +307,6 @@ describe('Code Execution', () => {
331
307
  `, 5000);
332
308
 
333
309
  await testdriver.focusApplication('Google Chrome');
334
-
335
- // Verify page loaded
336
- const content = await testdriver.exec('js', 'document.body.textContent', 5000);
337
- expect(content).toContain('Test Page');
338
310
  });
339
311
  });
340
312
  ```
@@ -342,5 +314,5 @@ describe('Code Execution', () => {
342
314
  ## Related Methods
343
315
 
344
316
  - [`focusApplication()`](/v7/focus-application) - Focus apps before exec
345
- - [`find()`](/v7/find) - Locate elements (alternative to DOM manipulation)
346
- - [`type()`](/v7/type) - Type text (alternative to JS form filling)
317
+ - [`find()`](/v7/find) - Locate elements visually
318
+ - [`type()`](/v7/type) - Type text into inputs
@@ -23,7 +23,7 @@ TestDriver makes it easy to write automated computer-use tests for web browsers,
23
23
  npx testdriverai init
24
24
  ```
25
25
 
26
- This will walk you through creating a new project folder, installing dependencies, and setting up your API key.
26
+ This will walk you through creating a new project folder, installing dependencies, setting up your API key, and configuring MCP for your preferred AI assistant (VS Code, Cursor, Claude Desktop, etc.).
27
27
 
28
28
  </Step>
29
29
 
@@ -12,7 +12,8 @@ const { execSync } = require("child_process");
12
12
  require("dotenv").config();
13
13
 
14
14
  // API configuration
15
- const API_BASE_URL = process.env.TD_API_ROOT || "https://api.testdriver.ai";
15
+ const channelConfig = require("../../../../channel.json");
16
+ const API_BASE_URL = process.env.TD_API_ROOT || channelConfig.channels[channelConfig.active];
16
17
  const POLL_INTERVAL = 5000; // 5 seconds
17
18
  const POLL_TIMEOUT = 900000; // 15 minutes
18
19