testdriverai 6.0.26 → 6.0.27-canary.062dddf.0

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.
@@ -3,5 +3,8 @@
3
3
  "source.organizeImports": "explicit"
4
4
  },
5
5
  "editor.formatOnSave": true,
6
- "editor.defaultFormatter": "esbenp.prettier-vscode"
6
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
7
+ "yaml.schemas": {
8
+ "https://raw.githubusercontent.com/testdriverai/testdriverai/main/schema.json": "file:///Users/kid/Desktop/td/internal/testdriverai/testdriver.yaml"
9
+ }
7
10
  }
package/agent/index.js CHANGED
@@ -1139,21 +1139,8 @@ ${yml}
1139
1139
 
1140
1140
  // Create diff if file exists and content has changed
1141
1141
  let diffResult = null;
1142
- console.log("Checking for diff. File exists:", fileExists);
1143
- console.log(
1144
- "Content changed:",
1145
- fileExists && existingContent !== regression,
1146
- );
1147
- if (fileExists) {
1148
- console.log(
1149
- "Existing content preview:",
1150
- existingContent.substring(0, 100),
1151
- );
1152
- console.log("New content preview:", regression.substring(0, 100));
1153
- }
1154
1142
 
1155
1143
  if (fileExists && existingContent !== regression) {
1156
- console.log("Creating diff - content has changed");
1157
1144
  const patches = diff.structuredPatch(
1158
1145
  filepath,
1159
1146
  filepath,
@@ -1241,8 +1228,6 @@ ${yml}
1241
1228
  diff: diffResult,
1242
1229
  timestamp: endTime,
1243
1230
  });
1244
- } else {
1245
- console.log("No diff result to emit");
1246
1231
  }
1247
1232
 
1248
1233
  // Emit file save completion event
@@ -134,6 +134,7 @@ commands:
134
134
  object.description,
135
135
  object.action,
136
136
  object.method,
137
+ object.timeout,
137
138
  );
138
139
  break;
139
140
  case "hover-image":
@@ -339,11 +339,12 @@ const createCommands = (
339
339
  description = null,
340
340
  action = "click",
341
341
  method = "turbo",
342
+ timeout = 5000, // we pass this to the subsequent wait-for-text block
342
343
  ) => {
343
344
  text = text ? text.toString() : null;
344
345
 
345
346
  // wait for the text to appear on screen
346
- await commands["wait-for-text"](text, 5000);
347
+ await commands["wait-for-text"](text, timeout);
347
348
 
348
349
  description = description ? description.toString() : null;
349
350
 
@@ -30,6 +30,7 @@ npx testdriverai@latest <command> [options]
30
30
  | `--headless` | Run test without opening a browser window (useful for CI/CD environments) |
31
31
  | `--new` | Create a new sandbox environment for the test run. |
32
32
  | `--summary=<value>` | Output file where AI summary should be saved. |
33
+ | `--junit=<value>` | Output file where junit report should be saved. |
33
34
 
34
35
  ## Example usage
35
36
 
@@ -18,12 +18,13 @@ The `hover-text` command is used to locate text on the screen based on a descrip
18
18
 
19
19
  ## Arguments
20
20
 
21
- | Argument | Type | Description |
22
- | :-----------: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
- | `text` | `string` | The text to find on the screen. Longer and unique is better. |
24
- | `description` | `string` | A description of the text and what it represents. The actual text itself shouldn't be included here. |
21
+ | Argument | Type | Description |
22
+ | :-----------: | :------: | :------------------------------------------------------ |
23
+ | `text` | `string` | The text to find on the screen. Longer and unique is better. |
24
+ | `description` | `string` | A description of the text and what it represents. The actual text itself shouldn't be included here. |
25
25
  | `action` | `string` | The action to take when the text is found. Available actions are: `click`, `right-click`, `double-click`, `hover`. Also supports `drag-start` and `drag-end` for [dragging text](/commands/hover-image#drag-functionality). |
26
- | `method` | `enum` | The matching algorithm to use. Possible values are `turbo` (default) and `ai`. |
26
+ | `method` | `enum` | The matching algorithm to use. Possible values are `turbo` (default) and `ai`.|
27
+ | `timeout` | `number` | **(Optional)** The duration in milliseconds to wait for the text to appear. Default is `5000` (5 seconds).|
27
28
 
28
29
  ## Example usage
29
30
 
@@ -32,11 +33,12 @@ command: hover-text
32
33
  text: Sign Up
33
34
  description: link in the header
34
35
  action: click
36
+ timeout: 10000 # 10 seconds
35
37
  ```
36
38
 
37
39
  ## Gotchas
38
40
 
39
- - If the text can't be located, the command will fail. Ensure the text is visible on the screen and matches exactly.
41
+ - If the text can't be located, it will internally call the [wait-for-text](/commands/wait-for-text) command and wait for the text to appear. The wait `timeout` is 5 seconds by default, and the command fails if the text is not found.
40
42
  - Variations in font size, style, or screen resolution may affect detection accuracy.
41
43
 
42
44
  ## Notes
package/docs/docs.json CHANGED
@@ -38,7 +38,6 @@
38
38
  "group": "CLI",
39
39
  "icon": "terminal",
40
40
  "pages": [
41
- "/getting-started/cli",
42
41
  "/cli/overview",
43
42
  {
44
43
  "group": "Commands",
@@ -50,7 +49,8 @@
50
49
  ]
51
50
  }
52
51
  ]
53
- }
52
+ },
53
+ "/getting-started/vscode"
54
54
  ]
55
55
  },
56
56
  {
@@ -172,16 +172,7 @@
172
172
  "/commands/wait-for-text"
173
173
  ]
174
174
  }
175
- ],
176
- "global": {
177
- "anchors": [
178
- {
179
- "anchor": "Book a Demo",
180
- "href": "https://testdriver.ai/demo",
181
- "icon": "calendar"
182
- }
183
- ]
184
- }
175
+ ]
185
176
  },
186
177
  "modeToggle": {
187
178
  "enabled": false,
@@ -198,13 +189,17 @@
198
189
  "label": "Discord",
199
190
  "icon": "discord",
200
191
  "href": "https://discord.com/invite/cWDFW8DzPm"
201
- }
202
- ],
203
- "primary": {
204
- "type": "button",
192
+ },
193
+ {
194
+ "label": "Book a Demo",
195
+ "href": "https://form.typeform.com/to/UECf9rDx?typeform-source=docs.testdriver.ai",
196
+ "icon": "calendar"
197
+ }, {
198
+ "icon": "gauge-high",
205
199
  "label": "Dashboard",
206
200
  "href": "https://app.testdriver.ai"
207
201
  }
202
+ ]
208
203
  },
209
204
  "footer": {
210
205
  "socials": {
@@ -1,75 +1,81 @@
1
1
  ---
2
2
  title: "Install the TestDriver VS Code Extension"
3
- sidebarTitle: "VS Code Setup"
3
+ sidebarTitle: "VS Code (Beta)"
4
4
  description: "Comprehensive guide to installing and setting up TestDriver for VS Code"
5
5
  icon: "file-code"
6
6
  ---
7
7
 
8
- <Card
9
- title="Get the VS Code Extension"
10
- icon="link"
11
- href="https://marketplace.visualstudio.com/items?itemName=testdriver.testdriver"
12
- >
13
- Turn your IDE into a powerful computer-use automation tool with our VS Code
14
- extension.
15
- </Card>
8
+ <iframe
9
+ className="w-full aspect-video rounded-xl"
10
+ src="https://www.youtube.com/embed/dell_2tI6nc"
11
+ title="YouTube video player"
12
+ frameBorder="0"
13
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
14
+ allowFullScreen
15
+ ></iframe>
16
16
 
17
- <Steps>
18
- <Step title="Initialize Your Project" stepNumber={1}>
19
- Set up your project with:
20
-
21
- ```bash
22
- npx testdriverai@latest init
23
- ```
17
+ The TestDriver VS Code extension is a powerful tool that integrates TestDriver's AI-driven test generation capabilities directly into your development environment:
24
18
 
25
- This creates a `.env` file and sample workflow files.
19
+ - Get started with example scripts for different platforms
20
+ - Get syntax highlighting and autocompletion for [TestDriver YAML](/getting-started/editing)
21
+ - Chat with the TestDriver agent to generate tests based on your requirements
22
+ - Save and manage your tests directly within your project
23
+ - Run and debug tests directly from the IDE
24
+ - View test results and logs within the IDE
26
25
 
27
- </Step>
28
- <Step title="Run TestDriver in Interactive Mode" stepNumber={2}>
29
- Start TestDriver in interactive mode to create and refine tests dynamically:
26
+ <Tip>The TestDriver VS Code Extension is currently in beta. If you encounter any issues or have feedback, please let us know [in Discord](https://discord.com/invite/cWDFW8DzPm)</Tip>
30
27
 
31
- ```bash
32
- npx testdriverai@latest
33
- ```
34
-
35
- Once started, you can use commands like `/explore`, `/run`, and `/save` to interactively build and test your flows.
28
+ <Steps>
29
+ <Step title="Install the VS Code Extension">
30
+
31
+ Click the button below to install the TestDriver extension for your preferred IDE. Then, follow the setup guide and chat with TestDriver to create your first test.
32
+
33
+ <Card
34
+ horizontal
35
+ title="VS Code"
36
+ arrow
37
+ href="vscode:extension/testdriver.testdriver"
38
+ icon="/images/content/extension/vscode.svg"
39
+ ></Card>
40
+
41
+ <Card
42
+ horizontal
43
+ title="Cursor"
44
+ arrow
45
+ href="cursor:extension/testdriver.testdriver"
46
+ icon="/images/content/extension/cursor.svg"
47
+
48
+ > </Card>
49
+
50
+ <Card
51
+ horizontal
52
+ title="Windsurf"
53
+ arrow
54
+ href="windsurf:extension/testdriver.testdriver"
55
+ icon="/images/content/extension/windsurf.svg"
56
+ ></Card>
36
57
 
37
58
  </Step>
38
- <Step title="Define Your Test Steps" stepNumber={3}>
39
- Use natural language to describe what you want to test. For example:
59
+ <Step title="Set Your TestDriver API Key">
60
+
61
+ After installing the extension, you'll need to set your TestDriver API key in the extension settings.
40
62
 
41
- ```
42
- > Open Google Chrome and search for "testdriverai"
43
- ```
44
-
45
- TestDriver will generate steps like:
46
-
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:
58
- - enter
59
- ```
63
+ 1. Open the command palette (Cmd+Shift+P or Ctrl+Shift+P).
64
+ 2. Search for "Preferences: Open Settings (UI)" and select it.
65
+ 3. In the search bar, type "TestDriver" to filter the settings.
66
+ 4. Find the "TestDriver: Set API Key" field and enter your API key from [the TestDriver dashboard](https://app.testdriver.ai/team).
60
67
 
68
+ <Tip>You can also set the `TD_API_KEY` environment variable in your system if you prefer not to enter it directly in the extension settings.</Tip>
69
+
61
70
  </Step>
62
- <Step title="Refine and Save Your Test" stepNumber={4}>
63
- - Save your test with `/save` to generate a reusable YAML file.
64
- - Use `/run` to run the test.
71
+ <Step title="Choose a Platform">
72
+ Click on the TestDriver icon in the sidebar to open the extension panel and choose a platform to get started (Web, Desktop, or Mobile).
65
73
  </Step>
66
- <Step title="Run Saved Tests" stepNumber={5}>
67
- Once saved, you can run your test file anytime:
68
-
69
- ```bash
70
- npx testdriverai@latest run path/to/test.yaml
71
- ```
72
-
74
+ <Step title="Create Your First Test">
75
+ Now chat with the TestDriver agent to create your first test! Describe what you want to test, and the agent will generate the test steps for you.
76
+ </Step>
77
+ <Step title="Run your test">
78
+ Run your test by clicking the "Run" button in the extension panel. You can view the test results and logs directly within VS Code's Test Explorer. [Learn more about running tests in VS Code](https://code.visualstudio.com/docs/debugtest/testing).
73
79
  </Step>
74
80
  </Steps>
75
81
 
@@ -13,6 +13,8 @@ TestDriver operates a full desktop environment, so it can run any application.
13
13
  | Application | TestDriver | Playwright | Selenium |
14
14
  |:-----------------:|:---------:|:-----------:|:--------:|
15
15
  | Web Apps | ✅ | ✅ | ✅ |
16
+ | Mobile Apps | ✅ | ✅ | ✅ |
17
+ | VS Code | ✅ | ✅ | ✅ |
16
18
  | Desktop Apps | ✅ | | |
17
19
  | Chrome Extensions | ✅ | | |
18
20
  </div>
@@ -96,4 +98,4 @@ TestDriver currently supports Mac and Windows!
96
98
  | Windows | ✅ | ✅ | ✅ |
97
99
  | Mac | ✅ | ✅ | ✅ |
98
100
  | Linux | | ✅ | ✅ |
99
- </div>
101
+ </div>
@@ -6,53 +6,106 @@ icon: "gauge-high"
6
6
  mode: "wide"
7
7
  ---
8
8
 
9
- <Tip>
10
- You will need a [TestDriver Pro](https://app.testdriver.ai/team) account
11
- ($20/m) to complete setup.
12
- </Tip>
13
9
 
14
10
  <Steps>
15
- <Step title="Install TestDriver">
16
-
17
- Click the button below to install the TestDriver extension for your preferred IDE. Then, follow the setup guide and chat with TestDriver to create your first test.
18
-
11
+ <Step title="Create a TestDriver Account">
12
+
13
+ You will need a [TestDriver Pro](https://app.testdriver.ai/team) account ($20/month) to get an API key.
14
+
19
15
  <Card
20
- horizontal
21
- title="VS Code"
16
+ title="Sign Up for TestDriver"
17
+ icon="user-plus"
18
+ href="https://app.testdriver.ai/team"
22
19
  arrow
23
- href="vscode:extension/testdriver.testdriver"
24
- icon="/images/content/extension/vscode.svg"
20
+ horizontal
25
21
  ></Card>
26
22
 
27
- <Card
28
- horizontal
29
- title="Cursor"
30
- arrow
31
- href="cursor:extension/testdriver.testdriver"
32
- icon="/images/content/extension/cursor.svg"
23
+ </Step>
24
+ <Step title="Set up your environment">
25
+
26
+ Copy your API key from [the TestDriver dashboard](https://app.testdriver.ai/team), and set it as an environment variable.
27
+
28
+ <Tabs>
29
+ <Tab title="macOS / Linux">
30
+ ```bash Export an environment variable on macOS or Linux systems
31
+ export TD_API_KEY="your_api_key_here"
32
+ ```
33
+ </Tab>
34
+ <Tab title="Windows">
35
+ ```powershell Export an environment variable in PowerShell
36
+ setx TD_API_KEY "your_api_key_here"
37
+ ```
38
+ </Tab>
39
+ </Tabs>
40
+
41
+ <Tip>Using VS Code, Cursor, or Windsurf? [Try our VS Code Extension (beta)](/getting-started/vscode).</Tip>
33
42
 
34
- > </Card>
43
+ </Step>
44
+ <Step title="Check out an example test">
45
+
46
+ Download the TestDriver GitHub repository and run the example test.
35
47
 
36
- <Card
37
- horizontal
38
- title="Windsurf"
39
- arrow
40
- href="windsurf:extension/testdriver.testdriver"
41
- icon="/images/content/extension/windsurf.svg"
42
- ></Card>
48
+ ```bash
49
+ git clone --depth 1 https://github.com/testdriverai/cli testdriverai
50
+ cd testdriverai/testdriver/acceptance
51
+ ```
43
52
 
44
- The extension will generate most of your tests for you, but you'll probably want to customize them. [Learn more about editing tests](/getting-started/editing).
53
+ TestDriver tests are written in YAML, a human-readable data format. The `prompt.yaml` file contains an example series of steps for the agent to execute.
54
+
55
+ ```yaml testdriver/acceptance/prompt.yaml
56
+ steps:
57
+ - prompt: log in
58
+ - prompt: add an item to the cart
59
+ - prompt: click on the cart icon
60
+ - prompt: complete checkout
61
+ ```
62
+
63
+ Each step has a `prompt` that describes what the agent should do. The agent will use the prompt to generate [commands](/commands/assert) that make the tests faster and more reliable the next time you run the test.
45
64
 
46
65
  </Step>
47
- <Step title="Run your tests in CI/CD">
66
+ <Step title="Generate regression test from prompts">
48
67
 
49
- Next, use `testdriverai` to run your tests in CI/CD pipelines.
68
+ Run the following command to run the test file. TestDriver will spawn a virtual machine, launch the sandbox test page, and execute the steps defined in the `prompt.yaml` file.
50
69
 
51
70
  ```bash
52
- TD_API_KEY=YOUR_KEY npx testdriverai@latest run testdriver/test.yaml
71
+ npx testdriverai@latest run prompt.yaml --write --heal
53
72
  ```
54
73
 
55
- Note that you'll want to store your API key within secret storeage. [Learn more about running tests in CI/CD pipelines](/action/setup).
74
+ The `--write` flag tells TestDriver to save any generated commands to the test file, and the `--heal` flag allows TestDriver to recover from unexpected issues during the test run.
75
+
76
+ <Tip>You can use an interactive CLI to generate test steps with the [explore command](/interactive/explore)</Tip>
77
+
78
+ </Step>
79
+ <Step title="Run the generated regression test">
80
+
81
+ After TestDriver has run the exploratory test, you'll see that the `prompt.yaml` file has been updated with commands generated by the agent to make the test faster and more reliable.
82
+
83
+ ```yaml
84
+ version: 6.0.0
85
+ steps:
86
+ - prompt: focus chrome
87
+ commands:
88
+ - command: focus-application
89
+ name: Google Chrome
90
+ - prompt: enter a username
91
+ commands:
92
+ - command: hover-text
93
+ text: Username
94
+ description: username input field
95
+ action: click
96
+ - command: type
97
+ text: standard_user
98
+ - prompt: enter a password
99
+ commands:
100
+ - command: hover-text
101
+ text: Password
102
+ description: password input field
103
+ action: click
104
+ - command: type
105
+ text: secret_password
106
+ ```
107
+
108
+ The `--write` command tells the agent to save the generated commands to the test file, and the `--heal` command gives the agent permission to recover if something goes wrong.
56
109
 
57
110
  </Step>
58
111
 
@@ -110,7 +110,7 @@ class ReadlineInterface {
110
110
 
111
111
  try {
112
112
  // Parse interactive commands (starting with /)
113
- if (input.startsWith("/")) {
113
+ if (input.startsWith("/") && !input.startsWith("/explore")) {
114
114
  const parts = input.slice(1).split(" ");
115
115
  const commandName = parts[0];
116
116
  const args = parts.slice(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "6.0.26",
3
+ "version": "6.0.27-canary.062dddf.0",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {
package/schema.json CHANGED
@@ -415,6 +415,9 @@
415
415
  "ai",
416
416
  "turbo"
417
417
  ]
418
+ },
419
+ "timeout": {
420
+ "type": "integer"
418
421
  }
419
422
  }
420
423
  },
@@ -1,4 +1,4 @@
1
- version: 5.7.7
1
+ version: 6.0.0
2
2
  session: 682f5aab811bd5a322c0e5a1
3
3
  steps:
4
4
  - prompt: click on sign in
@@ -9,5 +9,6 @@ steps:
9
9
  text: Sign In
10
10
  description: black button below the password field
11
11
  action: click
12
+ timeout: 5000
12
13
  - command: assert
13
14
  expect: an error shows that fields are required
@@ -1,7 +1,10 @@
1
1
  version: 6.0.0
2
2
  session: 6869c3e61445b2acbbdc0018
3
3
  steps:
4
- - prompt: enter a valid username, password, and sign in
4
+ - prompt: log in
5
+ - prompt: add an item to the cart
6
+ - prompt: click on the cart icon
7
+ - prompt: complete checkout
5
8
  - prompt: assert
6
9
  commands:
7
10
  - command: assert
@@ -6,7 +6,7 @@ steps:
6
6
  - command: exec
7
7
  lang: pwsh
8
8
  code: |
9
- Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList "--start-maximized --disable-infobars --disable-fre --no-default-browser-check --no-first-run --guest --load-extension=$(pwd)/node_modules/dashcam-chrome/build", "${TD_WEBSITE}"
9
+ Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList "--start-maximized --disable-infobars --disable-fre --no-default-browser-check --no-first-run --guest --load-extension=$(pwd)/node_modules/dashcam-chrome/build", "https://testdriver-sandbox.vercel.app/"
10
10
  - command: wait-for-text
11
11
  text: ${TD_WEBSITE}
12
12
  timeout: 60000