testdriverai 6.0.27-canary.3bcd63c.0 → 6.0.27-canary.ea72c58.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
  }
@@ -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
 
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "6.0.27-canary.3bcd63c.0",
3
+ "version": "6.0.27-canary.ea72c58.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