testdriverai 6.0.16-canary.e337e67.0 → 6.0.16-canary.ea858d7.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.
package/agent/index.js CHANGED
@@ -192,7 +192,7 @@ class TestDriverAgent extends EventEmitter2 {
192
192
 
193
193
  // fatal errors always exit the program
194
194
  // this ensure we log the error, summarize it, and exit cleanly
195
- async dieOnFatal(error) {
195
+ async dieOnFatal(error, skipPostrun = false) {
196
196
  // Show error with source context if available
197
197
  const errorContext = this.sourceMapper.getErrorWithSourceContext(error);
198
198
  if (errorContext) {
@@ -204,9 +204,13 @@ class TestDriverAgent extends EventEmitter2 {
204
204
  );
205
205
  }
206
206
 
207
- await this.summarize(error.message);
208
- // Always run postrun lifecycle script, even for fatal errors
209
- return await this.exit(true, false, true);
207
+ if (skipPostrun) {
208
+ this.exit(true);
209
+ } else {
210
+ await this.summarize(error.message);
211
+ // Always run postrun lifecycle script, even for fatal errors
212
+ return await this.exit(true, false, true);
213
+ }
210
214
  }
211
215
 
212
216
  // creates a new "thread" in which the AI is given an error
@@ -1584,9 +1588,12 @@ ${regression}
1584
1588
  this.emitter.emit(events.log.log, `This is beta software!`);
1585
1589
  this.emitter.emit(
1586
1590
  events.log.log,
1587
- theme.yellow(`Join our Forums for help`),
1591
+ theme.yellow(`Join our Discord for help`),
1592
+ );
1593
+ this.emitter.emit(
1594
+ events.log.log,
1595
+ `https://discord.com/invite/cWDFW8DzPm`,
1588
1596
  );
1589
- this.emitter.emit(events.log.log, `https://forums.testdriver.ai`);
1590
1597
 
1591
1598
  // make testdriver directory if it doesn't exist
1592
1599
  let testdriverFolder = path.join(this.workingDir);
@@ -1693,9 +1700,26 @@ ${regression}
1693
1700
  events.log.log,
1694
1701
  theme.gray(`- establishing connection...`),
1695
1702
  );
1696
- await this.sandbox.boot(this.config.TD_API_ROOT);
1703
+ let ableToBoot = await this.sandbox.boot(this.config.TD_API_ROOT);
1704
+
1705
+ if (!ableToBoot) {
1706
+ return await this.dieOnFatal(
1707
+ `Unable to connect to TestDriver sandbox service at ${this.config.TD_API_ROOT}.
1708
+ Please check your network connection, TD_API_KEY, or the service status.`,
1709
+ true,
1710
+ );
1711
+ }
1712
+
1697
1713
  this.emitter.emit(events.log.log, theme.gray(`- authenticating...`));
1698
- await this.sandbox.auth(this.config.TD_API_KEY);
1714
+ let ableToAuth = await this.sandbox.auth(this.config.TD_API_KEY);
1715
+
1716
+ if (!ableToAuth) {
1717
+ return await this.dieOnFatal(
1718
+ `Unable to authorize with TestDriver sandbox service at ${this.config.TD_API_ROOT}.
1719
+ Please check your network connection, TD_API_KEY, or the service status.`,
1720
+ true,
1721
+ );
1722
+ }
1699
1723
  }
1700
1724
 
1701
1725
  async connectToSandboxDirect(sandboxId, persist = false) {
@@ -84,10 +84,6 @@ const createSandbox = (emitter, analytics) => {
84
84
  this.socket.on("close", () => {
85
85
  clearInterval(this.heartbeat);
86
86
  // Emit a clear error event for API key issues
87
- emitter.emit(events.error.fatal, {
88
- message: "Socket closed. Check your API KEY (TD_API_KEY)",
89
- code: "API_KEY_MISSING_OR_INVALID",
90
- });
91
87
  reject();
92
88
  this.apiSocketConnected = false;
93
89
  });
package/docs/docs.json CHANGED
@@ -220,8 +220,8 @@
220
220
  "href": "https://github.com/testdriverai/testdriverai"
221
221
  },
222
222
  {
223
- "label": "Forums",
224
- "href": "https://forums.testdriver.ai"
223
+ "label": "Discord",
224
+ "href": "https://discord.com/invite/cWDFW8DzPm"
225
225
  },
226
226
  {
227
227
  "label": "Report an Issue",
@@ -13,6 +13,7 @@ When executing the `hover-image` and `hover-text` command, TestDriver may use th
13
13
 
14
14
  TestDriver may not accurately locate matches in certain cases. This can lead to unexpected behavior when using the `hover-image` or `hover-text` command. For example, if you specify a description that's too generic or similar to other images on the screen, TestDriver may not be able to identify the correct image to interact with. To improve accuracy, use specific and unique descriptions for images and text.
15
15
  When executing the `hover-image` and `hover-text` commands, TestDriver uses the provided description to identify the target image or text. If the description is too generic or matches multiple elements on the screen, TestDriver may not be able to determine which one to interact with, leading to unexpected behavior. To improve accuracy, always use specific and unique descriptions for both images and text.
16
+
16
17
  ### Avoid using `hover-text` for single characters (ex: `1`, `>`, `|`)
17
18
 
18
19
  To improve accuracy of our model, we do not include single characters or symbols in the matching data. This means that `hover-text` may not work as expected for these cases. If you need to interact with single characters or symbols, consider using the `match-image` command with a screenshot of the target element instead.
@@ -29,14 +30,14 @@ Assertions use the current state of the page to determine if the step passes or
29
30
 
30
31
  ## Reporting issues
31
32
 
32
- If you encounter any issues while using TestDriver, please report them to us. You can do this by creating a new issue in the [Feedback Forum](https://forums.testdriver.ai/c/feedback/10). We appreciate your feedback and will work to resolve any problems as quickly as possible.
33
+ If you encounter any issues while using TestDriver, please report them to us. You can do this by creating a new issue in the [discord](https://discord.com/invite/cWDFW8DzPm). We appreciate your feedback and will work to resolve any problems as quickly as possible.
33
34
 
34
35
  <Card
35
36
  title="Report an Issue"
36
37
  icon="arrow-turn-down-right"
37
38
  iconType="duotone"
38
39
  horizontal
39
- href="https://forums.testdriver.ai/c/feedback/10"
40
+ href="https://discord.com/invite/cWDFW8DzPm"
40
41
  >
41
42
  We'd love to hear from you!
42
43
  </Card>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "6.0.16-canary.e337e67.0",
3
+ "version": "6.0.16-canary.ea858d7.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/curl.sh DELETED
@@ -1,13 +0,0 @@
1
- curl -X POST "https://forums.testdriver.ai/users" \
2
- -H "Content-Type: application/json" \
3
- -H "Api-Key: YOUR_ADMIN_API_KEY" \
4
- -H "Api-Username: admin" \
5
- -d '{
6
- "name": "Jane Doe",
7
- "email": "jane.doe@example.com",
8
- "username": "janedoe",
9
- "active": false,
10
- "approved": true,
11
- "email_verified": false,
12
- "staged": false
13
- }'
package/debug-ast.js DELETED
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const yamlAst = require("@stoplight/yaml-ast-parser");
4
- const yaml = require("js-yaml");
5
- const fs = require("fs");
6
-
7
- function debugAST() {
8
- const testFile =
9
- "/Users/ianjennings/Development/testdriverai/test-source-mapping.yaml";
10
- const yamlContent = fs.readFileSync(testFile, "utf-8");
11
-
12
- console.log("YAML Content:");
13
- console.log(yamlContent);
14
- console.log("\n" + "=".repeat(50) + "\n");
15
-
16
- const ast = yamlAst.load(yamlContent);
17
-
18
- console.log("AST Structure:");
19
- console.log(
20
- JSON.stringify(
21
- ast,
22
- (key, value) => {
23
- if (key === "parent") return "[parent]"; // Avoid circular reference
24
- return value;
25
- },
26
- 2,
27
- ),
28
- );
29
-
30
- console.log("\n" + "=".repeat(50) + "\n");
31
-
32
- // Test with js-yaml for comparison
33
- const yamlObj = yaml.load(yamlContent);
34
- console.log("js-yaml result:");
35
- console.log(JSON.stringify(yamlObj, null, 2));
36
- }
37
-
38
- debugAST();