testdriverai 5.3.0 → 5.3.2

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 (56) hide show
  1. package/agent.js +8 -0
  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 +80 -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/package.json +1 -1
  52. package/test.yml +18 -0
  53. package/testdriver/testdriver_2025-04-14T17-43-37-760Z.yaml +10 -0
  54. package/testdriver/testdriver_2025-04-14T17-45-00-565Z.yaml +13 -0
  55. package/testdriver/testdriver_2025-04-14T23-14-46-822Z.yaml +0 -0
  56. package/testdriver/testdriver_2025-04-14T23-14-51-653Z.yaml +0 -0
@@ -1,21 +1,18 @@
1
1
  ---
2
- title: "Getting Started with TestDriver.ai"
3
- sidebarTitle: "Getting Started"
2
+ title: "Running in GitHub Actions"
3
+ sidebarTitle: "Running in CI"
4
4
  description: "Learn how to set up and run tests with TestDriver.ai using GitHub Actions for seamless end-to-end testing."
5
+ icon: "code-pull-request"
5
6
  ---
6
7
 
7
8
  This guide explains how to set up a basic GitHub Actions workflow to run tests using **TestDriver.ai**.
8
9
 
9
- ---
10
-
11
- ## Step 1: Prerequisites
10
+ ## Prerequisites
12
11
 
13
12
  1. **TestDriver.ai API Key**: Obtain your API key from TestDriver.ai and store it as a GitHub secret (e.g., `TESTDRIVER_API_KEY`).
14
13
  2. **Test Files**: Ensure your test files are saved in the `testdriver/` directory of your repository.
15
14
 
16
- ---
17
-
18
- ## Step 2: Create a GitHub Actions Workflow
15
+ ## Create a GitHub Actions Workflow
19
16
 
20
17
  1. Create a new file in your repository: `.github/workflows/testdriver.yml`.
21
18
  2. Add the following workflow configuration:
@@ -23,174 +20,120 @@ This guide explains how to set up a basic GitHub Actions workflow to run tests u
23
20
  ### Example Workflow: `.github/workflows/testdriver.yml`
24
21
 
25
22
  ```yaml
26
- name: Run Tests with TestDriver.ai
23
+ name: TestDriver.ai / Run / Regressions
27
24
 
28
25
  on:
29
26
  push:
30
- branches:
31
- - main
27
+ branches: ["main"]
32
28
  pull_request:
33
29
  workflow_dispatch:
30
+ schedule:
31
+ - cron: '0 13 * * *' # Every day at 1 PM UTC (adjust if needed for timezone)
32
+
33
+ permissions:
34
+ actions: read
35
+ contents: read
36
+ statuses: write
37
+ pull-requests: write
34
38
 
35
39
  jobs:
36
- run-tests:
37
- name: Run TestDriver.ai Tests
40
+ gather-test-files:
41
+ name: Setup Test Matrix (./testdriver/*.yml)
38
42
  runs-on: ubuntu-latest
43
+ outputs:
44
+ test_files: ${{ steps.test_list.outputs.files }}
45
+ steps:
46
+ - name: Check out repository
47
+ uses: actions/checkout@v2
48
+ with:
49
+ ref: ${{ github.event.ref }}
50
+ - name: Find all test files and extract filenames
51
+ id: test_list
52
+ run: |
53
+ FILES=$(ls ./testdriver/*.yml)
54
+ FILENAMES=$(basename -a $FILES)
55
+ FILES_JSON=$(echo "$FILENAMES" | jq -R -s -c 'split("\n")[:-1]')
56
+ echo "::set-output name=files::$FILES_JSON"
57
+
58
+ test:
59
+ needs: gather-test-files
60
+ runs-on: ${{ matrix.os }}
61
+ strategy:
62
+ matrix:
63
+ test: ${{ fromJson(needs.gather-test-files.outputs.test_files) }}
64
+ os: ['linux', 'windows']
65
+ fail-fast: false
66
+ name: ${{ matrix.test }} (${{ matrix.os }})
39
67
  steps:
40
68
  - name: Check out repository
41
69
  uses: actions/checkout@v2
70
+ with:
71
+ ref: ${{ github.event.ref }}
72
+
73
+ - name: Display filename being tested
74
+ run: echo "Running job for file: ${{ matrix.test }} on ${{ matrix.os }}"
42
75
 
43
- - name: Run TestDriver.ai
44
- uses: testdriverai/action@main
76
+ - uses: testdriverai/action@main
45
77
  with:
46
78
  key: ${{ secrets.TESTDRIVER_API_KEY }}
47
- prompt: |
48
- 1. Run all tests in the testdriver directory
79
+ os: ${{ matrix.os }}
80
+ version: "5.2.3"
81
+ prompt: 1. /run testdriver/${{ matrix.test }}
82
+ prerun: |
83
+ cd $env:TEMP
84
+ npm init -y
85
+ npm install dashcam-chrome
86
+ Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "${{ env.TD_WEBSITE }}"
87
+ exit
49
88
  env:
50
89
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
90
  FORCE_COLOR: "3"
52
-
53
-
54
91
  ```
55
92
 
56
-
57
- ---
58
-
59
- ## Step 3: Add Your Test Files
60
-
61
- 1. Save your test files in the `testdriver/` directory of your repository.
62
- 2. Example test file: `testdriver/test.yml`:
63
-
64
- ```yaml
65
- version: 4.2.18
66
- steps:
67
- - prompt: Open the homepage
68
- - prompt: Verify the login button is visible
69
- - prompt: Click the login button
70
- - prompt: Verify the login form is displayed
71
-
72
-
73
- ```
74
-
75
-
76
- ---
77
-
78
- ## Step 4: Trigger the Workflow
93
+ ## Trigger the Workflow
79
94
 
80
95
  1. Push changes to the `main` branch or open a pull request.
81
96
  2. Alternatively, manually trigger the workflow from the **Actions** tab in your GitHub repository.
82
97
 
83
- ---
84
-
85
- ## Step 5: View Results
98
+ ## View Results
86
99
 
87
100
  1. Navigate to the **Actions** tab in your GitHub repository.
88
101
  2. Select the workflow run to view the test results.
89
102
 
90
- ---
91
-
92
- ## Example Output
93
-
94
- - ✅ **Run TestDriver.ai Tests**: All tests passed.
95
- - ❌ **Run TestDriver.ai Tests**: 1 test failed. View logs for details.
96
-
97
- ---
98
-
99
- By following this guide, you can quickly set up and run tests using TestDriver.ai on GitHub Actions.
100
-
101
- # Debugging Tests in TestDriver.ai (app.testdriver.ai)
103
+ # Debugging Tests
102
104
 
103
105
  TestDriver.ai provides a powerful debugging interface through its **app.testdriver.ai** platform (formerly Dashcam). This interface allows you to analyze test runs, identify failures, and optimize your test suite with detailed visual and textual feedback.
104
106
 
105
- ---
106
-
107
- ## Key Features of app.testdriver.ai for Debugging
108
-
109
- ### 1. **Step-by-Step Execution Logs**
107
+ ### Step-by-Step Execution Logs
110
108
  - View each step of the test execution, including:
111
109
  - The **action performed** (e.g., clicking a button, typing text).
112
110
  - The **expected outcome** (e.g., verifying a specific element is visible).
113
111
  - The **result** (pass, fail, or skipped).
114
112
  - Logs provide detailed context for each step, making it easier to pinpoint where and why a test failed.
115
113
 
116
- ---
117
-
118
- ### 2. **Visual Feedback**
114
+ ### 2. Visual Feedback
119
115
  - **Screenshots**: See what the application looked like at each step of the test.
120
116
  - **GIF Previews**: Watch a replay of the entire test execution to understand the flow and identify UI issues.
121
117
  - **Highlighting**: Elements interacted with during the test are highlighted in screenshots, helping you verify that the correct elements were targeted.
122
118
 
123
- ---
124
-
125
- ### 3. **Error Details**
119
+ ### 3. Error Details
126
120
  - For failed steps, app.testdriver.ai provides:
127
121
  - **Error messages**: Detailed descriptions of what went wrong (e.g., "Element not found").
128
122
  - **Stack traces**: For advanced debugging of backend or script-related issues.
129
123
  - **Suggestions**: Recommendations for fixing common issues, such as adjusting prompts or improving element descriptions.
130
124
 
131
- ---
132
-
133
- ### 4. **Test History**
125
+ ### 4. Test History
134
126
  - Access the history of test runs to:
135
127
  - Compare results across different builds or environments.
136
128
  - Identify flaky tests by analyzing patterns in failures.
137
129
  - Track improvements or regressions over time.
138
130
 
139
- ---
140
-
141
- ### 5. **Environment Context**
131
+ ### 5. Environment Context
142
132
  - View the environment details for each test run, including:
143
133
  - Operating system and browser version.
144
134
  - Screen resolution and viewport size.
145
135
  - Network conditions (if applicable).
146
136
 
147
- ---
148
-
149
- ### 6. **Collaboration Tools**
137
+ ### 6. Collaboration Tools
150
138
  - Share test results with your team by generating a shareable link.
151
139
  - Add comments or annotations to specific steps to facilitate discussions and debugging.
152
-
153
- ---
154
-
155
- ## How to Debug Tests in app.testdriver.ai
156
-
157
- 1. **Access Test Results**:
158
- - Navigate to [app.testdriver.ai](https://app.testdriver.ai).
159
- - Log in with your TestDriver.ai account.
160
- - Select the test run you want to debug from the dashboard.
161
-
162
- 2. **Analyze the Test Run**:
163
- - Review the **step-by-step logs** to identify where the test failed.
164
- - Use the **screenshots** and **GIF previews** to visually verify the application's behavior.
165
-
166
- 3. **Investigate Failures**:
167
- - Click on the failed step to view detailed error messages and suggestions.
168
- - Check the **highlighted elements** in the screenshots to ensure the correct elements were targeted.
169
-
170
- 4. **Iterate and Fix**:
171
- - Update your test prompts or application code based on the findings.
172
- - Re-run the test to verify the fix.
173
-
174
- ---
175
-
176
- ## Best Practices for Debugging in app.testdriver.ai
177
-
178
- 1. **Use Descriptive Prompts**:
179
- - Ensure your test prompts are clear and specific to reduce ambiguity.
180
- - Example: Instead of "Click the button," use "Click the 'Sign In' button in the header."
181
-
182
- 2. **Leverage Visual Feedback**:
183
- - Use screenshots and GIFs to quickly identify UI issues, such as misaligned elements or missing buttons.
184
-
185
- 3. **Track Flaky Tests**:
186
- - Use the test history to identify tests that fail intermittently and investigate potential causes (e.g., timing issues or dynamic content).
187
-
188
- 4. **Collaborate with Your Team**:
189
- - Share test results with developers and QA engineers to resolve issues faster.
190
-
191
- 5. **Optimize Test Steps**:
192
- - Combine or simplify test steps to make debugging easier and reduce test execution time.
193
-
194
- ---
195
-
196
- By leveraging the debugging tools in **app.testdriver.ai**, you can efficiently analyze and resolve test failures, ensuring your application meets the highest quality standards.
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: "Editing"
3
+ sidebarTitle: "Editing"
4
+ description: "Edit previously generated tests."
5
+ icon: "file-pen"
6
+ ---
7
+
8
+ Test scripts are written in YAML format, making them easy to read and modify manually if you need to.
9
+
10
+ <Card
11
+ title="Commands Reference"
12
+ icon="link"
13
+ href="/commands/assert"
14
+ >
15
+ Explore the available commands and their parameters.
16
+ </Card>
17
+
18
+ ## Locate the Test File
19
+ TestDriver test files are typically stored in the `testdriver/` directory of your project. The default file is `testdriver/testdriver.yaml`.
20
+
21
+ ### Open the Test File
22
+ Use your preferred text editor or IDE (e.g., Visual Studio Code) to open the YAML file.
23
+
24
+ ### YAML Structure
25
+ Each test file consists of:
26
+ - **Version**: Specifies the TestDriver version.
27
+ - **Session**: A unique identifier for the test session.
28
+ - **Steps**: A list of prompts and commands to execute.
29
+
30
+ ```yaml
31
+ version: 4.2.18
32
+ session: abc123
33
+ steps:
34
+ - prompt: Open Google Chrome and navigate to Airbnb
35
+ commands:
36
+ - command: focus-application
37
+ name: Google Chrome
38
+ - command: hover-text
39
+ text: Search Google or type a URL
40
+ description: main google search
41
+ action: click
42
+ - command: type
43
+ text: airbnb.com
44
+ - command: press-keys
45
+ keys: [enter]
46
+ ```
47
+
48
+ ### Modify the Test Steps
49
+ You can add, edit, or remove steps as needed. Each step contains:
50
+
51
+ - **Prompt**: A description of the action.
52
+ - **Commands**: The specific actions to perform.
53
+
54
+ #### Example Edits:
55
+ - **Add a Wait Command**:
56
+ ```yaml
57
+ - command: wait
58
+ timeout: 3000
59
+ ```
60
+ - **Change the URL**:
61
+ Update the `text` field in the `type` command:
62
+ ```yaml
63
+ - command: type
64
+ text: booking.com
65
+ ```
66
+
67
+ ### Validate the YAML Syntax
68
+ Ensure the YAML file is properly formatted:
69
+ - Use consistent indentation (2 spaces recommended).
70
+ - Avoid trailing spaces or tabs.
71
+ - Validate the file using a YAML linter if needed.
72
+
73
+ ### Test the Changes
74
+ Run the updated test to verify it works as expected:
75
+ ```bash
76
+ testdriverai run path/to/test.yaml
77
+ ```
@@ -1,12 +1,11 @@
1
1
  ---
2
- title: "Generating Test Plans with TestDriver.ai"
3
- sidebarTitle: "Generating Tests"
4
- description: "Learn how to generate test plans locally with TestDriver.ai and integrate them into your testing workflow."
2
+ title: "Self-Driving Tests"
3
+ sidebarTitle: "Self-Driving Tests"
4
+ description: "Generate test plans and integrate them into your testing workflow."
5
+ icon: "steering-wheel"
5
6
  ---
6
7
 
7
- # Running Locally Generated Test Plans with TestDriver.ai and Managing Generated PRs
8
-
9
- This guide explains how to use **TestDriver.ai** to generate test plans locally, commit them to your repository, and run them in parallel using GitHub Actions. Additionally, it covers how **TestDriver.ai** can automatically create **pull requests (PRs)** for test results, enabling collaboration and review.
8
+ This guide explains how to use **TestDriver.ai** to generate test plans locally and run them in parallel. You need
10
9
 
11
10
  ---
12
11
 
@@ -30,13 +29,10 @@ This guide explains how to use **TestDriver.ai** to generate test plans locally,
30
29
  ```bash
31
30
  testdriverai
32
31
  > /generate web 10
33
-
34
32
  ```
35
33
 
36
34
  This will generate 10 test plans for your website or application.
37
35
 
38
- ---
39
-
40
36
  ### Save the Generated Files
41
37
 
42
38
  TestDriver.ai will save the generated test plans as YAML files in the `testdriver/generate/` directory by default. For example:
@@ -47,164 +43,13 @@ testdriver/
47
43
  │ ├── test_1.yml
48
44
  │ ├── test_2.yml
49
45
  │ ├── test_3.yml
50
-
51
- ```
52
-
53
- ---
54
-
55
- ### Commit the Files to Your Repository
56
-
57
- 1. Add the generated files to your Git repository:
58
-
59
- ```bash
60
- git add testdriver/generate/
61
- git commit -m "Add locally generated test plans"
62
- git push origin main
63
- ```
64
-
65
- ---
66
-
67
- ## Step 2: Run Tests in Parallel Using GitHub Actions
68
-
69
- ### Workflow: **Run Locally Generated Tests**
70
-
71
- This workflow dynamically discovers the committed test files and runs them in parallel.
72
-
73
- #### Example Workflow: `.github/workflows/run-tests.yml`
74
-
75
- ```yaml
76
- name: Run Locally Generated Test Plans
77
-
78
- on:
79
- push:
80
- paths:
81
- - 'testdriver/generate/**'
82
- workflow_dispatch:
83
-
84
- jobs:
85
- gather-test-files:
86
- name: Gather Test Files
87
- runs-on: ubuntu-latest
88
- outputs:
89
- test_files: ${{ steps.test_list.outputs.files }}
90
- steps:
91
- - name: Check out repository
92
- uses: actions/checkout@v2
93
-
94
- - name: Find all test files
95
- id: test_list
96
- run: |
97
- FILES=$(ls ./testdriver/generate/*.yml)
98
- FILES_JSON=$(echo "$FILES" | jq -R -s -c 'split("\n")[:-1]')
99
- echo "::set-output name=files::$FILES_JSON"
100
-
101
- run-tests:
102
- name: Run Tests in Parallel
103
- needs: gather-test-files
104
- runs-on: ubuntu-latest
105
- strategy:
106
- matrix:
107
- test_file: ${{ fromJson(needs.gather-test-files.outputs.test_files) }}
108
- fail-fast: false
109
- steps:
110
- - name: Check out repository
111
- uses: actions/checkout@v2
112
-
113
- - name: Run TestDriver.ai
114
- uses: testdriverai/action@main
115
- with:
116
- key: ${{ secrets.TESTDRIVER_API_KEY }}
117
- prompt: |
118
- 1. /run ${{ matrix.test_file }}
119
- create-pr: true
120
- pr-title: "TestDriver.ai / Test Results for ${{ matrix.test_file }}"
121
- pr-branch: testdriver/results-${{ matrix.test_file }}
122
- env:
123
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124
- FORCE_COLOR: "3"
125
-
126
- ```
127
-
128
-
129
- ---
130
-
131
- ### Workflow Steps Explained
132
-
133
- 1. **Trigger on Push**:
134
- - The workflow triggers whenever files in the `testdriver/generate/` directory are pushed to the repository.
135
-
136
- 2. **Gather Test Files**:
137
- - The `gather-test-files` job collects all YAML files in the `testdriver/generate/` directory and outputs them as a JSON array.
138
-
139
- 3. **Run Tests in Parallel**:
140
- - The `run-tests` job uses the matrix strategy to run each test file in parallel.
141
-
142
- 4. **Create PRs for Test Results**:
143
- - For each test file, a new branch is created with the test results, and a PR is opened for review.
144
-
145
- ---
146
-
147
- ## Step 3: Generated PRs for Test Results
148
-
149
- ### How PRs Are Created
150
-
151
- When the tests are executed, TestDriver.ai automatically:
152
- 1. Creates a new branch for each test result (e.g., `testdriver/results-test_1.yml`).
153
- 2. Commits the test results to the branch.
154
- 3. Opens a pull request with the test results for review.
155
-
156
- ---
157
-
158
- ### Example PR Details
159
-
160
- #### PR Title:
161
- `TestDriver.ai / Test Results for test_1.yml`
162
-
163
- #### PR Description:
164
-
165
-
166
46
  ```
167
- ### Test Results for test_1.yml
168
-
169
- **Test Summary**:
170
- - Step 1: Opened the homepage.
171
- - ✅ Step 2: Verified the login button is visible.
172
- - ❌ Step 3: Failed to submit the login form.
173
-
174
- **Details**:
175
- - Error: The "Submit" button was not clickable.
176
-
177
- Please review the test results and address any issues.
178
-
179
- ```
180
-
181
- ---
182
-
183
- ### Benefits of Generated PRs
184
-
185
- 1. **Collaboration**: Teams can review test results directly in GitHub and discuss issues in the PR comments.
186
- 2. **Traceability**: Each test result is tied to a specific branch and PR, making it easy to track changes.
187
- 3. **Continuous Improvement**: Failed tests can be addressed and merged back into the main branch after fixes.
188
-
189
- ---
190
-
191
- ## Example Output
192
-
193
- ### GitHub Actions Dashboard:
194
- - ✅ **Run Tests in Parallel**: All tests passed.
195
- - ❌ **Run Tests in Parallel**: 1 test failed. View logs for details.
196
-
197
- ### Pull Requests:
198
- - **PR #123**: `TestDriver.ai / Test Results for test_1.yml`
199
- - **PR #124**: `TestDriver.ai / Test Results for test_2.yml`
200
-
201
- ---
202
-
203
- ## Summary
204
-
205
- 1. **Generate Tests Locally**: Use the `/generate` command to create test plans.
206
- 2. **Commit and Run Tests**: Push the generated files to your repository and execute them in parallel.
207
- 3. **Review Generated PRs**: Collaborate on test results using automatically created pull requests.
208
- 4. **Merge Fixes**: Address issues and merge the PRs back into the main branch.
209
-
210
- By leveraging TestDriver.ai's ability to generate and manage PRs, you can streamline your testing workflow and improve collaboration across your team.
47
+ ### Run the test files
48
+
49
+ <Card
50
+ title="Running TestDriver Tests"
51
+ icon="link"
52
+ href="/getting-started/ci"
53
+ >
54
+ Run your generated tests.
55
+ </Card>
@@ -1,67 +1,44 @@
1
1
  ---
2
- title: "Running Tests Locally with TestDriver.ai"
2
+ title: "Running Tests with TestDriver.ai"
3
3
  sidebarTitle: "Running Tests"
4
- description: "Learn how to execute test plans locally using TestDriver.ai's `/run` command for debugging and validation."
4
+ description: "Execute regression test plans for debugging and validation."
5
+ icon: "play"
5
6
  ---
6
7
 
7
- # Running Tests Locally with `/run` in TestDriver.ai
8
+ Run tests using previously created test scripts. This command replays the steps defined in the YAML file, performing each action sequentially.
8
9
 
9
- The `/run` command in TestDriver.ai allows you to execute previously created test plans locally. This is particularly useful for debugging, validating test scripts, or running tests in a controlled environment before committing them to a CI/CD pipeline.
10
+ You can run a test script by specifying the file path in the terminal or interactively within the TestDriver CLI.
10
11
 
11
- ---
12
-
13
- ## How to Use `/run`
14
-
15
- 1. **Navigate to Your Test Directory**:
16
- Ensure you are in the directory where your test files are stored (e.g., `testdriver/`).
17
-
18
- 2. **Run a Specific Test File**:
19
- Use the `/run` command followed by the path to the test file you want to execute. For example:
12
+ ### Example in Terminal
20
13
 
21
14
  ```bash
22
- testdriverai
23
- > /run testdriver/test.yml
15
+ testdriverai run path/to/test.yaml
24
16
  ```
25
- This will execute the test plan defined in `test.yml`.
26
17
 
27
- ---
28
-
29
- ## Benefits of Running Tests Locally
18
+ This will execute the test script located at `path/to/test.yaml`. If the test passes, the command will exit with a status code of `0`. If it fails, the command will exit with a status code of `1`.
30
19
 
31
- 1. **Quick Feedback**:
32
- - Test changes immediately without waiting for CI/CD pipelines.
33
- - Validate test scripts before committing them to version control.
20
+ ### Interactive Mode
34
21
 
35
- 2. **Debugging**:
36
- - Identify and fix issues in test scripts or application behavior in a controlled environment.
22
+ To run a test interactively:
37
23
 
38
- 3. **Offline Testing**:
39
- - Run tests locally without requiring access to cloud-based runners or external environments.
24
+ 1. Launch the TestDriver CLI:
25
+ ```bash
26
+ testdriverai
27
+ ```
28
+ 2. At the `>` prompt, type:
29
+ ```bash
30
+ /run path/to/test.yaml
31
+ ```
40
32
 
41
- 4. **Iterative Development**:
42
- - Modify test scripts and re-run them quickly to refine test cases.
43
-
44
- ---
33
+ ## Notes
45
34
 
46
- ## Example Workflow for Local Testing
47
-
48
- 1. **Create a Test File**:
49
- Save the following YAML file as `testdriver/test.yml`:
50
-
51
- ```yaml
52
- version: 4.2.18
53
- steps:
54
- - prompt: Open the homepage
55
- - prompt: Verify the login button is visible
56
- - prompt: Click the login button
57
- - prompt: Verify the login form is displayed
58
- ```
59
-
60
- 2. **Run the Test Locally**:
61
- Execute the test using the `/run` command:
62
-
63
- ```bash
64
- testdriverai
65
- > /run testdriver/test.yml
66
- ```
35
+ - Ensure the YAML file is valid and follows the TestDriver.ai specification.
36
+ - The default file path is `testdriver/testdriver.yaml` if no file is specified.
67
37
 
38
+ <Card
39
+ title="Running Tests in CI"
40
+ icon="link"
41
+ href="/getting-started/ci"
42
+ >
43
+ Run tests with Hosted Runnings in GitHub Actions
44
+ </Card>
@@ -1,7 +1,8 @@
1
1
  ---
2
- title: "Setting Up TestDriver.ai"
3
- sidebarTitle: "Setup Guide"
2
+ title: "Advanced Setup"
3
+ sidebarTitle: "Advanced Setup"
4
4
  description: "Comprehensive guide to installing and setting up TestDriver.ai for your testing needs."
5
+ icon: "square-terminal"
5
6
  ---
6
7
 
7
8
 
@@ -131,3 +132,23 @@ Follow these steps to install and set up TestDriver.ai:
131
132
  </Step>
132
133
 
133
134
  </Steps>
135
+
136
+ <CardGroup cols={2}>
137
+
138
+ <Card
139
+ title="Self-Driving Tests"
140
+ icon="link"
141
+ href="/getting-started/generating"
142
+ >
143
+ TestDriver will come up with it's own ideas for testing.
144
+ </Card>
145
+
146
+ <Card
147
+ title="Test Copilot"
148
+ icon="link"
149
+ href="/getting-started/writing"
150
+ >
151
+ Write custom tests
152
+ </Card>
153
+
154
+ </CardGroup>