testdriverai 5.5.5 → 5.5.7

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 (129) hide show
  1. package/agent.js +29 -39
  2. package/docs/account/dashboard.mdx +16 -0
  3. package/docs/account/enterprise.mdx +97 -0
  4. package/docs/account/pricing.mdx +26 -0
  5. package/docs/account/projects.mdx +27 -0
  6. package/docs/account/team.mdx +31 -0
  7. package/docs/action/browser.mdx +1 -1
  8. package/docs/action/os.mdx +1 -2
  9. package/docs/action/output.mdx +2 -2
  10. package/docs/action/performance.mdx +4 -0
  11. package/docs/action/prerun.mdx +57 -1
  12. package/docs/action/secrets.mdx +3 -3
  13. package/docs/action/setup.mdx +6 -6
  14. package/docs/apps/chrome-extensions.mdx +41 -0
  15. package/docs/apps/desktop-apps.mdx +87 -0
  16. package/docs/apps/mobile-apps.mdx +22 -0
  17. package/docs/apps/static-websites.mdx +54 -0
  18. package/docs/bugs/jira.mdx +35 -28
  19. package/docs/cli/overview.mdx +19 -13
  20. package/docs/commands/assert.mdx +2 -0
  21. package/docs/commands/exec.mdx +96 -0
  22. package/docs/commands/focus-application.mdx +2 -0
  23. package/docs/commands/hover-image.mdx +2 -0
  24. package/docs/commands/hover-text.mdx +2 -0
  25. package/docs/commands/if.mdx +3 -2
  26. package/docs/commands/issues.mdx +27 -0
  27. package/docs/commands/match-image.mdx +2 -0
  28. package/docs/commands/press-keys.mdx +9 -5
  29. package/docs/commands/run.mdx +2 -1
  30. package/docs/commands/scroll-until-image.mdx +3 -1
  31. package/docs/commands/scroll-until-text.mdx +2 -0
  32. package/docs/commands/scroll.mdx +3 -1
  33. package/docs/commands/type.mdx +3 -1
  34. package/docs/commands/wait-for-image.mdx +3 -1
  35. package/docs/commands/wait-for-text.mdx +3 -1
  36. package/docs/commands/wait.mdx +3 -1
  37. package/docs/docs.json +260 -146
  38. package/docs/exporting/playwright.mdx +33 -26
  39. package/docs/features/auto-healing.mdx +25 -20
  40. package/docs/features/cross-platform.mdx +9 -8
  41. package/docs/features/generation.mdx +4 -3
  42. package/docs/features/github.mdx +22 -18
  43. package/docs/features/parallel-testing.mdx +15 -11
  44. package/docs/features/reusable-snippets.mdx +18 -14
  45. package/docs/features/selectorless.mdx +8 -3
  46. package/docs/features/visual-assertions.mdx +9 -10
  47. package/docs/getting-started/ci.mdx +7 -8
  48. package/docs/getting-started/editing.mdx +2 -0
  49. package/docs/getting-started/generating.mdx +1 -1
  50. package/docs/getting-started/running.mdx +2 -2
  51. package/docs/getting-started/setup.mdx +5 -12
  52. package/docs/getting-started/vscode.mdx +67 -79
  53. package/docs/getting-started/writing.mdx +7 -5
  54. package/docs/guide/assertions.mdx +6 -6
  55. package/docs/guide/authentication.mdx +18 -14
  56. package/docs/guide/code.mdx +3 -3
  57. package/docs/guide/environment-variables.mdx +64 -0
  58. package/docs/guide/lifecycle.mdx +154 -0
  59. package/docs/guide/locating.mdx +9 -9
  60. package/docs/guide/variables.mdx +9 -6
  61. package/docs/guide/waiting.mdx +9 -8
  62. package/docs/images/content/account/newprojectsettings.png +0 -0
  63. package/docs/images/content/account/projectpage.png +0 -0
  64. package/docs/images/content/account/projectreplays.png +0 -0
  65. package/docs/images/content/account/team-manage.png +0 -0
  66. package/docs/images/content/account/teampage.png +0 -0
  67. package/docs/images/content/side-by-side.png +0 -0
  68. package/docs/images/content/vscode/vscode-agent-preview.png +0 -0
  69. package/docs/images/content/vscode/vscode-copilot-ask.png +0 -0
  70. package/docs/images/content/vscode/vscode-file-creation.png +0 -0
  71. package/docs/images/content/vscode/vscode-install.png +0 -0
  72. package/docs/images/content/vscode/vscode-overview.png +0 -0
  73. package/docs/images/content/vscode/vscode-setup-walkthrough.png +0 -0
  74. package/docs/images/content/vscode/vscode-stopchat.png +0 -0
  75. package/docs/images/content/vscode/vscode-stoptest.png +0 -0
  76. package/docs/images/content/vscode/vscode-tdservice.png +0 -0
  77. package/docs/images/content/vscode/vscode-test-output.png +0 -0
  78. package/docs/images/content/vscode/vscode-testhistory.png +0 -0
  79. package/docs/images/content/vscode/vscode-testpane-runtests.png +0 -0
  80. package/docs/images/content/vscode/vscode-testpane.png +0 -0
  81. package/docs/importing/csv.mdx +9 -6
  82. package/docs/importing/gherkin.mdx +12 -10
  83. package/docs/importing/jira.mdx +11 -9
  84. package/docs/importing/testrail.mdx +10 -8
  85. package/docs/integrations/electron.mdx +26 -19
  86. package/docs/integrations/netlify.mdx +25 -24
  87. package/docs/integrations/vercel.mdx +22 -20
  88. package/docs/interactive/assert.mdx +4 -1
  89. package/docs/interactive/dry.mdx +51 -0
  90. package/docs/interactive/explore.mdx +92 -0
  91. package/docs/interactive/generate.mdx +6 -3
  92. package/docs/interactive/run.mdx +3 -0
  93. package/docs/interactive/save.mdx +3 -0
  94. package/docs/interactive/undo.mdx +3 -0
  95. package/docs/overview/comparison.mdx +6 -2
  96. package/docs/overview/faq.mdx +2 -1
  97. package/docs/overview/quickstart.mdx +123 -65
  98. package/docs/overview/upgrading.mdx +82 -0
  99. package/docs/overview/what-is-testdriver.mdx +13 -5
  100. package/docs/quickstart.mdx +1 -1
  101. package/docs/scenarios/ai-chatbot.mdx +26 -0
  102. package/docs/scenarios/cookie-banner.mdx +30 -0
  103. package/docs/scenarios/file-upload.mdx +30 -0
  104. package/docs/scenarios/form-filling.mdx +28 -0
  105. package/docs/scenarios/log-in.mdx +68 -0
  106. package/docs/scenarios/pdf-generation.mdx +21 -0
  107. package/docs/scenarios/spell-check.mdx +21 -0
  108. package/docs/security/action.mdx +7 -3
  109. package/docs/security/agent.mdx +1 -1
  110. package/docs/security/platform.mdx +9 -1
  111. package/docs/snippets/calendar-link.mdx +1 -0
  112. package/docs/snippets/gitignore-warning.mdx +4 -0
  113. package/docs/snippets/test-prereqs.mdx +15 -0
  114. package/docs/tutorials/advanced-test.mdx +2 -0
  115. package/docs/tutorials/basic-test.mdx +8 -7
  116. package/lib/commands.js +40 -21
  117. package/lib/config.js +0 -1
  118. package/lib/init.js +1 -1
  119. package/lib/logger.js +2 -2
  120. package/lib/parser.js +1 -0
  121. package/lib/sdk.js +14 -13
  122. package/package.json +2 -1
  123. package/schema.json +1 -4
  124. package/styles/config/vocabularies/Docs/accept.txt +15 -2
  125. package/styles/config/vocabularies/Docs/reject.txt +4 -0
  126. package/docs/30x30.mdx +0 -84
  127. package/docs/issues.mdx +0 -9
  128. package/docs/security/dashboard.mdx +0 -0
  129. package/testdriver/chrome.yaml +0 -102
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: "Mobile Apps"
3
+ sidebarTitle: "Mobile Apps"
4
+ description: "Test mobile apps with TestDriver"
5
+ icon: "mobile"
6
+ ---
7
+ # Testing Mobile Apps with TestDriver
8
+
9
+ ## How Do I Test Mobile Apps?
10
+ TestDriver provides a powerful solution for testing mobile apps. With our platform, you can easily create and run tests to ensure your mobile app functions as expected across different devices and operating systems.
11
+
12
+
13
+
14
+ <Tip>You will need to install a mobile emulator for your deployed tests or use a device farm to test your mobile app.</Tip>
15
+
16
+ ##
17
+ To get started with testing mobile apps using TestDriver, follow these steps:
18
+ 1. **Follow our [quick start guide](/overview/quickstart) to set up your TestDriver account.**
19
+ 2. **Create a new test project** in your TestDriver dashboard.
20
+ 3. **Add your mobile emulator to the test settings.**
21
+ 4. **Add your mobile app URL** to the test settings.
22
+
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: "Testing Static Websites with TestDriver"
3
+ sidebarTitle: "Static Websites"
4
+ description: "Test static websites with TestDriver"
5
+ icon: "browser"
6
+ ---
7
+ TestDriver provides a powerful solution for testing static websites. With our platform, you can easily create and run tests to ensure your static website functions as expected across different browsers and devices.
8
+
9
+ ## TestDriver in Action
10
+ <iframe
11
+ width="560"
12
+ height="315"
13
+ src="https://www.youtube.com/embed/CqdRN_5_3I0"
14
+ title="Form Filling with TestDriver"
15
+ frameborder="0"
16
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
17
+ allowfullscreen
18
+ ></iframe>
19
+
20
+ ## Getting Started
21
+ To get started with testing static websites using TestDriver, follow these steps:
22
+ 1. **Follow our [quick start guide](/getting-started/setup) to set up your TestDriver account.**
23
+ 2. **Create a new test project** in your TestDriver dashboard.
24
+ 3. **Add your static website URL** to the test settings.
25
+ It looks like this in the `prerun.yaml` file:
26
+
27
+ ```yaml
28
+ version: 5.1.1
29
+ session: 67f00511acbd9ccac373edf7
30
+ steps:
31
+ - prompt: launch chrome
32
+ commands:
33
+ - command: exec
34
+ lang: shell
35
+ linux: |
36
+ jumpapp google-chrome --disable-fre --no-default-browser-check --no-first-run "${TD_WEBSITE}" &
37
+ exit
38
+ mac: |
39
+ open -na "Google Chrome" --args --disable-fre --no-default-browser-check --no-first-run --disable-features=PasswordManagerEnabled "${TD_WEBSITE}" &
40
+ exit
41
+ windows:
42
+ Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "${TD_WEBSITE}"
43
+ exit
44
+ - command: wait-for-text
45
+ text: "Google Chrome"
46
+ timeout: 30000
47
+ ```
48
+ Set the `TD_WEBSITE` environment variable to the URL of your static website. This will allow TestDriver to launch the browser and navigate to your website. You can do this by adding this `prerun.yaml` file to your project or by simply using:
49
+ ```bash
50
+ testdriverai init
51
+ ```
52
+ Running init will create the `prerun.yaml` file for you and ask you which website to load with your test.
53
+
54
+
@@ -1,26 +1,28 @@
1
1
  ---
2
2
  title: "Reporting Failed Tests to Jira"
3
3
  sidebarTitle: "Jira"
4
- description: "Step-by-step instructions to integrate TestDriver.ai with Jira for automated test failure tracking in CI/CD workflows."
4
+ description: "Step-by-step instructions to integrate TestDriver with Jira for automated test failure tracking in CI/CD workflows."
5
+ icon: "jira"
5
6
  ---
6
7
 
7
- # Automating Jira Ticket Creation for Test Failures Using TestDriver.ai and Jira GitHub Actions
8
+ # Automating Jira Ticket Creation for Test Failures Using TestDriver and Jira GitHub Actions
8
9
 
9
- This guide explains how to integrate the **TestDriver.ai GitHub Action** with the **Jira GitHub Action** to automatically create a Jira ticket whenever a TestDriver.ai test fails. This workflow ensures that test failures are tracked in Jira, enabling teams to address issues promptly.
10
+ This guide explains how to integrate the **TestDriver GitHub Action** with the **Jira GitHub Action** to automatically create a Jira ticket whenever a TestDriver test fails. This workflow ensures that test failures are tracked in Jira, enabling teams to address issues promptly.
10
11
 
11
12
  ---
12
13
 
13
14
  ## Workflow Overview
14
15
 
15
- 1. **Run Tests with TestDriver.ai**: Use the TestDriver.ai GitHub Action to execute your test suite.
16
- 2. **Check for Test Failures**: Capture the test results and determine if any tests failed.
17
- 3. **Create a Jira Ticket**: Use the Jira GitHub Action to create a new ticket for each test failure, including relevant details such as the test name, failure reason, and logs.
18
-
16
+ <Steps>
17
+ <Step title="Run Tests with TestDriver">Use the TestDriver GitHub Action to execute your test suite.</Step>
18
+ <Step title="Check for Test Failures">Capture the test results and determine if any tests failed.</Step>
19
+ <Step title="Create a Jira Ticket">Use the Jira GitHub Action to create a new ticket for each test failure, including relevant details such as the test name, failure reason, and logs.</Step>
20
+ </Steps>
19
21
  ---
20
22
 
21
23
  ## Prerequisites
22
24
 
23
- 1. **TestDriver.ai API Key**: Store your API key as a GitHub secret (e.g., `TESTDRIVER_API_KEY`).
25
+ 1. **TestDriver API Key**: Store your API key as a GitHub secret (e.g., `TD_API_KEY`).
24
26
  2. **Jira API Token**: Generate an API token from your Jira account and store it as a GitHub secret (e.g., `JIRA_API_TOKEN`).
25
27
  3. **Jira Base URL**: Your Jira instance URL (e.g., `https://yourcompany.atlassian.net`).
26
28
  4. **Jira Project Key**: The key of the Jira project where tickets will be created (e.g., `TEST`).
@@ -29,10 +31,11 @@ This guide explains how to integrate the **TestDriver.ai GitHub Action** with th
29
31
 
30
32
  ## GitHub Actions Workflow
31
33
 
32
- Heres a complete workflow that integrates TestDriver.ai and Jira:
34
+ Here's a complete workflow that integrates TestDriver and Jira:
33
35
 
34
- ### Workflow File: `.github/workflows/testdriver-jira.yml````yaml
35
- name: TestDriver.ai with Jira Integration
36
+ ### Workflow File: `.github/workflows/testdriver-jira.yml`
37
+ ```yaml
38
+ name: TestDriver with Jira Integration
36
39
 
37
40
  on:
38
41
  push:
@@ -43,17 +46,17 @@ on:
43
46
 
44
47
  jobs:
45
48
  run-tests:
46
- name: Run Tests with TestDriver.ai
49
+ name: Run Tests with TestDriver
47
50
  runs-on: ubuntu-latest
48
51
  steps:
49
52
  - name: Check out repository
50
53
  uses: actions/checkout@v2
51
54
 
52
- - name: Run TestDriver.ai
55
+ - name: Run TestDriver
53
56
  id: testdriver
54
57
  uses: testdriverai/action@main
55
58
  with:
56
- key: ${{ secrets.TESTDRIVER_API_KEY }}
59
+ key: ${{ secrets.TD_API_KEY }}
57
60
  prompt: |
58
61
  1. Run all tests in the testdriver directory
59
62
  env:
@@ -64,7 +67,7 @@ jobs:
64
67
  id: check-failures
65
68
  run: |
66
69
  if [[ "${{ steps.testdriver.outputs.success }}" == "false" ]]; then
67
- echo "TestDriver.ai tests failed."
70
+ echo "TestDriver tests failed."
68
71
  echo "failure=true" >> $GITHUB_ENV
69
72
  else
70
73
  echo "All tests passed."
@@ -86,7 +89,7 @@ jobs:
86
89
  project: TEST # Replace with your Jira project key
87
90
  summary: "Test Failure: ${{ steps.testdriver.outputs.summary }}"
88
91
  description: |
89
- A test failure occurred during the TestDriver.ai workflow.
92
+ A test failure occurred during the TestDriver workflow.
90
93
 
91
94
  **Test Summary**:
92
95
  ${{ steps.testdriver.outputs.summary }}
@@ -103,13 +106,14 @@ jobs:
103
106
 
104
107
  ## Workflow Steps Explained
105
108
 
106
- ### 1. **Run Tests with TestDriver.ai**
107
- The `testdriverai/action@main` step runs your TestDriver.ai tests and captures the results. The `outputs.success` variable indicates whether the tests passed or failed.```yaml
108
- - name: Run TestDriver.ai
109
+ ### 1. **Run Tests with TestDriver**
110
+ The `testdriverai/action@main` step runs your TestDriver tests and captures the results. The `outputs.success` variable indicates whether the tests passed or failed.
111
+ ```yaml
112
+ - name: Run TestDriver
109
113
  id: testdriver
110
114
  uses: testdriverai/action@main
111
115
  with:
112
- key: ${{ secrets.TESTDRIVER_API_KEY }}
116
+ key: ${{ secrets.TD_API_KEY }}
113
117
  prompt: |
114
118
  1. Run all tests in the testdriver directory
115
119
  env:
@@ -121,12 +125,13 @@ The `testdriverai/action@main` step runs your TestDriver.ai tests and captures t
121
125
  ---
122
126
 
123
127
  ### 2. **Check for Test Failures**
124
- This step checks the `outputs.success` variable from the TestDriver.ai action. If the tests failed, it sets an environment variable (`failure=true`) to trigger the Jira ticket creation step.```yaml
128
+ This step checks the `outputs.success` variable from the TestDriver action. If the tests failed, it sets an environment variable (`failure=true`) to trigger the Jira ticket creation step.
129
+ ```yaml
125
130
  - name: Check for Test Failures
126
131
  id: check-failures
127
132
  run: |
128
133
  if [[ "${{ steps.testdriver.outputs.success }}" == "false" ]]; then
129
- echo "TestDriver.ai tests failed."
134
+ echo "TestDriver tests failed."
130
135
  echo "failure=true" >> $GITHUB_ENV
131
136
  else
132
137
  echo "All tests passed."
@@ -140,7 +145,8 @@ This step checks the `outputs.success` variable from the TestDriver.ai action. I
140
145
  ### 3. **Create a Jira Ticket**
141
146
  If any tests failed, the `create-jira-ticket` job uses the `atlassian/gajira-create` action to create a new Jira ticket. The ticket includes:
142
147
  - **Summary**: A brief description of the failure.
143
- - **Description**: Detailed information about the failure, including the test summary and markdown output from TestDriver.ai.```yaml
148
+ - **Description**: Detailed information about the failure, including the test summary and markdown output from TestDriver.
149
+ ```yaml
144
150
  - name: Create Jira Ticket
145
151
  uses: atlassian/gajira-create@v3
146
152
  with:
@@ -150,7 +156,7 @@ If any tests failed, the `create-jira-ticket` job uses the `atlassian/gajira-cre
150
156
  project: TEST # Replace with your Jira project key
151
157
  summary: "Test Failure: ${{ steps.testdriver.outputs.summary }}"
152
158
  description: |
153
- A test failure occurred during the TestDriver.ai workflow.
159
+ A test failure occurred during the TestDriver workflow.
154
160
 
155
161
  **Test Summary**:
156
162
  ${{ steps.testdriver.outputs.summary }}
@@ -168,7 +174,7 @@ If any tests failed, the `create-jira-ticket` job uses the `atlassian/gajira-cre
168
174
  ## Secrets Configuration
169
175
 
170
176
  Add the following secrets to your GitHub repository:
171
- 1. **`TESTDRIVER_API_KEY`**: Your TestDriver.ai API key.
177
+ 1. **`TD_API_KEY`**: Your TestDriver API key.
172
178
  2. **`JIRA_API_TOKEN`**: Your Jira API token.
173
179
  3. **`JIRA_BASE_URL`**: Your Jira instance URL (e.g., `https://yourcompany.atlassian.net`).
174
180
  4. **`JIRA_USERNAME`**: Your Jira account email.
@@ -184,7 +190,7 @@ Add the following secrets to your GitHub repository:
184
190
 
185
191
 
186
192
  ```
187
- A test failure occurred during the TestDriver.ai workflow.
193
+ A test failure occurred during the TestDriver workflow.
188
194
 
189
195
  **Test Summary**:
190
196
  Login Test Failed
@@ -195,7 +201,8 @@ Login Test Failed
195
201
 
196
202
  Please investigate the issue and resolve it promptly.
197
203
 
198
- ```---
204
+ ```
205
+ ---
199
206
 
200
207
  ## Benefits of This Workflow
201
208
 
@@ -205,4 +212,4 @@ Please investigate the issue and resolve it promptly.
205
212
 
206
213
  ---
207
214
 
208
- By combining TestDriver.ai and Jira GitHub Actions, you can automate the process of tracking test failures, improving collaboration and ensuring faster resolution of issues.
215
+ By combining TestDriver and Jira GitHub Actions, you can automate the process of tracking test failures, improving collaboration and ensuring faster resolution of issues.
@@ -1,8 +1,11 @@
1
- ```mdx
2
- # Command: `testdriverai`
1
+ ---
2
+ title: Overview of the TestDriver CLI
3
+ sidebarTitle: "CLI Overview"
4
+ description: "Learn about the TestDriver CLI, its commands, and how to use it effectively."
5
+ icon: "terminal"
6
+ ---
3
7
 
4
- ## Description
5
- The `testdriverai` CLI is the primary interface for running, managing, and debugging TestDriver.ai scripts. It provides commands to execute tests, validate configurations, and interact with the TestDriver.ai framework.
8
+ The `testdriverai` CLI is the primary interface for running, managing, and debugging TestDriver scripts. It provides commands to execute tests, validate configurations, and interact with the TestDriver framework.
6
9
 
7
10
  ## Usage
8
11
  ```bash
@@ -12,10 +15,10 @@ testdriverai <command> [options]
12
15
  ## Available Commands
13
16
  | Command | Description |
14
17
  |---------------|-----------------------------------------------------------------------------|
15
- | `run` | Executes a TestDriver.ai script. |
16
- | `validate` | Validates the syntax and structure of a TestDriver.ai script. |
17
- | `init` | Initializes a new TestDriver.ai project in the current directory. |
18
- | `version` | Displays the current version of the TestDriver.ai CLI. |
18
+ | `run` | Executes a TestDriver script. |
19
+ | `validate` | Validates the syntax and structure of a TestDriver script. |
20
+ | `init` | Initializes a new TestDriver project in the current directory. |
21
+ | `version` | Displays the current version of the TestDriver CLI. |
19
22
  | `help` | Displays help information for the CLI or a specific command. |
20
23
 
21
24
  ## Example Usage
@@ -24,7 +27,7 @@ testdriverai <command> [options]
24
27
  ```bash
25
28
  testdriverai run path/to/testdriver.yaml
26
29
  ```
27
- This command runs the specified TestDriver.ai script, executing all steps defined in the file.
30
+ This command runs the specified TestDriver script, executing all steps defined in the file.
28
31
 
29
32
  ### Validating a Script
30
33
  ```bash
@@ -36,13 +39,13 @@ This command checks the syntax and structure of the script to ensure it is valid
36
39
  ```bash
37
40
  testdriverai init
38
41
  ```
39
- This command sets up a new TestDriver.ai project in the current directory, creating the necessary folder structure and configuration files.
42
+ This command sets up a new TestDriver project in the current directory, creating the necessary folder structure and configuration files.
40
43
 
41
44
  ### Checking the Version
42
45
  ```bash
43
46
  testdriverai version
44
47
  ```
45
- This command displays the installed version of the TestDriver.ai CLI.
48
+ This command displays the installed version of the TestDriver CLI.
46
49
 
47
50
  ### Getting Help
48
51
  ```bash
@@ -58,8 +61,11 @@ testdriverai help <command>
58
61
  - Combine `testdriverai run` with CI/CD pipelines to automate test execution.
59
62
  - Use the `--debug` flag with `run` to enable detailed logging for troubleshooting.
60
63
 
64
+ <Info>
65
+ Running `testdriverai init` will create a blank `testdriver.yaml` file in the current directory. You can then edit this file to define your test steps.
66
+ </Info>
67
+
61
68
  ## Notes
62
69
  - The `testdriverai` CLI is cross-platform and works on macOS, Windows, and Linux.
63
70
  - Ensure you have the required dependencies installed and configured before running scripts.
64
- - For more advanced usage, refer to the official TestDriver.ai documentation.
65
- ```
71
+ - For more advanced usage, refer to the official TestDriver documentation.
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "assert"
3
+ sidebarTitle: "assert"
4
+ description: "Validate conditions during a test using the assert command."
3
5
  icon: "check"
4
6
  ---
5
7
 
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "exec"
3
+ sidebarTitle: "exec"
4
+ description: "Execute custom shell or NodeJS scripts within your tests."
3
5
  icon: "code"
4
6
  ---
5
7
 
@@ -52,3 +54,97 @@ steps:
52
54
 
53
55
  - Overwrite the `result` variable in your script, as it is used to store the output.
54
56
  - NodeJS code executes in the same context as the calling process on the host machine, using the [VM](https://nodejs.org/api/vm.html) module internally.
57
+
58
+
59
+ ```yaml
60
+ version: 5.3.8
61
+ steps:
62
+ - commands:
63
+ - command: exec
64
+ lang: shell
65
+ silent: false
66
+ mac: |
67
+ npm install @sendgrid/mail
68
+ - command: exec
69
+ lang: js
70
+ output: accountData
71
+ silent: false
72
+ mac: |
73
+ const Mailjs = require("@cemalgnlts/mailjs");
74
+ const mailjs = new Mailjs();
75
+ let account = await mailjs.createOneAccount()
76
+ console.log("Account created:", account);
77
+ result = JSON.stringify(account.data)
78
+ - command: exec
79
+ lang: js
80
+ output: emailAddress
81
+ silent: false
82
+ mac: |
83
+ const accountData = ${OUTPUT.accountData};
84
+ result = accountData.username
85
+ - prompt: Enter the generated email into the email field
86
+ commands:
87
+ - command: hover-text
88
+ text: standard_user
89
+ description: email input field label
90
+ action: click
91
+ - command: type
92
+ text: ${OUTPUT.emailAddress}
93
+ - prompt: Wait for an email, extract links, and open each link
94
+ commands:
95
+ - command: exec
96
+ lang: js
97
+ silent: false
98
+ mac: |
99
+ const Mailjs = require("@cemalgnlts/mailjs");
100
+ const { JSDOM } = require('jsdom'); // To parse HTML and extract links
101
+
102
+ const accountData = ${OUTPUT.accountData};
103
+
104
+ const getLatestEmailAndClickLinks = async () => {
105
+ try {
106
+ // Initialize the Mailjs client
107
+ const mailjs = new Mailjs();
108
+
109
+ // Login to your account
110
+ await mailjs.login(accountData.username, accountData.password);
111
+
112
+ // Fetch list of messages
113
+ const messages = await mailjs.getMessages();
114
+
115
+ if (messages.length === 0) {
116
+ console.log('No emails found.');
117
+ return;
118
+ }
119
+
120
+ // Assuming the latest email is the first one in the list
121
+ const latestMessage = messages[0];
122
+
123
+ // Fetch the full details of the latest email
124
+ const fullMessage = await mailjs.getMessage(latestMessage.id);
125
+
126
+ console.log('Latest Email Details:', fullMessage);
127
+
128
+ // Parse the HTML content to extract links
129
+ const dom = new JSDOM(fullMessage.html);
130
+ const links = Array.from(dom.window.document.querySelectorAll('a')).map(a => a.href);
131
+
132
+ console.log('Found Links:', links);
133
+
134
+ // Click (fetch) every link using native fetch
135
+ for (const link of links) {
136
+ try {
137
+ const response = await fetch(link);
138
+ console.log('Clicked ${link}: ${response.status}');
139
+ } catch (linkError) {
140
+ console.error('Error clicking ${link}:', linkError);
141
+ }
142
+ }
143
+
144
+ } catch (error) {
145
+ console.error('Error fetching latest email or clicking links:', error);
146
+ }
147
+ };
148
+
149
+ getLatestEmailAndClickLinks();
150
+ ```
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "focus-application"
3
+ sidebarTitle: "focus-application"
4
+ description: "Bring a specific application window to the foreground."
3
5
  icon: "window-restore"
4
6
  ---
5
7
 
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "hover-image"
3
+ sidebarTitle: "hover-image"
4
+ description: "Locate an image on the screen and perform an action."
3
5
  icon: "image"
4
6
  ---
5
7
 
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "hover-text"
3
+ sidebarTitle: "hover-text"
4
+ description: "Locate text on the screen and perform an action."
3
5
  icon: "text"
4
6
  ---
5
7
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "if"
3
- icon: "code-branch"
3
+ sidebarTitle: "if"
4
+ description: "Conditionally execute commands based on a specified condition."
5
+ icon: "split"
4
6
  ---
5
7
 
6
8
  ## Description
@@ -41,5 +43,4 @@ else:
41
43
  ## Notes
42
44
  - The `if` command is useful for creating conditional logic in your tests, allowing for more dynamic and flexible workflows.
43
45
  - Both the `then` and `else` blocks are optional, but at least one must be provided.
44
- ```
45
46
 
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: "Known Issues"
3
+ sidebarTitle: "Known Issues"
4
+ description: "Known issues and limitations of TestDriver."
5
+ icon: "bug"
6
+ ---
7
+
8
+ ## Reporting Issues
9
+ If you encounter any issues while using TestDriver, please report them to us. You can do this by creating a new issue in our [GitHub repository](https://github.com/testdriverai/testdriverai/issues/new). We appreciate your feedback and will work to resolve any problems as quickly as possible.
10
+
11
+
12
+ ## Known Issues
13
+
14
+ ### Image Description Matches
15
+ TestDriver may not accurately match image descriptions in certain cases. This can lead to unexpected behavior when using the `hover-image` command. For example, if you specify a description that is 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.
16
+
17
+ ### Text Substrings
18
+ TestDriver may not accurately match text substrings in certain cases. This can lead to unexpected behavior when using the `hover-text` command.
19
+
20
+ ### Scrolling
21
+ TestDriver may not scroll the browser window to the correct position when using the `scroll` command. This can result in elements being out of view or not clickable. To work around this, you can use the `scroll` command with a specific `amount` or `direction` to ensure the element is in view before interacting with it.
22
+
23
+ ```yaml
24
+ - command: scroll
25
+ direction: down
26
+ amount: 500
27
+ ```
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "match-image"
3
+ sidebarTitle: "match-image"
4
+ description: "Locate an image on the screen and perform an action."
3
5
  icon: "images"
4
6
  ---
5
7
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "press-keys"
3
- icon: "keyboard-brightness"
3
+ sidebarTitle: "press-keys"
4
+ description: "Simulate typing a keyboard combination."
5
+ icon: "keyboard"
4
6
  ---
5
7
 
6
8
  ## Description
@@ -9,12 +11,14 @@ The `press-keys` command is used to simulate typing a keyboard combination. This
9
11
  ## Arguments
10
12
  | Argument | Type | Description |
11
13
  |----------|---------------------|-----------------------------------------------------------------------------|
12
- | `keys` | `yml array of strings` | A list of keys to press together. Keys are automatically remapped for different operating systems. |
14
+ | `keys` | yml array of strings | A list of keys to press together. Keys are automatically remapped for different operating systems. |
13
15
 
14
16
  ## Example Usage
15
17
  ```yaml
16
18
  command: press-keys
17
- keys: [command, space]
19
+ keys:
20
+ - command
21
+ - space
18
22
  ```
19
23
 
20
24
  ## Protips
@@ -27,5 +31,5 @@ keys: [command, space]
27
31
 
28
32
  ## Notes
29
33
  - The `press-keys` command is ideal for automating workflows that rely on keyboard shortcuts.
30
- - This command supports cross-platform key remapping to ensure compatibility across macOS, Windows, and Linux.
31
- ```
34
+
35
+ <Check>This command supports cross-platform key remapping to ensure compatibility across macOS, Windows, and Linux.</Check>
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "run"
3
+ sidebarTitle: "run"
4
+ description: "Embed and execute another file within the current script."
3
5
  icon: "play"
4
6
  ---
5
7
 
@@ -28,4 +30,3 @@ file: path/to/another-script.yaml
28
30
  ## Notes
29
31
  - The `run` command is ideal for creating modular and maintainable test scripts by reusing common workflows.
30
32
  - This command supports nesting, allowing you to call scripts that themselves use the `run` command.
31
- ```
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "scroll-until-image"
3
- icon: "scroll"
3
+ sidebarTitle: "scroll-until-image"
4
+ description: "Scroll the screen until an image matching the description is found."
5
+ icon: "film-simple"
4
6
  ---
5
7
 
6
8
  ## Description
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  title: "scroll-until-text"
3
+ sidebarTitle: "scroll-until-text"
4
+ description: "Scroll the screen until the specified text is found."
3
5
  icon: "scroll"
4
6
  ---
5
7
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "scroll"
3
- icon: "scroll"
3
+ sidebarTitle: "scroll"
4
+ description: "Scroll the screen in a specified direction using the mouse wheel."
5
+ icon: "computer-mouse"
4
6
  ---
5
7
 
6
8
  # Command: `scroll`
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "type"
3
- icon: "keyboard"
3
+ sidebarTitle: "type"
4
+ description: "Simulate typing a string using keyboard emulation."
5
+ icon: "typewriter"
4
6
  ---
5
7
 
6
8
  ## Description
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "wait-for-image"
3
- icon: "hourglass"
3
+ sidebarTitle: "wait-for-image"
4
+ description: "Wait until an image matching the description is detected on the screen."
5
+ icon: "clock-three-thirty"
4
6
  ---
5
7
 
6
8
  ## Description
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "wait-for-text"
3
- icon: "hourglass"
3
+ sidebarTitle: "wait-for-text"
4
+ description: "Wait until the specified text is detected on the screen."
5
+ icon: "clock-nine"
4
6
  ---
5
7
 
6
8
  ## Description
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: "wait"
3
- icon: "hourglass"
3
+ sidebarTitle: "wait"
4
+ description: "Pause the execution of the script for a specified duration."
5
+ icon: "clock"
4
6
  ---
5
7
 
6
8
  ## Description