testdriverai 5.5.7 → 5.5.9

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/docs/docs.json CHANGED
@@ -63,6 +63,7 @@
63
63
  {
64
64
  "group": "Getting Started",
65
65
  "pages": [
66
+ "/getting-started/vscode",
66
67
  "/getting-started/setup",
67
68
  "/getting-started/writing",
68
69
  "/getting-started/generating",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: "Install the TestDriver VS Code Extension"
3
- sidebarTitle: "VS Code Extension"
3
+ sidebarTitle: "VS Code Setup"
4
4
  description: "Comprehensive guide to installing and setting up TestDriver for VS Code"
5
5
  icon: "file-code"
6
6
  ---
@@ -13,65 +13,91 @@ icon: "file-code"
13
13
  Turn your IDE into a powerful computer-use automation tool with our VS Code extension.
14
14
  </Card>
15
15
 
16
- <Steps>
17
-
18
- <Step title="Install TestDriver">
19
- Install the TestDriver CLI globally:
20
- ```bash
21
- npm install -g testdriverai@beta
22
- ```
23
- </Step>
24
-
25
- <Step title="Initialize Your Project">
26
- Set up your project with:
27
- ```bash
28
- testdriverai init
29
- ```
30
- This creates a `.env` file and sample workflow files.
31
- </Step>
32
-
33
- <Step title="Run TestDriver in Interactive Mode">
34
- Start TestDriver in interactive mode to create and refine tests dynamically:
35
- ```bash
36
- testdriverai
37
- ```
38
- Once started, you can use commands like `/try`, `/undo`, and `/save` to interactively build and test your flows.
39
- </Step>
40
-
41
- <Step title="Define Your Test Steps">
42
- Use natural language to describe what you want to test. For example:
43
- ```
44
- > Open Google Chrome and search for "testdriverai"
45
- ```
46
- TestDriver will generate steps like:
47
- ```yaml
48
- - command: focus-application
49
- name: Google Chrome
50
- - command: hover-text
51
- text: Search Google or type a URL
52
- description: main search bar
53
- action: click
54
- - command: type
55
- text: testdriverai
56
- - command: press-keys
57
- keys: [enter]
58
- ```
59
- </Step>
60
-
61
- <Step title="Refine and Save Your Test">
62
- - Use `/undo` to remove the last step if needed.
63
- - Save your test with `/save` to generate a reusable YAML file.
64
- </Step>
65
-
66
- <Step title="Run Saved Tests">
67
- Once saved, you can run your test file anytime:
68
- ```bash
69
- testdriverai run path/to/test.yml
70
- ```
71
- </Step>
72
-
73
- </Steps>
16
+
17
+ <Frame caption="VS Code Extension Overview">
18
+ <img height="400" src="/images/content/vscode/vscode-overview.png" />
19
+ </Frame>
20
+
21
+ ### 1. Test Pane
22
+ - Located in the **Activity Bar** (left-hand side of the editor).
23
+ - Clicking the <Icon icon="flask-conical" iconType="solid" /> **flask icon** opens the TestDriver test explorer.
24
+ - Lists all the available YAML-based test definitions.
25
+
26
+ <Frame caption="The test pane is here">
27
+ <img height="100" src="/images/content/vscode/vscode-testpane.png" />
28
+ </Frame>
29
+
30
+ ### 2. Run all Tests
31
+ - This button runs all tests shown in the Test Explorer.
32
+ - Found near the top of the Test Explorer view.
33
+ - Especially useful for quickly validating a batch of test cases.
34
+
35
+ <Frame caption="Gotta run 'em all">
36
+ <img height="200" src="/images/content/vscode/vscode-testpane-runtests.png" />
37
+ </Frame>
38
+
39
+ ### 3. AI Test Creation
40
+ - New files created by TestDriver will automatically be focused in the editor.
41
+ - Defines an automated test script created by TestDriver.
42
+
43
+ <Frame caption="You will create a new file every time you start a chat">
44
+ <img height="200" src="/images/content/vscode/vscode-file-creation.png" />
45
+ </Frame>
46
+
47
+ ### 4. AI Agent Test Preview
48
+ - Sidebar chat panel shows the TestDriver agent's response to the prompt.
49
+ - Offers feedback, interpretation, or suggested actions for the test steps.
50
+ - Example: It identifies the context (e.g., a terminal is in focus) and suggests the correct automation action.
51
+ - Additional files modified by the agent are listed for context.
52
+
53
+ <img width="300" src="/images/content/vscode/vscode-agent-preview.png" />
54
+
55
+ ### 5. Test Output
56
+ - Terminal panel at the bottom of the screen.
57
+ - Displays live output from running the test file.
58
+ - Shows TestDriver version, current test script, and metadata like session ID.
59
+ - Helpful for debugging and understanding test execution flow.
60
+
61
+ <Frame caption="You can move the terminal panel to the right as well!">
62
+ <img height="200" src="/images/content/vscode/vscode-test-output.png" />
63
+ </Frame>
64
+
65
+ ### 6. Test History
66
+ - Shows a list of previously run test scripts.
67
+ - Allows developers to review or re-run older tests.
68
+ - Useful for regression testing or comparing AI-generated test iterations.
69
+
70
+ <Frame caption="More history, less mystery">
71
+ <img src="/images/content/vscode/vscode-testhistory.png" />
72
+ </Frame>
74
73
 
75
74
  ---
76
75
 
77
- **Pro Tip:** Always start with interactive mode (`testdriverai`) to explore and refine your tests before saving them. It's faster and more intuitive!
76
+ ## Troubleshooting
77
+
78
+ ###ß I don't have GitHub Copilot Chat
79
+
80
+ You can still use the extension to run and manage tests. Use the CLI for test creation instead.
81
+
82
+ ### The @testdriver command doesn't show up
83
+
84
+ Make sure the GitHub Copilot Chat is set to "ask."
85
+
86
+ <img src="/images/content/vscode/vscode-copilot-ask.png" />
87
+
88
+ ### How do I stop a running execution?
89
+
90
+ Depending on the context, you can stop a running test execution in several ways:
91
+
92
+ ### 1. Click on the "Stop" button in the bottom of agent chat.
93
+
94
+ <img height="200" src="/images/content/vscode/vscode-stopchat.png" />
95
+
96
+ ### 2. Click on the "Stop" button in the top right corner of the test execution. This only shows on hover.
97
+
98
+ <img src="/images/content/vscode/vscode-stoptest.png" />
99
+
100
+ ### 3. A TestDriver icon will show in the tray bar. Click it, then click "quit."
101
+
102
+ <img src="/images/content/vscode/vscode-tdservice.png" />
103
+
@@ -5,130 +5,216 @@ description: "Get started with TestDriver in minutes."
5
5
  icon: "gauge-high"
6
6
  ---
7
7
 
8
- The fastest way to get started with TestDriver is to install the VS Code extension. This guide will walk you through the installation process and provide an overview of the extension's features.
9
-
10
- <Card
11
- title="Download the VS Code Extension"
12
- icon="download"
13
- href="https://github.com/testdriverai/vscode/releases/latest/download/testdriver.vsix"
14
- >
15
- Get the latest version from GitHub releases.
16
- </Card>
8
+ TestDriver isn't just a computer-use agent, it's an entire AI-native workflow for creating end-to-end tests. Follow these steps to set up your environment and get started with TestDriver.
17
9
 
18
- Don't use VS Code? <a href="/getting-started/setup">Get the TestDriver CLI →</a>
19
10
 
20
- ---
11
+ <Steps>
12
+ <Step title="Set Up TestDriver">
21
13
 
22
- # Install the extension
14
+ <AccordionGroup>
23
15
 
24
- 1. Open Visual Studio Code.
25
- 2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing `Ctrl+Shift+X`.
26
- 3. In the Extensions view, click on the three-dot menu in the top-right corner and select "Install from VSIX...".
27
- 4. Navigate to the location where you downloaded the `testdriverai.vsix` file and select it.
16
+ <Accordion title="Set up your IDE">
28
17
 
29
- <Frame>
30
- <img height="200" src="/images/content/vscode/vscode-install.png" />
31
- </Frame>
18
+ <Tabs>
19
+ <Tab title="VS Code">
32
20
 
33
- ---
21
+ VS Code is the recommended IDE for TestDriver. First, install the following recommended extensions:
34
22
 
35
- # Try the Walkthrough
23
+ - [GitHub Copilot Chat](vscode://github.copilot-chat) (The free plan is just fine!)
24
+ - [VS Code YAML](vscode://redhat.vscode-yaml) (Optional, but recommended for YAML validation)
36
25
 
37
- The extension should launch a walkthrough. If it doesn't, you can manually start it by running the command `TestDriver: Start Setup Walkthrough` from the Command Palette (`Ctrl+Shift+P`).
26
+ Then, download the TestDriver extension:
38
27
 
39
- <Frame caption="Walkthrough">
40
- <img height="200" src="/images/content/vscode/vscode-setup-walkthrough.png" />
41
- </Frame>
28
+ <Card
29
+ title="Download the VS Code Extension"
30
+ icon="download"
31
+ href="https://github.com/testdriverai/vscode/releases/latest/download/testdriver.vsix"
32
+ >
33
+ Get the latest version from GitHub releases.
34
+ </Card>
42
35
 
43
- ---
36
+ Finally, install the extension in VS Code. You can do this by dragging and dropping the downloaded `.vsix` file into the VS Code window.
44
37
 
38
+ </Tab>
39
+ <Tab title="Cursor">
45
40
 
46
- # Overview
41
+ First, install the following recommended extension:
47
42
 
48
- <Frame caption="VS Code Extension Overview">
49
- <img height="400" src="/images/content/vscode/vscode-overview.png" />
50
- </Frame>
43
+ - [VS Code YAML](vscode://redhat.vscode-yaml) (Optional, but recommended for YAML validation)
51
44
 
52
- ### 1. Test Pane
53
- - Located in the **Activity Bar** (left-hand side of the editor).
54
- - Clicking the <Icon icon="flask-conical" iconType="solid" /> **flask icon** opens the TestDriver test explorer.
55
- - Lists all the available YAML-based test definitions.
45
+ Then download the TestDriver extension:
56
46
 
57
- <Frame caption="The test pane is here">
58
- <img height="100" src="/images/content/vscode/vscode-testpane.png" />
59
- </Frame>
47
+ <Card
48
+ title="Download the VS Code Extension"
49
+ icon="download"
50
+ href="https://github.com/testdriverai/vscode/releases/latest/download/testdriver.vsix"
51
+ >
52
+ Install the TestDriver extension from the VS Code Marketplace.
53
+ </Card>
60
54
 
61
- ### 2. Run all Tests
62
- - This button runs all tests shown in the Test Explorer.
63
- - Found near the top of the Test Explorer view.
64
- - Especially useful for quickly validating a batch of test cases.
55
+ Finally, install the extension in Cursor. For more information on installing extensions in Cursor, check out the [Cursor documentation](https://forum.cursor.com/t/how-to-install-vsix-format-extension/1667).
65
56
 
66
- <Frame caption="Gotta run 'em all">
67
- <img height="200" src="/images/content/vscode/vscode-testpane-runtests.png" />
68
- </Frame>
57
+ </Tab>
58
+ <Tab title="Everything Else">
69
59
 
70
- ### 3. AI Test Creation
71
- - New files created by TestDriver will automatically be focused in the editor.
72
- - Defines an automated test script created by TestDriver.
60
+ Use JetBrains IDEs, VIM, or other editors? No problem! You can use TestDriver with the CLI. This quickstart contains both GUI and terminal commands to help you get started.
61
+ </Tab>
62
+ </Tabs>
63
+ </Accordion>
64
+ <Accordion title="Install the CLI">
73
65
 
74
- <Frame caption="You will create a new file every time you start a chat">
75
- <img height="200" src="/images/content/vscode/vscode-file-creation.png" />
76
- </Frame>
66
+ Ensure you have Node.js (v16 or higher) installed. Then, install the TestDriver CLI globally using `npm`:
77
67
 
78
- ### 4. AI Agent Test Preview
79
- - Sidebar chat panel shows the TestDriver agent's response to the prompt.
80
- - Offers feedback, interpretation, or suggested actions for the test steps.
81
- - Example: It identifies the context (e.g., a terminal is in focus) and suggests the correct automation action.
82
- - Additional files modified by the agent are listed for context.
68
+ ```bash
69
+ npm install -g testdriverai@beta
70
+ ```
71
+ </Accordion>
72
+ <Accordion title="Initialize your project">
83
73
 
84
- <img width="300" src="/images/content/vscode/vscode-agent-preview.png" />
74
+ Run `testdriverai init` in your project directory. This will launch an interactive setup process.
85
75
 
86
- ### 5. Test Output
87
- - Terminal panel at the bottom of the screen.
88
- - Displays live output from running the test file.
89
- - Shows TestDriver version, current test script, and metadata like session ID.
90
- - Helpful for debugging and understanding test execution flow.
76
+ ```bash
77
+ testdriverai init
78
+ ```
79
+ </Accordion>
80
+ <Accordion title="Configure test runner">
91
81
 
92
- <Frame caption="You can move the terminal panel to the right as well!">
93
- <img height="200" src="/images/content/vscode/vscode-test-output.png" />
94
- </Frame>
82
+ Running `testdriverai init` will prompt you to set up your test runner; a target computer to run tests on. You can use either a hosted sandbox or your own computer.
95
83
 
96
- ### 6. Test History
97
- - Shows a list of previously run test scripts.
98
- - Allows developers to review or re-run older tests.
99
- - Useful for regression testing or comparing AI-generated test iterations.
84
+ - **Hosted Runners** - Run tests in a ephemeral linux virtual machine. Recommended for ease of use, added privacy, and parallelization. Requires a TestDriver API key.
85
+ - **Local Runner** - Run tests on your own computer. Recommended for working with existing user sessions, files, and applications. Requires additional setup.
100
86
 
101
- <Frame caption="More history, less mystery">
102
- <img src="/images/content/vscode/vscode-testhistory.png" />
103
- </Frame>
87
+ <Tabs>
88
+ <Tab title="Hosted Runners (Recommended)">
104
89
 
105
- ---
90
+ Run `testdriverai init` in your project directory and choose "yes" for the sandbox option. This will prompt you for your API key.
91
+
92
+ ```
93
+ Beginning setup...
94
+ ✔ Use TestDriver Sandbox Runners? (Recommended) … yes
95
+ ? API KEY (from https://app.testdriver.ai/team) › ********
96
+ ```
97
+
98
+ This will write the `TD_VM=true` and `TD_API_KEY` values to `.env` file in your project directory.
99
+
100
+ </Tab>
101
+ <Tab title="Windows">
102
+
103
+ Using your own computer as a test runner requires additional prerequisites. Follow the AccordionGroup below to set up your local environment.
104
+
105
+ #### Install Python & Visual Studio Build Tools
106
+
107
+ ```powershell
108
+ choco install python visualstudio2022-workload-vctools -y
109
+ ```
110
+
111
+ #### Install NodeJS
112
+
113
+ You will also need NodeJS if you don't have it yet.
114
+
115
+ ```powershell
116
+ choco install nodejs-lts --version="20.17.0"
117
+ ```
106
118
 
107
- ## Troubleshooting
119
+ #### Set Execution Policy
108
120
 
109
- ###ß I don't have GitHub Copilot Chat
121
+ Open a new terminal with admin privileges and execute the following command :
122
+ ```powershell
123
+ Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
124
+ ```
125
+
126
+ This gives TestDriver the right to execute it's scripts and is only valid for the current user.
127
+ </Tab>
128
+ <Tab title="Mac">
110
129
 
111
- You can still use the extension to run and manage tests. Use the CLI for test creation instead.
130
+ Using your own computer as a test runner requires additional permissions. Follow the steps below to set up your local environment.
112
131
 
113
- ### The @testdriver command doesn't show up
132
+ #### Enable Screen Recording Permissions
133
+
134
+ TestDriver requires screen recording permissions to capture your screen during test execution.
114
135
 
115
- Make sure the GitHub Copilot Chat is set to "ask."
136
+ - Open **System Preferences > Security & Privacy > Privacy > Screen Recording**.
137
+ - Check the box next to your terminal application (e.g., Terminal, iTerm2) to allow screen recording.
138
+
139
+ This is required for TestDriver to capture your screen during test execution.
140
+
141
+ #### Enable Accessibility Permissions
142
+
143
+ - Open **System Preferences > Security & Privacy > Privacy > Accessibility**.
144
+ - Check the box next to your terminal application (e.g., Terminal, iTerm2) to allow accessibility features.
116
145
 
117
- <img src="/images/content/vscode/vscode-copilot-ask.png" />
146
+ This is required for TestDriver to interact with your applications during test execution.
118
147
 
119
- ### How do I stop a running execution?
148
+ </Tab>
149
+ </Tabs>
150
+ </Accordion>
151
+ </AccordionGroup>
120
152
 
121
- Depending on the context, you can stop a running test execution in several ways:
153
+ </Step>
122
154
 
123
- ### 1. Click on the "Stop" button in the bottom of agent chat.
155
+ <Step title="Create your first test">
156
+
157
+ Use the `/explore` command to supply test steps to the TestDriver agent. TestDriver will look at the screen and generate a test steps based on your input.
158
+
159
+ ```
160
+ > Open Google Chrome and search for "testdriverai"
161
+ ```
162
+
163
+ TestDriver will generate and run test steps. See the [YAML Reference](/commands/assert).
164
+
165
+ ```yaml
166
+ - command: focus-application
167
+ name: Google Chrome
168
+ - command: hover-text
169
+ text: Search Google or type a URL
170
+ description: main search bar
171
+ action: click
172
+ - command: type
173
+ text: testdriverai
174
+ - command: press-keys
175
+ keys: [enter]
176
+ ```
177
+
178
+ Test steps are saved in the current working YAML file.
179
+
180
+ <Tip>Use Control + C in the CLI or the square "stop" button in the extension to stop test execution.</Tip>
181
+
182
+ </Step>
183
+
184
+ <Step title="Running tests">
185
+
186
+ Once saved, you can run your test file anytime. Click the "Run" button in the extension or use the CLI command:
187
+
188
+ ```bash
189
+ testdriverai run testdriver/your_test.yml
190
+ ```
191
+
192
+ Running tests is about twice as fast as creating them, as the AI doesn't need to interpret your input.
193
+
194
+ </Step>
195
+
196
+ <Step title="Generate self-driving tests">
197
+ TestDriver can also generate tests without any input! Instead, it will suggest test steps based on what it sees on the screen.
198
+ <Card
199
+ title="Self-Driving Test Guide"
200
+ icon="link"
201
+ href="/getting-started/generating">
202
+ Unleash TestDriver's full potential by letting it create tests for you.
203
+ </Card>
124
204
 
125
- <img height="200" src="/images/content/vscode/vscode-stopchat.png" />
205
+ </Step>
126
206
 
127
- ### 2. Click on the "Stop" button in the top right corner of the test execution. This only shows on hover.
207
+ <Step title="Deploy to CI/CD">
128
208
 
129
- <img src="/images/content/vscode/vscode-stoptest.png" />
209
+ The `testdriverai init` command automatically sets up a GitHub Action workflow for you. Any test files found in the `testdriver` directory will run on every push to the main branch.
130
210
 
131
- ### 3. A TestDriver icon will show in the tray bar. Click it, then click "quit."
211
+ <Card
212
+ title="GitHub Actions"
213
+ icon="link"
214
+ href="/action/setup">
215
+ Learn how to set up GitHub Actions for TestDriver.
216
+ </Card>
132
217
 
133
- <img src="/images/content/vscode/vscode-tdservice.png" />
218
+ </Step>
134
219
 
220
+ </Steps>
@@ -17,6 +17,7 @@
17
17
  font-style: normal;
18
18
  font-size: 14px;
19
19
  scrollbar-width: none; /* Hide scrollbars for Firefox */
20
+ pointer-events: none;
20
21
  }
21
22
 
22
23
  *::-webkit-scrollbar {
@@ -77,10 +78,6 @@
77
78
  position: relative;
78
79
  }
79
80
 
80
- #main {
81
- pointer-events: none;
82
- }
83
-
84
81
  .screenshot {
85
82
  position: absolute;
86
83
  inset: 0;
@@ -94,7 +91,6 @@
94
91
  animation-timing-function: ease;
95
92
  animation-fill-mode: forwards;
96
93
  background-color: white;
97
- pointer-events: none;
98
94
  }
99
95
 
100
96
  .box {
@@ -192,7 +188,6 @@
192
188
  }
193
189
 
194
190
  #terminal-wrapper {
195
- pointer-events: none;
196
191
  position: absolute;
197
192
  right: calc(100vw - 600px);
198
193
  top: 0px;
@@ -212,7 +207,6 @@
212
207
  }
213
208
 
214
209
  #boxes {
215
- pointer-events: none;
216
210
  position: absolute;
217
211
  top: 0;
218
212
  left: 0;
@@ -223,11 +217,13 @@
223
217
 
224
218
  #vm-iframe {
225
219
  position: absolute;
220
+ display: none;
226
221
  top: 0;
227
222
  left: 0;
228
223
  width: 100%;
229
224
  height: 100%;
230
225
  border: none;
226
+ pointer-events: auto;
231
227
  }
232
228
  </style>
233
229
  <link rel="stylesheet" href="terminal/xterm.css" />
@@ -356,6 +352,7 @@
356
352
 
357
353
  ipcRenderer.on(events.vm.show, (event, data) => {
358
354
  const iframe = document.querySelector("#vm-iframe");
355
+ iframe.style.display = "block";
359
356
  iframe.src = data.url;
360
357
  });
361
358
 
package/lib/commands.js CHANGED
@@ -807,7 +807,7 @@ let commands = {
807
807
  logger.info(`${result.stdout}`, true)
808
808
  }
809
809
 
810
- return result.stdout.trim();
810
+ return result.stdout?.trim();
811
811
  }
812
812
 
813
813
  } else if (language == "js") {
@@ -38,13 +38,7 @@ end tell`;
38
38
  // set value of attribute "AXMinimized" of every window of application process "${windowName}" to true
39
39
  // end tell`;
40
40
 
41
- const appleScriptActivate = (windowName) => `
42
- tell application id "${windowName}"
43
- set miniaturized of every window to false
44
- reopen
45
- activate
46
- end tell
47
- `;
41
+ const appleScriptActivate = (windowName) => `tell application "${windowName}" to activate`;
48
42
 
49
43
  const runPwsh = (appName, method) => {
50
44
  let script = `powershell -ExecutionPolicy Bypass -Command "& { ${scriptPath} '${appName}' '${method}' }"`;
@@ -63,7 +57,7 @@ async function focusApplication(appName) {
63
57
 
64
58
  try {
65
59
  if (platform() == "mac") {
66
- return await execSync(`osascript -e '${appleScriptSetFrontmost(appName)}'`);
60
+ return await execSync(`osascript -e '${appleScriptActivate(appName)}'`);
67
61
  } else if (platform() == "linux") {
68
62
  // TODO: This needs fixing
69
63
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "5.5.7",
3
+ "version": "5.5.9",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {