testdriverai 6.0.23 → 6.0.24-canary.fffd04a.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.
Files changed (107) hide show
  1. package/.github/workflows/acceptance-tests.yml +5 -1
  2. package/docs/action/ami.mdx +4 -3
  3. package/docs/action/performance.mdx +26 -8
  4. package/docs/action/secrets.mdx +11 -31
  5. package/docs/apps/chrome-extensions.mdx +1 -1
  6. package/docs/apps/desktop-apps.mdx +11 -8
  7. package/docs/apps/static-websites.mdx +7 -7
  8. package/docs/bugs/jira.mdx +12 -75
  9. package/docs/cli/overview.mdx +6 -6
  10. package/docs/commands/exec.mdx +32 -37
  11. package/docs/commands/focus-application.mdx +13 -2
  12. package/docs/commands/hover-image.mdx +29 -5
  13. package/docs/commands/hover-text.mdx +10 -16
  14. package/docs/commands/if.mdx +24 -21
  15. package/docs/commands/match-image.mdx +17 -9
  16. package/docs/commands/press-keys.mdx +55 -3
  17. package/docs/commands/remember.mdx +13 -9
  18. package/docs/commands/run.mdx +10 -4
  19. package/docs/commands/scroll-until-image.mdx +25 -11
  20. package/docs/commands/scroll-until-text.mdx +17 -10
  21. package/docs/commands/scroll.mdx +22 -8
  22. package/docs/commands/type.mdx +6 -6
  23. package/docs/commands/wait-for-image.mdx +20 -7
  24. package/docs/commands/wait-for-text.mdx +14 -12
  25. package/docs/commands/wait.mdx +8 -1
  26. package/docs/docs.json +4 -6
  27. package/docs/exporting/junit.mdx +3 -3
  28. package/docs/exporting/playwright.mdx +2 -2
  29. package/docs/features/auto-healing.mdx +3 -3
  30. package/docs/features/generation.mdx +2 -4
  31. package/docs/features/parallel-testing.mdx +3 -13
  32. package/docs/features/reusable-snippets.mdx +3 -3
  33. package/docs/features/selectorless.mdx +8 -2
  34. package/docs/features/visual-assertions.mdx +2 -2
  35. package/docs/getting-started/ci.mdx +42 -51
  36. package/docs/getting-started/cli.mdx +3 -9
  37. package/docs/getting-started/editing.mdx +13 -10
  38. package/docs/getting-started/running.mdx +7 -2
  39. package/docs/getting-started/vscode.mdx +4 -7
  40. package/docs/guide/assertions.mdx +2 -4
  41. package/docs/guide/authentication.mdx +8 -10
  42. package/docs/guide/code.mdx +14 -12
  43. package/docs/guide/environment-variables.mdx +13 -12
  44. package/docs/guide/lifecycle.mdx +39 -31
  45. package/docs/guide/variables.mdx +30 -20
  46. package/docs/guide/waiting.mdx +2 -2
  47. package/docs/importing/csv.mdx +3 -4
  48. package/docs/importing/jira.mdx +6 -12
  49. package/docs/importing/testrail.mdx +6 -6
  50. package/docs/integrations/electron.mdx +30 -56
  51. package/docs/integrations/netlify.mdx +9 -12
  52. package/docs/integrations/vercel.mdx +6 -42
  53. package/docs/interactive/explore.mdx +8 -10
  54. package/docs/interactive/run.mdx +9 -4
  55. package/docs/interactive/save.mdx +2 -2
  56. package/docs/overview/comparison.mdx +68 -60
  57. package/docs/overview/performance.mdx +0 -1
  58. package/docs/overview/what-is-testdriver.mdx +1 -1
  59. package/docs/scenarios/log-in.mdx +2 -2
  60. package/docs/security/platform.mdx +4 -2
  61. package/docs/snippets/test-prereqs.mdx +1 -1
  62. package/docs/snippets/tests/assert-replay.mdx +7 -5
  63. package/docs/snippets/tests/assert-yaml.mdx +2 -3
  64. package/docs/snippets/tests/exec-js-replay.mdx +7 -5
  65. package/docs/snippets/tests/exec-js-yaml.mdx +3 -4
  66. package/docs/snippets/tests/exec-shell-replay.mdx +7 -5
  67. package/docs/snippets/tests/exec-shell-yaml.mdx +4 -5
  68. package/docs/snippets/tests/hover-image-replay.mdx +7 -5
  69. package/docs/snippets/tests/hover-image-yaml.mdx +4 -6
  70. package/docs/snippets/tests/hover-text-replay.mdx +7 -5
  71. package/docs/snippets/tests/hover-text-with-description-replay.mdx +7 -5
  72. package/docs/snippets/tests/hover-text-with-description-yaml.mdx +4 -10
  73. package/docs/snippets/tests/hover-text-yaml.mdx +2 -3
  74. package/docs/snippets/tests/match-image-replay.mdx +7 -5
  75. package/docs/snippets/tests/match-image-yaml.mdx +6 -6
  76. package/docs/snippets/tests/press-keys-replay.mdx +7 -5
  77. package/docs/snippets/tests/press-keys-yaml.mdx +5 -6
  78. package/docs/snippets/tests/remember-replay.mdx +7 -5
  79. package/docs/snippets/tests/remember-yaml.mdx +25 -6
  80. package/docs/snippets/tests/scroll-replay.mdx +7 -5
  81. package/docs/snippets/tests/scroll-until-image-replay.mdx +7 -0
  82. package/docs/snippets/tests/scroll-until-image-yaml.mdx +14 -0
  83. package/docs/snippets/tests/scroll-until-text-replay.mdx +7 -5
  84. package/docs/snippets/tests/scroll-until-text-yaml.mdx +4 -8
  85. package/docs/snippets/tests/scroll-yaml.mdx +4 -13
  86. package/docs/snippets/tests/type-repeated-replay.mdx +7 -5
  87. package/docs/snippets/tests/type-repeated-yaml.mdx +2 -3
  88. package/docs/snippets/tests/type-replay.mdx +7 -5
  89. package/docs/snippets/tests/type-yaml.mdx +2 -5
  90. package/docs/snippets/tests/wait-for-image-replay.mdx +7 -0
  91. package/docs/snippets/tests/wait-for-image-yaml.mdx +18 -0
  92. package/docs/snippets/tests/wait-for-text-replay.mdx +7 -0
  93. package/docs/snippets/tests/wait-for-text-yaml.mdx +18 -0
  94. package/docs/snippets/tests/wait-replay.mdx +7 -0
  95. package/docs/snippets/tests/wait-yaml.mdx +13 -0
  96. package/docs/styles.css +46 -0
  97. package/package.json +3 -9
  98. package/testdriver/edge-cases/prompt-nested.yaml +2 -1
  99. package/docs/action/setup.mdx +0 -120
  100. package/docs/interactive/assert.mdx +0 -65
  101. package/docs/interactive/dry.mdx +0 -58
  102. package/docs/interactive/generate.mdx +0 -55
  103. package/docs/interactive/undo.mdx +0 -58
  104. package/docs/snippets/comments.mdx +0 -1
  105. package/docs/snippets/tests/prompt-replay.mdx +0 -5
  106. package/docs/snippets/tests/prompt-yaml.mdx +0 -10
  107. package/docs/snippets/yml-warning.mdx +0 -4
@@ -5,8 +5,6 @@ description: "Comprehensive guide to installing and setting up TestDriver for VS
5
5
  icon: "file-code"
6
6
  ---
7
7
 
8
- import YmlWarning from "/snippets/yml-warning.mdx";
9
-
10
8
  <Card
11
9
  title="Get the VS Code Extension"
12
10
  icon="link"
@@ -34,9 +32,7 @@ import YmlWarning from "/snippets/yml-warning.mdx";
34
32
  npx testdriverai@latest
35
33
  ```
36
34
 
37
- Once started, you can use commands like `/try`, `/undo`, and `/save` to interactively build and test your flows.
38
-
39
- <YmlWarning />
35
+ Once started, you can use commands like `/explore`, `/run`, and `/save` to interactively build and test your flows.
40
36
 
41
37
  </Step>
42
38
  <Step title="Define Your Test Steps" stepNumber={3}>
@@ -58,13 +54,14 @@ import YmlWarning from "/snippets/yml-warning.mdx";
58
54
  - command: type
59
55
  text: testdriverai
60
56
  - command: press-keys
61
- keys: [enter]
57
+ keys:
58
+ - enter
62
59
  ```
63
60
 
64
61
  </Step>
65
62
  <Step title="Refine and Save Your Test" stepNumber={4}>
66
- - Use `/undo` to remove the last step if needed.
67
63
  - Save your test with `/save` to generate a reusable YAML file.
64
+ - Use `/run` to run the test.
68
65
  </Step>
69
66
  <Step title="Run Saved Tests" stepNumber={5}>
70
67
  Once saved, you can run your test file anytime:
@@ -106,10 +106,8 @@ Assertions can be combined with navigation and interaction commands to validate
106
106
 
107
107
  ### Example: Login workflow with assertions
108
108
 
109
- #### TestDriver command:
110
-
111
- ```yaml
112
- version: 4.2.18
109
+ ```yaml login.yaml highlight={12,13, 36, 37}
110
+ version: 6.0.0
113
111
  steps:
114
112
  - prompt: Open the homepage
115
113
  commands:
@@ -1,12 +1,10 @@
1
1
  ---
2
- title: "Authentication in TestDriver"
2
+ title: "Authentication"
3
3
  sidebarTitle: "Authentication"
4
- description: "Learn how to securely handle authentication workflows in TestDriver using GitHub Actions."
5
- icon: "fingerprint"
4
+ description: "Learn how to handle authentication workflows in TestDriver using GitHub Actions."
5
+ icon: "key"
6
6
  ---
7
7
 
8
- import GitignoreWarning from "/snippets/gitignore-warning.mdx";
9
-
10
8
  This guide explains how to handle **authentication workflows** in **TestDriver** using GitHub Actions. It covers securely passing credentials (for example, usernames and passwords) to the TestDriver action and using them in both the `prerun` script and test files. Save these locally in your `.env` file and use them in CI as GitHub secrets.
11
9
 
12
10
  <GitignoreWarning />
@@ -27,7 +25,7 @@ This guide explains how to handle **authentication workflows** in **TestDriver**
27
25
 
28
26
  - Dynamically reference credentials in the `prerun` script or test files to perform authentication steps.
29
27
 
30
- store credentials in GitHub secrets
28
+ ## Step 1: Store credentials in GitHub secrets
31
29
 
32
30
  1. Navigate to your repository's **Settings** > **Secrets and variables** > **Actions**.
33
31
  2. Add the following secrets:
@@ -45,7 +43,7 @@ Secrets are passed to the workflow using the `secrets` context. They can be supp
45
43
 
46
44
  ### Example GitHub Actions workflow (adapt for your CI/CD platform)
47
45
 
48
- ```yaml
46
+ ```yaml workflows/td-auth.yml focus={17-24}
49
47
  name: TestDriver / Authentication
50
48
 
51
49
  on:
@@ -63,7 +61,7 @@ jobs:
63
61
  uses: actions/checkout@v4
64
62
 
65
63
  - name: Run Authentication Test
66
- run: npx testdriverai@latest run testdriver/authentication.yaml --headless
64
+ run: npx testdriverai@latest run testdriver/authentication.yaml
67
65
  env:
68
66
  TD_API_KEY: ${{ secrets.TD_API_KEY }}
69
67
  TD_USERNAME: ${{ secrets.TD_USERNAME }}
@@ -79,8 +77,8 @@ Secrets can be referenced in the test file using placeholders (for example, `${T
79
77
 
80
78
  ### Example test file:
81
79
 
82
- ```yaml
83
- version: 4.2.18
80
+ ```yaml login.yaml highlight={9, 10, 15, 16}
81
+ version: 6.0.0
84
82
  steps:
85
83
  - prompt: Log in to the application
86
84
  commands:
@@ -26,20 +26,18 @@ TestDriver allows you to execute custom **Node.js** scripts and shell scripts wi
26
26
 
27
27
  This example demonstrates how to generate a one-time password (OTP) using the `totp-generator` NPM package and use it in a test.
28
28
 
29
- ### Test file: `testdriver/testdriver.yaml`
30
-
31
- ```yaml
32
- version: 5.3.8
29
+ ```yaml verify-otp.yaml
30
+ version: 6.0.0
33
31
  steps:
34
32
  - commands:
35
33
  - command: exec
36
34
  lang: pwsh
37
- linux: |
35
+ code: |
38
36
  npm install totp-generator
39
37
  - command: exec
40
38
  lang: js
41
39
  output: totp
42
- linux: |
40
+ code: |
43
41
  const { TOTP } = require("totp-generator");
44
42
  let otp = TOTP.generate("JBSWY3DPEB3W64TMMQQQ").otp;
45
43
  console.log(otp);
@@ -50,14 +48,18 @@ steps:
50
48
 
51
49
  ## Additional details
52
50
 
53
- - The [`exec`](/commands/exec) command now takes a `lang` argument and supports different operating systems (`linux`, `mac`, and `windows`).
54
- - Supported `lang` values are `js` or `shell`:
55
- - `js` code is executed in a Node.js VM on the host machine (your computer).
56
- - `shell` code is executed in the shell on the runner.
57
- - Code specified in `linux`, `mac`, and `windows` is executed based on the platform of the runner machine.
51
+ - The [`exec`](/commands/exec) command now takes a `lang` argument with supported values `js` or `pwsh`.
52
+ - `js` code is executed in a Node.js [VM](https://nodejs.org/api/vm.html) module internally.
53
+ - `pwsh` code is executed in the PowerShell on the runner.
54
+
55
+ <Note>
56
+ The `result` variable is already available in your script, overwrite it to store the output as shown in the example.
57
+
58
+ The `output`argument is assigned automatically by setting `result = somestringvalue` in the script you run.
59
+
60
+ </Note>
58
61
 
59
62
  ## Protips
60
63
 
61
64
  - Always assign the output of your script to the `result` variable.
62
65
  - Ensure all required NPM packages are installed locally and in the `prerun` script when using GitHub Actions.
63
- - The script runs in the same context as the calling process and uses Node.js's [VM module](https://nodejs.org/api/vm.html) internally.
@@ -2,33 +2,34 @@
2
2
  title: "Environment Variables"
3
3
  sidebarTitle: "Environment Variables"
4
4
  description: "Learn how which environment variables are supported by TestDriver."
5
- icon: "key"
5
+ icon: "sliders-up"
6
+ mode: "wide"
6
7
  ---
7
8
 
8
9
  import GitignoreWarning from "/snippets/gitignore-warning.mdx";
9
10
 
10
11
  The supported environment variables in TestDriver are:
11
12
 
12
- | Variable | Type | Description |
13
- | :-------------: | :-------: | :--------------------------------------------------------------------------------------- |
14
- | `TD_ANALYTICS` | `boolean` | Send analytics to TestDriver servers. This helps provide feedback to inform our roadmap. |
15
- | `TD_API_ROOT` | `string` | Developer only. Set API root to another URL. For on-prem. |
16
- | `TD_API_KEY` | `string` | Set this to spawn VMs with TestDriver Pro. |
17
- | `TD_RESOLUTION` | `string` | Change resolution when TD_VM is true. Format like `1280x1024`. |
18
- | `TD_TYPE` | `string` | Set the type of test to run. Can be `website`, `desktop`, or `mobile`. Not required. |
13
+ <div className="env-vars-table">
14
+ | Variable | Type | Description | |:---------------:|:---------:|-----------|
15
+ | TD_ANALYTICS | boolean | Send analytics to TestDriver servers. This helps
16
+ provide feedback to inform our roadmap. | | TD_API_ROOT | string | Developer
17
+ only. Set API root to another URL. For on-prem. | | TD_API_KEY | string | Set
18
+ this to spawn VMs with TestDriver Pro. | | TD_RESOLUTION | string | Change
19
+ resolution when TD_VM is true. Format like `1280x1024`. | | TD_TYPE | string |
20
+ Set the type of test to run. Can be `website`, `desktop`, or `mobile`. Not
21
+ required. |
22
+ </div>
19
23
 
20
24
  <GitignoreWarning />
21
25
 
22
- ---
23
-
24
26
  ## Example
25
27
 
26
- ```
28
+ ```bash .env
27
29
  TD_API_KEY=your_api_key
28
30
  TD_RESOLUTION=1024x768
29
31
  TD_TYPE=website
30
32
  TD_WEBSITE=www.jeep.com
31
- TD_ANALYTICS=true
32
33
  ```
33
34
 
34
35
  In this example `.env` file, we're running a website test in a local Linux VM with a resolution of 1024x768. The terminal will be minimized, and the overlay won't be shown. Analytics will be sent to TestDriver servers.
@@ -5,6 +5,10 @@ description: "Learn how to customize TestDriver execution with lifecycle files f
5
5
  icon: "wrench"
6
6
  ---
7
7
 
8
+ ---
9
+
10
+ ## Overview
11
+
8
12
  Lifecycle files are YAML files placed in your repository's `lifecycle/` directory. TestDriver automatically executes these files during the appropriate phases:
9
13
 
10
14
  - **`lifecycle/provision.yaml`**: Executed when a new sandbox is created
@@ -18,7 +22,7 @@ Lifecycle files are YAML files placed in your repository's `lifecycle/` director
18
22
  All lifecycle files follow the standard TestDriver YAML format:
19
23
 
20
24
  ```yaml
21
- version: 5.1.1
25
+ version: 6.0.0
22
26
  steps:
23
27
  - prompt: description of what this step does
24
28
  commands:
@@ -37,17 +41,25 @@ steps:
37
41
 
38
42
  The `lifecycle/provision.yaml` file is executed when a new sandbox is created. This is ideal for installing dependencies, setting up the environment, or preparing the system for testing.
39
43
 
40
- ### Example: `lifecycle/provision.yaml`
44
+ ### Example
41
45
 
42
- ```yaml
43
- version: 5.1.1
46
+ ```yaml lifecycle/provision.yaml
47
+ version: 6.0.0
44
48
  steps:
45
49
  - prompt: setup testing environment
46
50
  commands:
47
51
  - command: exec
48
52
  lang: pwsh
49
53
  code: |
50
- 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}"
54
+ Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList @(
55
+ "--start-maximized",
56
+ "--disable-infobars",
57
+ "--disable-fre",
58
+ "--no-default-browser-check",
59
+ "--no-first-run",
60
+ "--guest",
61
+ "${TD_WEBSITE}"
62
+ )
51
63
  - command: wait-for-text
52
64
  text: ${TD_WEBSITE}
53
65
  timeout: 60000
@@ -64,19 +76,16 @@ steps:
64
76
 
65
77
  ## Prerun Scripts
66
78
 
67
- The `lifecycle/prerun.yaml` file is executed before each test run. This replaces the previous `prerun` parameter from the GitHub Action and is useful for preparing the immediate test environment.
79
+ The `lifecycle/prerun.yaml` file is executed before each test run irrespective of whether its a new sandbox or an already running one. This is useful for preparing the immediate test environment.
68
80
 
69
- ### Example: `lifecycle/prerun.yaml`
81
+ ### Example
70
82
 
71
- ```yaml
72
- version: 5.1.1
83
+ ```yaml lifecycle/prerun.yaml
84
+ version: 6.0.0
85
+ session: 67f00511acbd9ccac373edf7
73
86
  steps:
74
- - prompt: launch chrome and start tracking
87
+ - prompt: start dashcam
75
88
  commands:
76
- - command: exec
77
- lang: pwsh
78
- code: |
79
- 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}"
80
89
  - command: exec
81
90
  lang: pwsh
82
91
  code: dashcam track --name=TestDriver --type=application --pattern="C:\Users\testdriver\Documents\testdriver.log"
@@ -99,16 +108,16 @@ steps:
99
108
 
100
109
  The `lifecycle/postrun.yaml` file is executed after tests complete. This is useful for cleanup tasks, generating reports, or capturing final state information.
101
110
 
102
- ### Example: `lifecycle/postrun.yaml`
111
+ ### Example
103
112
 
104
- ```yaml
105
- version: 5.1.1
113
+ ```yaml lifecycle/postrun.yaml
114
+ version: 6.0.0
106
115
  steps:
107
116
  - prompt: cleanup and generate reports
108
117
  commands:
109
118
  - command: exec
110
119
  lang: pwsh
111
- code: dashcam -t '${TD_THIS_FILE}' -p
120
+ code: dashcam -t 'demo-test-title' -p # use '${TD_THIS_FILE}' to dynamically set the title for the recording
112
121
  ```
113
122
 
114
123
  ### Common postrun tasks:
@@ -132,8 +141,8 @@ Lifecycle files have access to TestDriver environment variables:
132
141
 
133
142
  ### Using variables in lifecycle files:
134
143
 
135
- ```yaml
136
- version: 5.1.1
144
+ ```yaml highlight={8, 9}
145
+ version: 6.0.0
137
146
  steps:
138
147
  - prompt: setup with custom variables
139
148
  commands:
@@ -191,13 +200,16 @@ Place lifecycle files in your repository's root directory:
191
200
 
192
201
  ```
193
202
  your-project/
194
- ├── lifecycle/
195
- │ ├── provision.yaml
196
- │ ├── prerun.yaml
197
- │ └── postrun.yaml
198
203
  ├── testdriver/
199
- └── your-tests.yaml
200
- └── package.json
204
+ ├── demo-test.yaml
205
+ └── lifecycle/
206
+ │ ├── provision.yaml
207
+ │ ├── prerun.yaml
208
+ │ └── postrun.yaml
209
+ │ ├── screenshots/
210
+ │ │ └──
211
+ │ └── snippets/
212
+ │ └──
201
213
  ```
202
214
 
203
215
  ---
@@ -217,7 +229,7 @@ When TestDriver runs, lifecycle files execute in this order:
217
229
 
218
230
  ### Lifecycle files not executing
219
231
 
220
- - Verify files are in the `lifecycle/` directory
232
+ - Verify files are in the `testdriver/lifecycle/` directory
221
233
  - Check YAML syntax is valid
222
234
  - Ensure version number is specified
223
235
  - Verify file permissions in your repository
@@ -228,7 +240,3 @@ When TestDriver runs, lifecycle files execute in this order:
228
240
  - Verify file paths exist on the target system
229
241
  - Add error handling and logging
230
242
  - Use appropriate timeouts for operations
231
-
232
- ---
233
-
234
- Lifecycle files provide powerful customization capabilities for your TestDriver workflows. Use them to create reliable, reproducible test environments that meet your specific requirements.
@@ -16,10 +16,10 @@ Variables in **TestDriver** allow you to dynamically store and reuse data during
16
16
 
17
17
  By leveraging variables in TestDriver, you can create dynamic, flexible, and reusable test scripts that adapt to changing conditions and data.
18
18
 
19
- #### Test file example:
19
+ #### Example:
20
20
 
21
- ```yaml
22
- version: 5.1.0
21
+ ```yaml random.yaml highlight={6, 11, 19, 20}
22
+ version: 6.0.0
23
23
  steps:
24
24
  - prompt: Generate a random number
25
25
  commands:
@@ -45,7 +45,7 @@ steps:
45
45
 
46
46
  You can run TestDriver in any CI/CD pipeline. Here is an example using the CLI in a generic workflow (adapt for your platform, e.g., GitHub Actions, GitLab CI, CircleCI, Jenkins, etc.):
47
47
 
48
- ```yaml
48
+ ```yaml workflows/testdriver.yml focus={6-13}
49
49
  steps:
50
50
  - name: Check out repository
51
51
  # For GitHub Actions: uses: actions/checkout@v4
@@ -58,17 +58,27 @@ steps:
58
58
  TD_PASSWORD: ${{ secrets.TD_PASSWORD }}
59
59
  # Add any other required environment variables
60
60
  run: |
61
- npx testdriverai@latest run --key "$TD_API_KEY" --prompt "1. Log in with username and password\n2. Verify the dashboard is displayed"
61
+ npx testdriverai@latest run testdriver/login.yaml
62
62
  ```
63
63
 
64
- > **Note:** This approach works with any CI/CD system (GitHub Actions, GitLab CI, CircleCI, Jenkins, etc.). Just set the appropriate environment variables and use the `npx testdriverai@latest run ...` command in your pipeline.
64
+ Now inside the `login.yaml` test file you can refer the variables
65
65
 
66
- #### Test file
67
-
68
- ```yaml
69
- version: 4.2.18
66
+ ```yaml login.yaml highlight={21, 22, 27, 28}
67
+ version: 6.0.0
70
68
  steps:
71
- - prompt: Log in to the application
69
+ - prompt: Open the homepage
70
+ commands:
71
+ - command: hover-text
72
+ text: Login
73
+ description: Login button in the top-right corner
74
+ action: click
75
+
76
+ - prompt: Verify the login form is displayed
77
+ commands:
78
+ - command: assert
79
+ expect: The login form is displayed
80
+
81
+ - prompt: Enter credentials and submit
72
82
  commands:
73
83
  - command: hover-text
74
84
  text: Email
@@ -83,25 +93,25 @@ steps:
83
93
  - command: type
84
94
  text: ${TD_PASSWORD}
85
95
  - command: hover-text
86
- text: Log In
87
- description: Log In button
96
+ text: Submit
97
+ description: Submit button
88
98
  action: click
89
99
  ```
90
100
 
91
- ### **Capturing outputs as variables**
101
+ ## **Capturing outputs as variables**
92
102
 
93
- #### Test file example:
103
+ #### Example:
94
104
 
95
- ```yaml
96
- version: 5.1.0
105
+ ```yaml capture-text.yaml highlight={5, 6, 14, 15}
106
+ version: 6.0.0
97
107
  steps:
98
108
  - prompt: Capture text from the screen
99
109
  commands:
100
- - command: capture-text
101
- description: Capture the welcome message
110
+ - command: remember
102
111
  output: welcomeMessage
112
+ description: Capture the welcome message
103
113
 
104
- - prompt: Verify the captured text
114
+ - prompt: Verify the dashboard is displayed
105
115
  commands:
106
116
  - command: exec
107
117
  js: |
@@ -52,7 +52,7 @@ The [`wait-for-text`](/commands/wait-for-text) command pauses the test until the
52
52
  ```yaml
53
53
  - command: wait-for-text
54
54
  text: <text to wait for>
55
- timeout: <time in milliseconds> # Optional, defaults to 5000ms
55
+ timeout: <time in milliseconds> # Optional, defaults to 5000ms or 5 seconds
56
56
  ```
57
57
 
58
58
  #### Example
@@ -74,7 +74,7 @@ The [`wait-for-image`](/commands/wait-for-image) command pauses the test until t
74
74
  ```yaml
75
75
  - command: wait-for-image
76
76
  description: <description of the image>
77
- timeout: <time in milliseconds> # Optional, defaults to 5000ms
77
+ timeout: <time in milliseconds> # Optional, defaults to 10000ms or 10 seconds
78
78
  ```
79
79
 
80
80
  #### Example:
@@ -68,7 +68,7 @@ function generateTestFile(userStory) {
68
68
  } = userStory;
69
69
 
70
70
  const testContent = {
71
- version: "4.2.18",
71
+ version: "6.0.0",
72
72
  steps: [
73
73
  {
74
74
  prompt: title,
@@ -109,7 +109,7 @@ This script will generate individual YAML test files (for example, `test_1.yaml`
109
109
 
110
110
  Create a CI/CD workflow to execute the generated test files in parallel using the TestDriver CLI. Below is a generalized example for any CI/CD system (adapt for your platform):
111
111
 
112
- ```yaml
112
+ ```yaml .github/workflows/testdriver.yaml
113
113
  name: Run TestDriver Tests
114
114
 
115
115
  on:
@@ -149,10 +149,9 @@ jobs:
149
149
  uses: actions/checkout@v4
150
150
 
151
151
  - name: Run TestDriver CLI
152
+ run: npx testdriverai@latest run ${{ matrix.test_file }}
152
153
  env:
153
154
  TD_API_KEY: ${{ secrets.TD_API_KEY }}
154
- FORCE_COLOR: "3"
155
- run: npx testdriverai@latest run ${{ matrix.test_file }} --headless
156
155
  ```
157
156
 
158
157
  ---
@@ -119,10 +119,10 @@ fetchJiraTickets();
119
119
 
120
120
  The script above generates a YAML file for each Jira ticket. Each file contains the **acceptance criteria** as `prompt` entries.
121
121
 
122
- ### Example YAML file (`testdriver_tests/PROJ-123.yaml`):
122
+ ### Example
123
123
 
124
- ```yaml
125
- version: 4.2.18
124
+ ```yaml testdriver/proj_123.yaml
125
+ version: 6.0.0
126
126
  steps:
127
127
  - prompt: The user can log in with valid credentials.
128
128
  - prompt: An error message is displayed for invalid credentials.
@@ -133,7 +133,7 @@ steps:
133
133
 
134
134
  ## Step 3: Save and organize test files
135
135
 
136
- 1. The generated YAML files will be saved in the `testdriver_tests/` directory.
136
+ 1. The generated YAML files will be saved in the `testdriver/` directory.
137
137
  2. Ensure the directory is part of your TestDriver project structure.
138
138
 
139
139
  ---
@@ -145,13 +145,7 @@ Use the TestDriver CLI to execute the generated test files.
145
145
  ### Run a single test file:
146
146
 
147
147
  ```bash
148
- npx testdriverai@latest run testdriver_tests/PROJ-123.yaml
149
- ```
150
-
151
- ### Run all test files:
152
-
153
- ```bash
154
- npx testdriverai@latest run testdriver_tests/*.yaml
148
+ npx testdriverai@latest run testdriver/proj_123.yaml
155
149
  ```
156
150
 
157
151
  ---
@@ -161,7 +155,7 @@ npx testdriverai@latest run testdriver_tests/*.yaml
161
155
  1. **Field Mapping**: Ensure the correct Jira field ID (for example, `customfield_12345`) is used for "Acceptance Criteria."
162
156
  2. **Secure Credentials**: Store Jira API credentials in environment variables or secrets.
163
157
  3. **Review Generated Files**: Manually review the YAML files to ensure they align with your testing requirements.
164
- 4. **Organize Tests**: Use a structured directory (for example, `testdriver_tests/`) to manage your test files.
158
+ 4. **Organize Tests**: Use a structured directory (for example, `testdriver/`) to manage your test files.
165
159
 
166
160
  ---
167
161
 
@@ -116,10 +116,10 @@ fetchTestRailTestCases();
116
116
 
117
117
  The script above generates a YAML file for each TestRail test case. Each file contains the **steps** as `prompt` entries.
118
118
 
119
- ### Example YAML file (`testdriver_tests/test_123.yaml`):
119
+ ### Example
120
120
 
121
- ```yaml
122
- version: 4.2.18
121
+ ```yaml testdriver/test_123.yaml
122
+ version: 6.0.0
123
123
  steps:
124
124
  - prompt: Navigate to the login page.
125
125
  - prompt: Enter valid credentials.
@@ -131,7 +131,7 @@ steps:
131
131
 
132
132
  ## Step 3: Save and organize test files
133
133
 
134
- 1. The generated YAML files will be saved in the `testdriver_tests/` directory.
134
+ 1. The generated YAML files will be saved in the `testdriver/` directory.
135
135
  2. Ensure the directory is part of your TestDriver project structure.
136
136
 
137
137
  ---
@@ -143,7 +143,7 @@ Use the TestDriver CLI to execute the generated test files.
143
143
  ### Run a Single test file:
144
144
 
145
145
  ```bash
146
- npx testdriverai@latest run testdriver_tests/test_123.yaml
146
+ npx testdriverai@latest run testdriver/test_123.yaml
147
147
  ```
148
148
 
149
149
  ---
@@ -153,7 +153,7 @@ npx testdriverai@latest run testdriver_tests/test_123.yaml
153
153
  1. **Field Mapping**: Ensure the correct TestRail field ID (for example, `custom_steps`) is used for test steps.
154
154
  2. **Secure Credentials**: Store TestRail API credentials in environment variables or secrets.
155
155
  3. **Review Generated Files**: Manually review the YAML files to ensure they align with your testing requirements.
156
- 4. **Organize Tests**: Use a structured directory (for example, `testdriver_tests/`) to manage your test files.
156
+ 4. **Organize Tests**: Use a structured directory (for example, `testdriver/`) to manage your test files.
157
157
 
158
158
  ---
159
159