testdriverai 5.2.1 → 5.3.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.
- package/.github/workflows/test-install.yml +1 -1
- package/README.md +5 -11
- package/agent.js +135 -99
- package/docs/30x30.mdx +84 -0
- package/docs/action/browser.mdx +129 -0
- package/docs/action/os.mdx +157 -0
- package/docs/action/output.mdx +98 -0
- package/docs/action/performance.mdx +71 -0
- package/docs/action/prerun.mdx +80 -0
- package/docs/action/secrets.mdx +103 -0
- package/docs/action/setup.mdx +115 -0
- package/docs/bugs/jira.mdx +208 -0
- package/docs/cli/overview.mdx +65 -0
- package/docs/commands/assert.mdx +31 -0
- package/docs/commands/exec.mdx +42 -0
- package/docs/commands/focus-application.mdx +29 -0
- package/docs/commands/hover-image.mdx +32 -0
- package/docs/commands/hover-text.mdx +37 -0
- package/docs/commands/if.mdx +43 -0
- package/docs/commands/match-image.mdx +41 -0
- package/docs/commands/press-keys.mdx +30 -0
- package/docs/commands/run.mdx +30 -0
- package/docs/commands/scroll-until-image.mdx +33 -0
- package/docs/commands/scroll-until-text.mdx +37 -0
- package/docs/commands/scroll.mdx +33 -0
- package/docs/commands/type.mdx +29 -0
- package/docs/commands/wait-for-image.mdx +31 -0
- package/docs/commands/wait-for-text.mdx +35 -0
- package/docs/commands/wait.mdx +30 -0
- package/docs/docs.json +226 -0
- package/docs/exporting/playwright.mdx +159 -0
- package/docs/features/auto-healing.mdx +124 -0
- package/docs/features/cross-platform.mdx +106 -0
- package/docs/features/generation.mdx +180 -0
- package/docs/features/github.mdx +161 -0
- package/docs/features/parallel-testing.mdx +130 -0
- package/docs/features/reusable-snippets.mdx +124 -0
- package/docs/features/selectorless.mdx +62 -0
- package/docs/features/visual-assertions.mdx +123 -0
- package/docs/getting-started/ci.mdx +196 -0
- package/docs/getting-started/generating.mdx +210 -0
- package/docs/getting-started/running.mdx +67 -0
- package/docs/getting-started/setup.mdx +133 -0
- package/docs/getting-started/writing.mdx +99 -0
- package/docs/guide/assertions.mdx +195 -0
- package/docs/guide/authentication.mdx +150 -0
- package/docs/guide/code.mdx +169 -0
- package/docs/guide/locating.mdx +136 -0
- package/docs/guide/setup-teardown.mdx +161 -0
- package/docs/guide/variables.mdx +218 -0
- package/docs/guide/waiting.mdx +199 -0
- package/docs/importing/csv.mdx +196 -0
- package/docs/importing/gherkin.mdx +142 -0
- package/docs/importing/jira.mdx +172 -0
- package/docs/importing/testrail.mdx +161 -0
- package/docs/integrations/electron.mdx +152 -0
- package/docs/integrations/netlify.mdx +98 -0
- package/docs/integrations/vercel.mdx +177 -0
- package/docs/interactive/assert.mdx +51 -0
- package/docs/interactive/generate.mdx +41 -0
- package/docs/interactive/run.mdx +36 -0
- package/docs/interactive/save.mdx +53 -0
- package/docs/interactive/undo.mdx +47 -0
- package/docs/issues.mdx +9 -0
- package/docs/overview/comparison.mdx +82 -0
- package/docs/overview/faq.mdx +122 -0
- package/docs/overview/quickstart.mdx +66 -0
- package/docs/overview/what-is-testdriver.mdx +73 -0
- package/docs/quickstart.mdx +66 -0
- package/docs/reference/commands/scroll.mdx +0 -0
- package/docs/reference/interactive/assert.mdx +0 -0
- package/docs/security/action.mdx +62 -0
- package/docs/security/agent.mdx +62 -0
- package/docs/security/dashboard.mdx +0 -0
- package/docs/security/platform.mdx +54 -0
- package/docs/tutorials/advanced-test.mdx +79 -0
- package/docs/tutorials/basic-test.mdx +41 -0
- package/electron/icon.png +0 -0
- package/electron/overlay.html +7 -3
- package/electron/overlay.js +76 -16
- package/electron/tray-buffered.png +0 -0
- package/electron/tray.png +0 -0
- package/index.js +75 -34
- package/lib/commander.js +22 -1
- package/lib/commands.js +87 -19
- package/lib/config.js +10 -1
- package/lib/focus-application.js +30 -23
- package/lib/generator.js +58 -7
- package/lib/init.js +48 -19
- package/lib/ipc.js +50 -0
- package/lib/logger.js +19 -6
- package/lib/overlay.js +82 -36
- package/lib/parser.js +9 -7
- package/lib/resources/prerun.yaml +17 -0
- package/lib/sandbox.js +2 -3
- package/lib/sdk.js +0 -2
- package/lib/session.js +3 -1
- package/lib/speak.js +0 -2
- package/lib/subimage/opencv.js +0 -4
- package/lib/system.js +56 -39
- package/lib/upload-secrets.js +65 -0
- package/lib/validation.js +175 -0
- package/package.json +2 -1
- package/postinstall.js +0 -24
- package/lib/websockets.js +0 -85
- package/test.md +0 -8
- package/test.yml +0 -18
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reusable Snippets in TestDriver.ai"
|
|
3
|
+
sidebarTitle: "Reusable Snippets"
|
|
4
|
+
description: "Discover how to modularize your test workflows using reusable YAML snippets in TestDriver.ai for improved maintainability and scalability."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Reusable snippets in TestDriver allow you to modularize your test steps by creating smaller, reusable YAML files that can be embedded into larger test workflows. This approach improves test maintainability, reduces duplication, and makes your test suite more organized and scalable.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What Are Reusable Snippets?
|
|
12
|
+
|
|
13
|
+
Reusable snippets are YAML files containing a set of test steps that perform a specific task, such as logging in, navigating to a page, or setting up test prerequisites. These snippets can be referenced in other test files using the `run` command, enabling you to reuse common actions across multiple tests.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Why Use Reusable Snippets?
|
|
18
|
+
|
|
19
|
+
1. **Maintainability**: Update a snippet in one place, and all tests using it will automatically reflect the changes.
|
|
20
|
+
2. **Reusability**: Avoid duplicating common actions like login or setup across multiple tests.
|
|
21
|
+
3. **Modularity**: Break down complex workflows into smaller, manageable pieces.
|
|
22
|
+
4. **Consistency**: Ensure uniform behavior across tests by reusing the same logic.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## How to Create and Use Reusable Snippets
|
|
27
|
+
|
|
28
|
+
### Step 1: Create a Snippet
|
|
29
|
+
|
|
30
|
+
Save a YAML file containing the reusable steps. For example, create a `snippets/login.yaml` file for logging into an application:
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
version: 4.2.18
|
|
34
|
+
steps:
|
|
35
|
+
- prompt: Log in to the application
|
|
36
|
+
commands:
|
|
37
|
+
- command: hover-text
|
|
38
|
+
text: Email address
|
|
39
|
+
description: email input field label
|
|
40
|
+
action: click
|
|
41
|
+
- command: type
|
|
42
|
+
text: ${TD_USERNAME} # Use environment variable for username
|
|
43
|
+
- command: hover-text
|
|
44
|
+
text: Password
|
|
45
|
+
description: password input field label
|
|
46
|
+
action: click
|
|
47
|
+
- command: type
|
|
48
|
+
text: ${TD_PASSWORD} # Use environment variable for password
|
|
49
|
+
- command: hover-text
|
|
50
|
+
text: Log In
|
|
51
|
+
description: log in button
|
|
52
|
+
action: click
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### Step 2: Reference the Snippet in a Test
|
|
58
|
+
|
|
59
|
+
Use the `run` command to include the snippet in your main test file. For example:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
version: 4.2.18
|
|
63
|
+
steps:
|
|
64
|
+
- prompt: Log in and navigate to the dashboard
|
|
65
|
+
commands:
|
|
66
|
+
- command: run
|
|
67
|
+
file: snippets/login.yaml
|
|
68
|
+
- command: hover-text
|
|
69
|
+
text: Dashboard
|
|
70
|
+
description: dashboard link in the navigation bar
|
|
71
|
+
action: click
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Step 3: Parameterize Inputs
|
|
77
|
+
|
|
78
|
+
Use environment variables to pass dynamic data like usernames and passwords. Define these variables in your `.env` file or CI/CD pipeline:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
TD_USERNAME=your_username
|
|
82
|
+
TD_PASSWORD=your_password
|
|
83
|
+
```
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Example: Combining Multiple Snippets
|
|
87
|
+
|
|
88
|
+
You can chain multiple snippets together to create complex workflows. For example:
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
version: 4.2.18
|
|
92
|
+
steps:
|
|
93
|
+
- prompt: Log in, search for a product, and add it to the cart
|
|
94
|
+
commands:
|
|
95
|
+
- command: run
|
|
96
|
+
file: snippets/login.yaml
|
|
97
|
+
- command: run
|
|
98
|
+
file: snippets/search_product.yaml
|
|
99
|
+
- command: run
|
|
100
|
+
file: snippets/add_to_cart.yaml
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Best Practices for Reusable Snippets
|
|
106
|
+
|
|
107
|
+
1. **Organize Snippets**: Store reusable snippets in a dedicated `snippets/` directory for better organization.
|
|
108
|
+
2. **Use Descriptive Names**: Name snippet files clearly (e.g., `login.yaml`, `setup.yaml`) to indicate their purpose.
|
|
109
|
+
3. **Test Snippets Independently**: Validate each snippet before integrating it into larger workflows.
|
|
110
|
+
4. **Parameterize Inputs**: Use placeholders or environment variables for dynamic data.
|
|
111
|
+
5. **Document Snippets**: Add comments or documentation to explain the purpose and usage of each snippet.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Benefits of Reusable Snippets
|
|
116
|
+
|
|
117
|
+
- **Efficiency**: Save time by reusing existing logic.
|
|
118
|
+
- **Scalability**: Easily extend your test suite by combining snippets.
|
|
119
|
+
- **Consistency**: Ensure uniform behavior across tests.
|
|
120
|
+
- **Reduced Maintenance**: Centralize updates to common actions.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
Reusable snippets are a cornerstone of efficient test design in TestDriver.ai. By modularizing your tests, you can create a scalable, maintainable, and reusable test suite that adapts to your application's evolving needs. Start by creating snippets for common actions like login or navigation, and expand your library as your test suite grows.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Selectorless Testing with TestDriver.ai"
|
|
3
|
+
sidebarTitle: "Selectorless Testing"
|
|
4
|
+
description: "Selectorless testing approach simplifies end-to-end testing by using natural language and AI vision."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Selectorless testing eliminates the need for brittle selectors like CSS classes, IDs, or XPath. Instead, TestDriver uses natural language prompts and AI-powered vision to interact with applications as a user would. This makes tests more resilient to UI changes and reduces maintenance overhead.
|
|
8
|
+
|
|
9
|
+
- Selectorless testing focuses on **what the user sees** rather than **how the UI is implemented**.
|
|
10
|
+
- Tests are resilient to changes like text updates, class renaming, or minor layout adjustments.
|
|
11
|
+
- By using natural language and AI vision, TestDriver simplifies test creation and maintenance.
|
|
12
|
+
|
|
13
|
+
## What is Selectorless Testing?
|
|
14
|
+
|
|
15
|
+
The following is an example of a TestDriver test.
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
version: 4.2.18
|
|
19
|
+
steps:
|
|
20
|
+
- prompt: Click the "Sign Up" button
|
|
21
|
+
commands:
|
|
22
|
+
- command: hover-text
|
|
23
|
+
text: Sign Up
|
|
24
|
+
description: button in the header for user registration
|
|
25
|
+
action: click
|
|
26
|
+
- prompt: Assert the registration form is displayed
|
|
27
|
+
commands:
|
|
28
|
+
- command: assert
|
|
29
|
+
expect: The registration form is visible
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This allows TestDriver locates the target for `hover-text` based on its context and description. The agent will search for elements: in the following order.
|
|
33
|
+
|
|
34
|
+
- `text` - exact element to match
|
|
35
|
+
- `description` - a description of the element given the exact text is not found, or there are multiple matches
|
|
36
|
+
- `prompt` - a high level prompt used to regenerate the test if no match is found
|
|
37
|
+
|
|
38
|
+
### What Happens When "Sign Up" Changes to "Register"?
|
|
39
|
+
|
|
40
|
+
If the button text changes to "Register," TestDriver's AI vision will still locate the button based on its context and description. You don't need to update the test manually.
|
|
41
|
+
TestDriver will then update the test to reflect the new UI by modifing the `text` field. Then, it will open a new pull request with the changes.
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
version: 4.2.18
|
|
45
|
+
steps:
|
|
46
|
+
- prompt: Click the "Register" button
|
|
47
|
+
commands:
|
|
48
|
+
- command: hover-text
|
|
49
|
+
text: Register
|
|
50
|
+
description: button in the header for user registration
|
|
51
|
+
action: click
|
|
52
|
+
```
|
|
53
|
+
## Why Selectorless Testing?
|
|
54
|
+
|
|
55
|
+
Traditional testing frameworks rely on selectors tightly coupled to the codebase.
|
|
56
|
+
For example:
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
const button = await page.$('button[class="sign-up-btn"]');
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If the class name changes, the test will break, requiring updates to the test code. Selectorless testing avoids this by focusing on the intent of the interaction rather than the implementation details.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Visual Assertions with TestDriver.ai"
|
|
3
|
+
sidebarTitle: "Visual Assertions"
|
|
4
|
+
description: "Discover how TestDriver.ai leverages AI-powered visual assertions to validate UI behavior and enhance end-to-end testing."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Visual assertions in TestDriver.ai allow you to validate that your application behaves as expected by analyzing what is displayed on the screen. This approach ensures that your tests mimic real user interactions and verify outcomes visually, making it ideal for testing UI-heavy applications and dynamic content.
|
|
8
|
+
|
|
9
|
+
## What Are Visual Assertions?
|
|
10
|
+
|
|
11
|
+
Visual assertions check the state of the screen to confirm that specific elements, content, or behaviors are present. Instead of relying on selectors or static code analysis, TestDriver uses AI-powered vision to interpret the screen, ensuring robust and adaptive testing.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## What Can TestDriver.ai Test with Visual Assertions?
|
|
16
|
+
|
|
17
|
+
### AI Chatbots
|
|
18
|
+
- Validate that chatbot responses are displayed correctly.
|
|
19
|
+
- Ensure the chatbot interface is accessible and functional.
|
|
20
|
+
|
|
21
|
+
### Desktop Applications
|
|
22
|
+
- Verify that desktop app windows, dialogs, and UI elements render as expected.
|
|
23
|
+
- Test cross-platform compatibility for Windows, Mac, and Linux.
|
|
24
|
+
|
|
25
|
+
### Chrome Extensions
|
|
26
|
+
- Confirm that the extension UI integrates properly with the browser.
|
|
27
|
+
- Validate extension popups, settings, and interactions.
|
|
28
|
+
|
|
29
|
+
### PDF Generation
|
|
30
|
+
- Assert that generated PDFs contain the correct text, images, and formatting.
|
|
31
|
+
- Verify that PDFs open and display properly in viewers.
|
|
32
|
+
|
|
33
|
+
### Spelling & Grammar
|
|
34
|
+
- Check for spelling and grammar errors in displayed text.
|
|
35
|
+
- Validate that text content matches expected language rules.
|
|
36
|
+
|
|
37
|
+
### Auth Signup & Login
|
|
38
|
+
- Ensure OAuth flows display the correct login screens.
|
|
39
|
+
- Verify that users are redirected to the correct pages after login.
|
|
40
|
+
|
|
41
|
+
### File System & Uploads
|
|
42
|
+
- Confirm that file upload dialogs appear and function correctly.
|
|
43
|
+
- Validate that uploaded files are processed and displayed as expected.
|
|
44
|
+
|
|
45
|
+
### Image Content
|
|
46
|
+
- Verify that images are displayed correctly and match expected content.
|
|
47
|
+
- Test for the presence of specific icons, logos, or visual elements.
|
|
48
|
+
|
|
49
|
+
### Video Content
|
|
50
|
+
- Assert that videos play correctly and match expected visuals.
|
|
51
|
+
- Validate video controls (play, pause, fullscreen) and captions.
|
|
52
|
+
|
|
53
|
+
### OS Accessibility Features
|
|
54
|
+
- Test high-contrast modes, screen readers, and other accessibility features.
|
|
55
|
+
- Validate that UI elements are accessible and readable.
|
|
56
|
+
|
|
57
|
+
### Light / Dark Mode
|
|
58
|
+
- Verify that the application switches between light and dark modes correctly.
|
|
59
|
+
- Assert that UI elements are visible and styled appropriately in both modes.
|
|
60
|
+
|
|
61
|
+
### Privacy Configuration
|
|
62
|
+
- Confirm that privacy settings are displayed and functional.
|
|
63
|
+
- Validate that toggles, checkboxes, and options reflect the correct state.
|
|
64
|
+
|
|
65
|
+
### `<iframe>`
|
|
66
|
+
- Test content rendered inside `<iframe>` elements.
|
|
67
|
+
- Validate interactions within embedded frames.
|
|
68
|
+
|
|
69
|
+
### `<canvas>`
|
|
70
|
+
- Verify that canvas elements render graphics, charts, or animations correctly.
|
|
71
|
+
- Assert that dynamic content within the canvas matches expectations.
|
|
72
|
+
|
|
73
|
+
### `<video>`
|
|
74
|
+
- Ensure video elements load and play correctly.
|
|
75
|
+
- Validate video overlays, subtitles, and playback controls.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## How to Use Visual Assertions
|
|
80
|
+
|
|
81
|
+
### Example: Asserting Text on the Screen
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
- command: assert
|
|
85
|
+
expect: "The chatbot response is displayed correctly"
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Example: Asserting an Image is Present
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
- command: assert
|
|
93
|
+
expect: The company logo appears in the header
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Example: Asserting Video Playback
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
- command: assert
|
|
100
|
+
expect: "The video is playing"
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Benefits of Visual Assertions
|
|
106
|
+
|
|
107
|
+
1. **Selectorless Testing**: No need to rely on brittle selectors or static code.
|
|
108
|
+
2. **Dynamic Adaptation**: Tests adapt to UI changes, reducing maintenance.
|
|
109
|
+
3. **Real User Simulation**: Validates the application as a user would experience it.
|
|
110
|
+
4. **Cross-Platform Support**: Works seamlessly across web, desktop, and mobile environments.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Best Practices for Visual Assertions
|
|
115
|
+
|
|
116
|
+
1. **Use Descriptive Prompts**: Provide clear descriptions for elements or behaviors you want to test.
|
|
117
|
+
2. **Combine with Other Commands**: Use visual assertions alongside navigation and interaction commands for end-to-end testing.
|
|
118
|
+
3. **Leverage AI Matching**: Use AI-powered matching for dynamic or non-deterministic content.
|
|
119
|
+
4. **Test Across Modes**: Validate light/dark modes, accessibility features, and privacy settings for comprehensive coverage.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
Visual assertions in TestDriver.ai empower you to test a wide range of applications and scenarios with confidence, ensuring your software delivers a seamless user experience.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Getting Started with TestDriver.ai"
|
|
3
|
+
sidebarTitle: "Getting Started"
|
|
4
|
+
description: "Learn how to set up and run tests with TestDriver.ai using GitHub Actions for seamless end-to-end testing."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This guide explains how to set up a basic GitHub Actions workflow to run tests using **TestDriver.ai**.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Step 1: Prerequisites
|
|
12
|
+
|
|
13
|
+
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
|
+
2. **Test Files**: Ensure your test files are saved in the `testdriver/` directory of your repository.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Step 2: Create a GitHub Actions Workflow
|
|
19
|
+
|
|
20
|
+
1. Create a new file in your repository: `.github/workflows/testdriver.yml`.
|
|
21
|
+
2. Add the following workflow configuration:
|
|
22
|
+
|
|
23
|
+
### Example Workflow: `.github/workflows/testdriver.yml`
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
name: Run Tests with TestDriver.ai
|
|
27
|
+
|
|
28
|
+
on:
|
|
29
|
+
push:
|
|
30
|
+
branches:
|
|
31
|
+
- main
|
|
32
|
+
pull_request:
|
|
33
|
+
workflow_dispatch:
|
|
34
|
+
|
|
35
|
+
jobs:
|
|
36
|
+
run-tests:
|
|
37
|
+
name: Run TestDriver.ai Tests
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- name: Check out repository
|
|
41
|
+
uses: actions/checkout@v2
|
|
42
|
+
|
|
43
|
+
- name: Run TestDriver.ai
|
|
44
|
+
uses: testdriverai/action@main
|
|
45
|
+
with:
|
|
46
|
+
key: ${{ secrets.TESTDRIVER_API_KEY }}
|
|
47
|
+
prompt: |
|
|
48
|
+
1. Run all tests in the testdriver directory
|
|
49
|
+
env:
|
|
50
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
51
|
+
FORCE_COLOR: "3"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
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
|
|
79
|
+
|
|
80
|
+
1. Push changes to the `main` branch or open a pull request.
|
|
81
|
+
2. Alternatively, manually trigger the workflow from the **Actions** tab in your GitHub repository.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 5: View Results
|
|
86
|
+
|
|
87
|
+
1. Navigate to the **Actions** tab in your GitHub repository.
|
|
88
|
+
2. Select the workflow run to view the test results.
|
|
89
|
+
|
|
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)
|
|
102
|
+
|
|
103
|
+
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
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Key Features of app.testdriver.ai for Debugging
|
|
108
|
+
|
|
109
|
+
### 1. **Step-by-Step Execution Logs**
|
|
110
|
+
- View each step of the test execution, including:
|
|
111
|
+
- The **action performed** (e.g., clicking a button, typing text).
|
|
112
|
+
- The **expected outcome** (e.g., verifying a specific element is visible).
|
|
113
|
+
- The **result** (pass, fail, or skipped).
|
|
114
|
+
- Logs provide detailed context for each step, making it easier to pinpoint where and why a test failed.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### 2. **Visual Feedback**
|
|
119
|
+
- **Screenshots**: See what the application looked like at each step of the test.
|
|
120
|
+
- **GIF Previews**: Watch a replay of the entire test execution to understand the flow and identify UI issues.
|
|
121
|
+
- **Highlighting**: Elements interacted with during the test are highlighted in screenshots, helping you verify that the correct elements were targeted.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 3. **Error Details**
|
|
126
|
+
- For failed steps, app.testdriver.ai provides:
|
|
127
|
+
- **Error messages**: Detailed descriptions of what went wrong (e.g., "Element not found").
|
|
128
|
+
- **Stack traces**: For advanced debugging of backend or script-related issues.
|
|
129
|
+
- **Suggestions**: Recommendations for fixing common issues, such as adjusting prompts or improving element descriptions.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### 4. **Test History**
|
|
134
|
+
- Access the history of test runs to:
|
|
135
|
+
- Compare results across different builds or environments.
|
|
136
|
+
- Identify flaky tests by analyzing patterns in failures.
|
|
137
|
+
- Track improvements or regressions over time.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### 5. **Environment Context**
|
|
142
|
+
- View the environment details for each test run, including:
|
|
143
|
+
- Operating system and browser version.
|
|
144
|
+
- Screen resolution and viewport size.
|
|
145
|
+
- Network conditions (if applicable).
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### 6. **Collaboration Tools**
|
|
150
|
+
- Share test results with your team by generating a shareable link.
|
|
151
|
+
- 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.
|