testdriverai 5.3.1 → 5.3.3

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.
Files changed (60) hide show
  1. package/agent.js +26 -3
  2. package/docs/action/browser.mdx +1 -0
  3. package/docs/action/os.mdx +1 -0
  4. package/docs/action/output.mdx +1 -0
  5. package/docs/action/performance.mdx +1 -0
  6. package/docs/action/prerun.mdx +1 -0
  7. package/docs/action/secrets.mdx +1 -0
  8. package/docs/action/setup.mdx +1 -0
  9. package/docs/commands/assert.mdx +1 -0
  10. package/docs/commands/exec.mdx +1 -0
  11. package/docs/commands/focus-application.mdx +1 -0
  12. package/docs/commands/hover-image.mdx +1 -0
  13. package/docs/commands/hover-text.mdx +1 -0
  14. package/docs/commands/if.mdx +1 -0
  15. package/docs/commands/match-image.mdx +1 -0
  16. package/docs/commands/press-keys.mdx +1 -0
  17. package/docs/commands/run.mdx +1 -0
  18. package/docs/commands/scroll-until-image.mdx +1 -0
  19. package/docs/commands/scroll-until-text.mdx +1 -0
  20. package/docs/commands/scroll.mdx +1 -0
  21. package/docs/commands/type.mdx +1 -0
  22. package/docs/commands/wait-for-image.mdx +1 -0
  23. package/docs/commands/wait-for-text.mdx +1 -0
  24. package/docs/commands/wait.mdx +1 -0
  25. package/docs/docs-future.json.txt +114 -0
  26. package/docs/docs.json +19 -91
  27. package/docs/features/auto-healing.mdx +15 -34
  28. package/docs/getting-started/ci.mdx +65 -122
  29. package/docs/getting-started/editing.mdx +77 -0
  30. package/docs/getting-started/generating.mdx +14 -169
  31. package/docs/getting-started/running.mdx +28 -51
  32. package/docs/getting-started/setup.mdx +23 -2
  33. package/docs/getting-started/vscode.mdx +79 -0
  34. package/docs/getting-started/writing.mdx +4 -3
  35. package/docs/guide/assertions.mdx +1 -0
  36. package/docs/guide/authentication.mdx +1 -0
  37. package/docs/guide/code.mdx +1 -0
  38. package/docs/guide/locating.mdx +1 -0
  39. package/docs/guide/setup-teardown.mdx +1 -0
  40. package/docs/guide/variables.mdx +4 -0
  41. package/docs/guide/waiting.mdx +24 -28
  42. package/docs/overview/comparison.mdx +4 -0
  43. package/docs/overview/faq.mdx +1 -0
  44. package/docs/overview/quickstart.mdx +10 -0
  45. package/docs/overview/what-is-testdriver.mdx +2 -0
  46. package/docs/security/action.mdx +1 -2
  47. package/docs/security/agent.mdx +1 -2
  48. package/docs/security/platform.mdx +1 -2
  49. package/lib/commander.js +6 -0
  50. package/lib/commands.js +2 -1
  51. package/lib/generator.js +1 -60
  52. package/package.json +1 -1
  53. package/test.yml +18 -0
  54. package/testdriver/testdriver_2025-04-14T17-43-37-760Z.yaml +10 -0
  55. package/testdriver/testdriver_2025-04-14T17-45-00-565Z.yaml +13 -0
  56. package/testdriver/testdriver_2025-04-14T23-14-46-822Z.yaml +0 -0
  57. package/testdriver/testdriver_2025-04-14T23-14-51-653Z.yaml +0 -0
  58. package/testdriver/testdriver_2025-04-15T00-34-42-776Z.yaml +0 -0
  59. package/testdriver/testdriver_2025-04-15T00-35-22-776Z.yaml +4 -0
  60. package/testdriver/testdriver_2025-04-15T00-36-47-767Z.yaml +0 -0
package/agent.js CHANGED
@@ -461,9 +461,17 @@ const aiExecute = async (message, validateAndLoop = false, dry = false) => {
461
461
 
462
462
  if (checkCodeblocks.length > 0) {
463
463
  logger.debug("check thinks more needs to be done");
464
+
465
+ logger.info(chalk.dim("not done yet!"), "testdriver");
466
+ logger.info("");
467
+
464
468
  return await aiExecute(response, validateAndLoop);
465
469
  } else {
466
470
  logger.debug("seems complete, returning");
471
+
472
+ logger.info(chalk.green("success!"), "testdriver");
473
+ logger.info("");
474
+
467
475
  return response;
468
476
  }
469
477
  }
@@ -1010,10 +1018,25 @@ let runRawYML = async (yml) => {
1010
1018
 
1011
1019
  let decoded = decodeURIComponent(yml);
1012
1020
 
1013
- // saved the yml to a temp file using tmp
1014
- // and run it with run()
1015
- fs.writeFileSync(tmpobj.name, await generator.rawToFormatted(decoded));
1021
+ // parse the yaml
1022
+ let ymlObj = null;
1023
+ try {
1024
+ ymlObj = await yaml.load(decoded);
1025
+ } catch (e) {
1026
+ logger.error("%s", e);
1027
+ }
1028
+
1029
+ // add the root key steps: with array of commands:
1030
+ if (ymlObj && !ymlObj.steps) {
1031
+ ymlObj = {
1032
+ steps: [ymlObj],
1033
+ };
1034
+ }
1035
+
1036
+ // write the yaml to a file
1037
+ fs.writeFileSync(tmpobj.name, yaml.dump(ymlObj));
1016
1038
 
1039
+ // and run it with run()
1017
1040
  await run(tmpobj.name, false, true);
1018
1041
 
1019
1042
  }
@@ -2,6 +2,7 @@
2
2
  title: "Testing Multiple Browsers"
3
3
  sidebarTitle: "Browsers"
4
4
  description: "Configure prerun scripts to launch different browsers in TestDriver."
5
+ icon: "chrome"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -2,6 +2,7 @@
2
2
  title: "Testing Multiple Operating Systems"
3
3
  sidebarTitle: "Operating Systems"
4
4
  description: "Configuring Operating Systems in TestDriver GitHub Action"
5
+ icon: "windows"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -2,6 +2,7 @@
2
2
  title: "GitHub Action Output"
3
3
  sidebarTitle: "Action Output"
4
4
  description: "Understanding and utilizing the output variables from the TestDriver GitHub Action"
5
+ icon: "film"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -2,6 +2,7 @@
2
2
  title: "Optimizing Performance in TestDriver"
3
3
  sidebarTitle: "Performance Optimization"
4
4
  description: "Optimizing Performance in TestDriver"
5
+ icon: "rabbit-running"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -2,6 +2,7 @@
2
2
  title: "Prerun Scripts"
3
3
  sidebarTitle: "Prerun Scripts"
4
4
  description: "Learn how to customize and set up your TestDriver environment to optimize your CI/CD pipeline."
5
+ icon: "hammer"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -2,6 +2,7 @@
2
2
  title: "Managing Secrets in GitHub Actions"
3
3
  sidebarTitle: "Secrets Management"
4
4
  description: "Discover how to securely configure and optimize your TestDriver environment for seamless CI/CD workflows."
5
+ icon: "mask"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -2,6 +2,7 @@
2
2
  title: "GitHub Action Setup Guide"
3
3
  sidebarTitle: "Setup Guide"
4
4
  description: "Learn how to set up and configure the TestDriver GitHub Action for automated cloud-based testing in your CI/CD workflows."
5
+ icon: "wrench"
5
6
  ---
6
7
 
7
8
  ## Overview
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "assert"
3
+ icon: "check"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "exec"
3
+ icon: "code"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "focus-application"
3
+ icon: "window-restore"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "hover-image"
3
+ icon: "image"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "hover-text"
3
+ icon: "text"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "if"
3
+ icon: "code-branch"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "match-image"
3
+ icon: "images"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "press-keys"
3
+ icon: "keyboard-brightness"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "run"
3
+ icon: "play"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "scroll-until-image"
3
+ icon: "scroll"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "scroll-until-text"
3
+ icon: "scroll"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "scroll"
3
+ icon: "scroll"
3
4
  ---
4
5
 
5
6
  # Command: `scroll`
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "type"
3
+ icon: "keyboard"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "wait-for-image"
3
+ icon: "hourglass"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "wait-for-text"
3
+ icon: "hourglass"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  title: "wait"
3
+ icon: "hourglass"
3
4
  ---
4
5
 
5
6
  ## Description
@@ -0,0 +1,114 @@
1
+
2
+ {
3
+ "group": "Features",
4
+ "pages": [
5
+ "/features/selectorless",
6
+ "/features/generation",
7
+ "/features/visual-assertions",
8
+ "/features/auto-healing",
9
+ "/features/cross-platform",
10
+ "/features/reusable-snippets",
11
+ "/features/parallel-testing",
12
+ "/features/github"
13
+ ]
14
+ },
15
+ {
16
+ "tab": "Examples",
17
+ "groups": [
18
+ {
19
+ "group": "Scenarios",
20
+ "pages": [
21
+ "cookie-banner",
22
+ "log-in",
23
+ "spell-check",
24
+ "form-filling",
25
+ "file-upload",
26
+ "pdf-generation",
27
+ "ai-chatbot"
28
+ ]
29
+ },
30
+ {
31
+ "group": "Apps",
32
+ "pages": [
33
+ "static-websites",
34
+ "chrome-extensions",
35
+ "mobile-apps",
36
+ "desktop-apps"
37
+ ]
38
+ }]
39
+ },
40
+ {
41
+ "tab": "Integrations",
42
+ "groups": [
43
+ {
44
+ "group": "Buidling",
45
+ "pages": [
46
+ "/integrations/vercel",
47
+ "/integrations/netlify",
48
+ "/integrations/electron"
49
+ ]
50
+ },
51
+ {
52
+ "group": "Importing",
53
+ "pages": [
54
+ "/importing/testrail",
55
+ "/importing/jira",
56
+ "/importing/gherkin",
57
+ "/importing/csv"
58
+ ]
59
+ },
60
+ {
61
+ "group": "Exporting",
62
+ "pages": [
63
+ "/exploting/playwright"
64
+ ]
65
+ },
66
+ {
67
+ "group": "Bug Reporting",
68
+ "pages": [
69
+ "/bugs/jira"
70
+ ]
71
+ }]
72
+ },
73
+
74
+
75
+
76
+ {
77
+ "tab": "Guide",
78
+ "groups": [
79
+ {
80
+ "group": "Getting Started",
81
+ "pages": [
82
+ "/getting-started/vscode",
83
+ "/getting-started/setup",
84
+ "/getting-started/writing",
85
+ "/getting-started/generating",
86
+ "/getting-started/running",
87
+ "/getting-started/ci"
88
+ ]
89
+ },
90
+ {
91
+ "group": "Writing Tests",
92
+ "pages": [
93
+ "/guide/locating",
94
+ "/guide/waiting",
95
+ "/guide/assertions",
96
+ "/guide/variables",
97
+ "/guide/authentication",
98
+ "/guide/setup-teardown",
99
+ "/guide/code"
100
+ ]
101
+ },
102
+ {
103
+ "group": "Running in CI",
104
+ "pages": [
105
+ "/action/setup",
106
+ "/action/browser",
107
+ "/action/os",
108
+ "/action/output",
109
+ "/action/performance",
110
+ "/action/prerun",
111
+ "/action/secrets"
112
+ ]
113
+ }]
114
+ },
package/docs/docs.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "$schema": "https://mintlify.com/docs.json",
3
- "theme": "palm",
3
+ "theme": "mint",
4
4
  "name": "TestDriver",
5
5
  "colors": {
6
6
  "primary": "#b3d334",
7
- "light": "#a3a4a0",
7
+ "light": "#b3d334",
8
8
  "dark": "#050d23"
9
9
  },
10
10
  "favicon": "/images/template/icon.png",
@@ -22,40 +22,17 @@
22
22
  "/overview/comparison"
23
23
  ]
24
24
  },
25
- {
26
- "group": "Features",
27
- "pages": [
28
- "/features/selectorless",
29
- "/features/generation",
30
- "/features/visual-assertions",
31
- "/features/auto-healing",
32
- "/features/cross-platform",
33
- "/features/reusable-snippets",
34
- "/features/parallel-testing",
35
- "/features/github"
36
- ]
37
- },
38
- {
39
- "group": "Security & Privacy",
40
- "pages": [
41
- "/security/agent",
42
- "/security/action",
43
- "/security/platform"
44
- ]
45
- }
46
- ]
47
- },
48
- {
49
- "tab": "Guide",
50
- "groups": [
51
25
  {
52
26
  "group": "Getting Started",
53
27
  "pages": [
28
+ "/getting-started/vscode",
54
29
  "/getting-started/setup",
55
- "/getting-started/writing",
56
30
  "/getting-started/generating",
31
+ "/getting-started/writing",
57
32
  "/getting-started/running",
58
- "/getting-started/ci"
33
+ "/getting-started/ci",
34
+ "/features/auto-healing",
35
+ "/getting-started/editing"
59
36
  ]
60
37
  },
61
38
  {
@@ -81,65 +58,16 @@
81
58
  "/action/prerun",
82
59
  "/action/secrets"
83
60
  ]
84
- }]
85
- },
86
- {
87
- "tab": "Examples",
88
- "groups": [
89
- {
90
- "group": "Scenarios",
91
- "pages": [
92
- "cookie-banner",
93
- "log-in",
94
- "spell-check",
95
- "form-filling",
96
- "file-upload",
97
- "pdf-generation",
98
- "ai-chatbot"
99
- ]
100
61
  },
101
62
  {
102
- "group": "Apps",
103
- "pages": [
104
- "static-websites",
105
- "chrome-extensions",
106
- "mobile-apps",
107
- "desktop-apps"
108
- ]
109
- }]
110
- },
111
- {
112
- "tab": "Integrations",
113
- "groups": [
114
- {
115
- "group": "Buidling",
116
- "pages": [
117
- "/integrations/vercel",
118
- "/integrations/netlify",
119
- "/integrations/electron"
120
- ]
121
- },
122
- {
123
- "group": "Importing",
124
- "pages": [
125
- "/importing/testrail",
126
- "/importing/jira",
127
- "/importing/gherkin",
128
- "/importing/csv"
129
- ]
130
- },
131
- {
132
- "group": "Exporting",
133
- "pages": [
134
- "/exploting/playwright"
135
- ]
136
- },
137
- {
138
- "group": "Bug Reporting",
63
+ "group": "Security & Privacy",
139
64
  "pages": [
140
- "/bugs/jira"
65
+ "/security/agent",
66
+ "/security/action",
67
+ "/security/platform"
141
68
  ]
142
- }]
69
+ }
70
+ ]
143
71
  },
144
72
  {
145
73
  "tab": "Reference",
@@ -151,8 +79,8 @@
151
79
  "/commands/exec",
152
80
  "/commands/focus-application",
153
81
  "/commands/hover-image",
154
- "/commands/match-image",
155
82
  "/commands/hover-text",
83
+ "/commands/match-image",
156
84
  "/commands/if",
157
85
  "/commands/press-keys",
158
86
  "/commands/run",
@@ -188,13 +116,13 @@
188
116
  "anchors": [
189
117
  {
190
118
  "anchor": "Community",
191
- "href": "https://mintlify.com/community",
119
+ "href": "https://discord.com/invite/cWDFW8DzPm",
192
120
  "icon": "discord"
193
121
  },
194
122
  {
195
- "anchor": "Enterprise",
196
- "href": "https://mintlify.com/docs",
197
- "icon": "book-open-cover"
123
+ "anchor": "Book a Demo",
124
+ "href": "https://calendly.com/d/cq23-qyn-3v6/testdriver-ai-demo",
125
+ "icon": "calendar"
198
126
  }
199
127
  ]
200
128
  }
@@ -208,7 +136,7 @@
208
136
  "links": [
209
137
  {
210
138
  "label": "Support",
211
- "href": "mailto:hi@mintlify.com"
139
+ "href": "https://testdriver.canny.io/testdriver"
212
140
  }
213
141
  ],
214
142
  "primary": {
@@ -2,21 +2,14 @@
2
2
  title: "Auto-Healing in TestDriver.ai"
3
3
  sidebarTitle: "Auto-Healing"
4
4
  description: "Learn how TestDriver.ai's auto-healing feature keeps your tests resilient and up-to-date with minimal manual effort."
5
+ icon: "bandage"
5
6
  ---
6
7
 
7
- Auto-healing is a powerful feature in TestDriver.ai that ensures your tests remain resilient even when the application under test changes. When text, UI elements, or other visual cues are modified, TestDriver.ai can detect the failure, adapt to the changes, and automatically update the test. It then opens a pull request (PR) with the updated test, ensuring your test suite stays up-to-date with minimal manual intervention.
8
+ Auto-healing is a powerful feature in TestDriver.ai that ensures your tests remain resilient even when the application under test changes.
8
9
 
9
- ---
10
-
11
- ## How Auto-Healing Works
12
-
13
- 1. **Test Execution**: TestDriver.ai runs your test suite as usual.
14
- 2. **Failure Detection**: If a test fails due to a change in the application (e.g., text or UI updates), the AI identifies the failure point.
15
- 3. **Recovery Attempt**: The AI uses its adaptive capabilities to locate the updated element or text and retries the action.
16
- 4. **Test Update**: If the recovery is successful, TestDriver.ai updates the test script with the new element or text.
17
- 5. **Pull Request Creation**: The updated test script is committed to a new branch, and a pull request is automatically opened in your repository for review.
10
+ When TestDriver steps fail, the AI will progressively fall back to attemp to complete the test.
18
11
 
19
- ---
12
+ If running on CI, TestDriver will open a pull request (PR) with the updated test, ensuring your test suite stays up-to-date with minimal manual intervention.
20
13
 
21
14
  ## Benefits of Auto-Healing
22
15
 
@@ -25,15 +18,19 @@ Auto-healing is a powerful feature in TestDriver.ai that ensures your tests rema
25
18
  - **Continuous Integration**: Keeps your test suite aligned with the latest application changes.
26
19
  - **Developer Collaboration**: Automatically opens a PR, allowing developers to review and approve updates.
27
20
 
28
- ---
21
+ ## How Auto-Healing Works
29
22
 
30
- ## Example Workflow
23
+ 1. **Test Execution**: TestDriver.ai runs your test suite as usual.
24
+ 2. **Failure Detection**: If a test fails due to a change in the application (e.g., text or UI updates), the AI identifies the failure point.
25
+ 3. **Recovery Attempt**: The AI uses its adaptive capabilities to locate the updated element or text and retries the action.
26
+ 4. **Test Update**: If the recovery is successful, TestDriver.ai updates the test script with the new element or text.
27
+ 5. **Pull Request Creation**: The updated test script is committed to a new branch, and a pull request is automatically opened in your repository for review.
31
28
 
32
- ### Scenario: Button Text Changes from "Submit" to "Send"
29
+ ### Example: Button Text Changes from "Submit" to "Send"
33
30
 
34
31
  1. **Initial Test**:
35
32
 
36
- ```yaml
33
+ ```yaml {2}
37
34
  - command: hover-text
38
35
  text: Submit
39
36
  description: Submit button in the form
@@ -53,7 +50,7 @@ Auto-healing is a powerful feature in TestDriver.ai that ensures your tests rema
53
50
  5. **Test Update**:
54
51
  - The test script is updated to reflect the new button text:
55
52
 
56
- ```yaml
53
+ ```yaml {2}
57
54
  - command: hover-text
58
55
  text: Send
59
56
  description: Submit button in the form
@@ -65,13 +62,11 @@ Auto-healing is a powerful feature in TestDriver.ai that ensures your tests rema
65
62
  - **Branch Name**: `auto-heal-update-submit-to-send`
66
63
  - **PR Title**: `Auto-Healed Test: Updated "Submit" to "Send"`
67
64
 
68
- ---
69
-
70
65
  ## Example GitHub Action for Auto-Healing
71
66
 
72
67
  Here’s how you can configure a GitHub Action to enable auto-healing and PR creation:
73
68
 
74
- ```yaml
69
+ ```yaml {24-30}
75
70
  name: TestDriver.ai Auto-Healing
76
71
 
77
72
  on:
@@ -103,22 +98,8 @@ jobs:
103
98
 
104
99
  ---
105
100
 
106
- ## Best Practices for Auto-Healing
107
-
108
- 1. **Enable PR Reviews**: Always review auto-healed PRs to ensure the updates align with the intended application behavior.
109
- 2. **Use Descriptive Descriptions**: Provide clear descriptions for elements in your tests to help the AI identify changes more effectively.
110
- 3. **Run Tests Frequently**: Integrate TestDriver.ai into your CI/CD pipeline to catch and heal changes as soon as they occur.
111
- 4. **Monitor Auto-Healing Logs**: Review logs and screenshots provided by TestDriver.ai to understand why a test was updated.
112
-
113
- ---
114
-
115
101
  ## Limitations of Auto-Healing
116
102
 
117
103
  - **Major UI Overhauls**: Auto-healing is best suited for minor changes (e.g., text updates, small layout adjustments). Significant UI changes may still require manual intervention.
118
104
  - **Ambiguous Changes**: If multiple elements match the updated criteria, the AI may require additional context to make the correct decision.
119
-
120
- ---
121
-
122
- ## Conclusion
123
-
124
- Auto-healing in TestDriver.ai reduces the burden of test maintenance by automatically adapting to changes in your application. By leveraging this feature, you can ensure your test suite remains robust and up-to-date, allowing your team to focus on delivering high-quality software.
105
+ - **Step Deletion**: If UI or wizard pages are removed, the AI may not be able to recover. In such cases, manual updates are necessary.