testdriverai 5.6.3 → 5.6.4
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/agent.js +1 -1
- package/docs/account/dashboard.mdx +3 -6
- package/docs/account/enterprise.mdx +16 -15
- package/docs/account/pricing.mdx +4 -4
- package/docs/account/projects.mdx +2 -2
- package/docs/account/team.mdx +3 -3
- package/docs/action/browser.mdx +9 -9
- package/docs/action/os.mdx +12 -12
- package/docs/action/output.mdx +10 -10
- package/docs/action/performance.mdx +11 -11
- package/docs/{guide/lifecycle.mdx → action/pre-post-scripts.mdx} +87 -69
- package/docs/action/secrets.mdx +11 -11
- package/docs/action/setup.mdx +8 -8
- package/docs/apps/chrome-extensions.mdx +9 -9
- package/docs/apps/desktop-apps.mdx +6 -5
- package/docs/apps/mobile-apps.mdx +3 -3
- package/docs/apps/static-websites.mdx +2 -3
- package/docs/bugs/jira.mdx +16 -16
- package/docs/cli/overview.mdx +8 -8
- package/docs/commands/exec.mdx +152 -10
- package/docs/commands/focus-application.mdx +1 -1
- package/docs/commands/hover-image.mdx +1 -1
- package/docs/commands/hover-text.mdx +2 -2
- package/docs/commands/if.mdx +1 -1
- package/docs/commands/issues.mdx +8 -6
- package/docs/commands/match-image.mdx +2 -2
- package/docs/commands/press-keys.mdx +19 -2
- package/docs/commands/run.mdx +1 -1
- package/docs/commands/scroll-until-image.mdx +1 -1
- package/docs/commands/scroll-until-text.mdx +2 -2
- package/docs/commands/scroll.mdx +2 -2
- package/docs/commands/type.mdx +1 -1
- package/docs/commands/wait-for-image.mdx +1 -1
- package/docs/commands/wait-for-text.mdx +1 -1
- package/docs/commands/wait.mdx +1 -1
- package/docs/docs.json +9 -9
- package/docs/exporting/playwright.mdx +16 -16
- package/docs/features/auto-healing.mdx +5 -5
- package/docs/features/cross-platform.mdx +4 -4
- package/docs/features/generation.mdx +7 -4
- package/docs/features/github.mdx +21 -21
- package/docs/features/parallel-testing.mdx +9 -9
- package/docs/features/reusable-snippets.mdx +7 -7
- package/docs/features/selectorless.mdx +4 -4
- package/docs/features/visual-assertions.mdx +26 -23
- package/docs/getting-started/ci.mdx +19 -19
- package/docs/getting-started/editing.mdx +12 -8
- package/docs/getting-started/generating.mdx +4 -5
- package/docs/getting-started/running.mdx +3 -3
- package/docs/getting-started/setup.mdx +9 -9
- package/docs/getting-started/vscode.mdx +63 -85
- package/docs/getting-started/writing.mdx +11 -7
- package/docs/guide/assertions.mdx +21 -21
- package/docs/guide/authentication.mdx +11 -11
- package/docs/guide/code.mdx +6 -6
- package/docs/guide/environment-variables.mdx +9 -9
- package/docs/guide/lifecycle-prerun.mdx +191 -0
- package/docs/guide/locating.mdx +15 -18
- package/docs/guide/variables.mdx +8 -8
- package/docs/guide/waiting.mdx +10 -10
- package/docs/importing/csv.mdx +23 -24
- package/docs/importing/gherkin.mdx +20 -20
- package/docs/importing/jira.mdx +22 -23
- package/docs/importing/testrail.mdx +17 -17
- package/docs/integrations/electron.mdx +7 -7
- package/docs/integrations/netlify.mdx +7 -7
- package/docs/integrations/vercel.mdx +13 -13
- package/docs/interactive/assert.mdx +3 -3
- package/docs/interactive/dry.mdx +7 -7
- package/docs/interactive/explore.mdx +9 -9
- package/docs/interactive/generate.mdx +2 -2
- package/docs/interactive/run.mdx +10 -10
- package/docs/interactive/save.mdx +3 -3
- package/docs/interactive/undo.mdx +1 -1
- package/docs/overview/comparison.mdx +6 -6
- package/docs/overview/faq.mdx +2 -2
- package/docs/overview/quickstart.mdx +1 -1
- package/docs/overview/upgrading.mdx +8 -4
- package/docs/overview/what-is-testdriver.mdx +6 -6
- package/docs/quickstart.mdx +1 -1
- package/docs/scenarios/ai-chatbot.mdx +3 -3
- package/docs/scenarios/cookie-banner.mdx +2 -2
- package/docs/scenarios/file-upload.mdx +2 -2
- package/docs/scenarios/form-filling.mdx +3 -3
- package/docs/scenarios/log-in.mdx +3 -3
- package/docs/scenarios/pdf-generation.mdx +3 -3
- package/docs/scenarios/spell-check.mdx +2 -2
- package/docs/security/action.mdx +6 -6
- package/docs/security/agent.mdx +10 -10
- package/docs/security/platform.mdx +10 -8
- package/docs/snippets/test-prereqs.mdx +1 -1
- package/docs/snippets/yml-warning.mdx +1 -0
- package/docs/tutorials/advanced-test.mdx +9 -9
- package/docs/tutorials/basic-test.mdx +3 -3
- package/package.json +1 -1
- package/styles/config/vocabularies/Docs/accept.txt +32 -4
- package/docs/action/prerun.mdx +0 -137
|
@@ -5,7 +5,7 @@ sidebarTitle: "Basic Test"
|
|
|
5
5
|
icon: "test-tube"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# Basic
|
|
8
|
+
# Basic test tutorial
|
|
9
9
|
|
|
10
10
|
This tutorial will guide you through the process of creating and running a basic test using TestDriver.
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ Before you begin, ensure you have the following:
|
|
|
15
15
|
- TestDriver installed on your system.
|
|
16
16
|
- Basic understanding of how TestDriver works.
|
|
17
17
|
|
|
18
|
-
## Step 1: Create a
|
|
18
|
+
## Step 1: Create a test
|
|
19
19
|
|
|
20
20
|
To create a test, follow these steps:
|
|
21
21
|
1. Open your code editor.
|
|
@@ -28,7 +28,7 @@ Example:
|
|
|
28
28
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
## Step 2: Run the
|
|
31
|
+
## Step 2: Run the test
|
|
32
32
|
|
|
33
33
|
To run the test, use the following command:
|
|
34
34
|
```bash
|
package/package.json
CHANGED
|
@@ -1,19 +1,47 @@
|
|
|
1
1
|
testdriverai
|
|
2
|
+
TestDriver
|
|
2
3
|
(?i)npm
|
|
4
|
+
(?i)csv
|
|
3
5
|
Sonoma
|
|
4
6
|
[Pp]rerun
|
|
5
7
|
Protip
|
|
6
8
|
Protips
|
|
7
9
|
VS Code
|
|
8
10
|
VSIX
|
|
9
|
-
|
|
11
|
+
OAuth2?
|
|
10
12
|
Dashcam
|
|
11
13
|
VM[s]?
|
|
12
|
-
|
|
14
|
+
OCR
|
|
15
|
+
[Cc]hatbot|s
|
|
13
16
|
[Ss]electorless
|
|
14
17
|
[Ww]alkthrough
|
|
15
18
|
[Ss]ignup
|
|
16
|
-
(?i)PDF
|
|
19
|
+
(?i)PDF|s
|
|
17
20
|
Vercel
|
|
18
21
|
Netlify
|
|
19
|
-
[Jj]ira
|
|
22
|
+
[Jj]ira
|
|
23
|
+
RBAC
|
|
24
|
+
SSL
|
|
25
|
+
GitHub Action|s
|
|
26
|
+
GitHub
|
|
27
|
+
[Vv]iewport
|
|
28
|
+
TestRail
|
|
29
|
+
YAML
|
|
30
|
+
Gherkin
|
|
31
|
+
Arc Browser
|
|
32
|
+
Touchpoint
|
|
33
|
+
[Hh]ardcod|ed|ing
|
|
34
|
+
[Ff]ullscreen
|
|
35
|
+
AJAX
|
|
36
|
+
[Tt]eardown
|
|
37
|
+
validator
|
|
38
|
+
OTP[s]?
|
|
39
|
+
Reusability
|
|
40
|
+
[Aa]sync
|
|
41
|
+
XPath
|
|
42
|
+
[Aa]uto-heal|ed|ing
|
|
43
|
+
[Oo]nboarding
|
|
44
|
+
Webkit
|
|
45
|
+
[Rr]ollout
|
|
46
|
+
[Bb]ackend
|
|
47
|
+
Cleanshot
|
package/docs/action/prerun.mdx
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Prerun Scripts"
|
|
3
|
-
sidebarTitle: "Prerun Scripts"
|
|
4
|
-
description: "Learn how to customize and set up your TestDriver environment to optimize your CI/CD pipeline."
|
|
5
|
-
icon: "terminal"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
Prerun scripts are commands executed on a TestDriver virtual machine (VM) before each test in a CI/CD pipeline. They are used to prepare the environment by provisioning the VM, installing dependencies, configuring settings, or building the application. This ensures a consistent and reproducible environment for every test execution.
|
|
10
|
-
|
|
11
|
-
By using prerun scripts, you can:
|
|
12
|
-
- Speed up test setup.
|
|
13
|
-
- Prevent test failures caused by inconsistent environments.
|
|
14
|
-
- Promote reproducible builds for reliable test results.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Use Cases
|
|
19
|
-
Prerun scripts are ideal for:
|
|
20
|
-
- Installing necessary dependencies (e.g., browsers, libraries, or tools).
|
|
21
|
-
- Building your application or running setup scripts.
|
|
22
|
-
- Configuring the VM to match specific test requirements.
|
|
23
|
-
- Preparing staging environments or accessing private resources.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Example: Installing Arc Browser
|
|
28
|
-
The following example demonstrates how to use a prerun script to download and install the Arc Browser on a Windows VM before running tests.
|
|
29
|
-
|
|
30
|
-
```yaml
|
|
31
|
-
# permissions and other setup here
|
|
32
|
-
|
|
33
|
-
jobs:
|
|
34
|
-
test:
|
|
35
|
-
name: "TestDriver"
|
|
36
|
-
runs-on: ubuntu-latest
|
|
37
|
-
steps:
|
|
38
|
-
# Use the TestDriver GitHub Action
|
|
39
|
-
- uses: testdriverai/action@main
|
|
40
|
-
with:
|
|
41
|
-
prerun: |
|
|
42
|
-
# Get the IPv6 address of the VM
|
|
43
|
-
Get-NetIPAddress -AddressFamily IPv6
|
|
44
|
-
# URL for the Arc browser installer
|
|
45
|
-
$installerUrl = "https://releases.arc.net/windows/ArcInstaller.exe"
|
|
46
|
-
# Location to save the installer
|
|
47
|
-
$installerPath = "$env:USERPROFILE\Downloads\ArcInstaller.exe"
|
|
48
|
-
# Download the Arc browser installer
|
|
49
|
-
Write-Host "Downloading Arc browser installer..."
|
|
50
|
-
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath
|
|
51
|
-
# Check if the download was successful
|
|
52
|
-
if (Test-Path $installerPath) {
|
|
53
|
-
Write-Host "Download successful. Running the installer..."
|
|
54
|
-
Start-Process -FilePath $installerPath -ArgumentList '/silent' -Wait
|
|
55
|
-
Start-Sleep -Seconds 10
|
|
56
|
-
} else {
|
|
57
|
-
Write-Host "Failed to download the Arc browser installer."
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Example: Loading a Calculator App on Linux, Mac or Windows
|
|
62
|
-
```yaml
|
|
63
|
-
version: 5.5.5
|
|
64
|
-
session: 67f00511acbd9ccac373edf7
|
|
65
|
-
steps:
|
|
66
|
-
- prompt: launch a calculator
|
|
67
|
-
commands:
|
|
68
|
-
- command: exec
|
|
69
|
-
lang: shell
|
|
70
|
-
linux: |
|
|
71
|
-
linux: |
|
|
72
|
-
jumpapp /usr/bin/galculator > /dev/null 2>&1 &
|
|
73
|
-
exit
|
|
74
|
-
mac: |
|
|
75
|
-
open "/Applications/Calculator.app"
|
|
76
|
-
wait
|
|
77
|
-
windows:
|
|
78
|
-
start /B calc.exe
|
|
79
|
-
timeout /t 5
|
|
80
|
-
- command: wait-for-text
|
|
81
|
-
text: "galculator"
|
|
82
|
-
timeout: 30000
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Key Points
|
|
88
|
-
- **Provisioning**: Prerun scripts allow you to provision the VM with the necessary tools and configurations before running tests.
|
|
89
|
-
- **Reproducibility**: By ensuring a consistent environment, prerun scripts help prevent flaky tests caused by environmental differences.
|
|
90
|
-
- **Flexibility**: You can use prerun scripts to customize the VM for specific test scenarios, such as installing alternative browsers or setting up staging environments.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Best Practices
|
|
95
|
-
- **Keep It Simple**: Write clear and concise prerun scripts to minimize setup time and reduce complexity.
|
|
96
|
-
- **Error Handling**: Include checks to verify that dependencies are installed successfully. Log errors to help debug issues.
|
|
97
|
-
- **Optimize Performance**: Cache dependencies or use lightweight tools to speed up the setup process.
|
|
98
|
-
- **Security**: Avoid hardcoding sensitive information in prerun scripts. Use GitHub secrets to securely pass credentials or tokens.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## A Note on the Default Prerun Script
|
|
103
|
-
When setting up your TestDriver environment, a default prerun script is automatically generated. This script includes essential commands to ensure your VM is ready for testing. You can customize this script to suit your specific needs, but it's important to understand that it serves as a baseline for your test environment. It looks like this:
|
|
104
|
-
|
|
105
|
-
```yaml
|
|
106
|
-
version: 5.1.1
|
|
107
|
-
session: 67f00511acbd9ccac373edf7
|
|
108
|
-
steps:
|
|
109
|
-
- prompt: launch chrome
|
|
110
|
-
commands:
|
|
111
|
-
- command: exec
|
|
112
|
-
lang: shell
|
|
113
|
-
linux: |
|
|
114
|
-
jumpapp google-chrome --disable-fre --no-default-browser-check --no-first-run "${TD_WEBSITE}" &
|
|
115
|
-
exit
|
|
116
|
-
mac: |
|
|
117
|
-
open -na "Google Chrome" --args --disable-fre --no-default-browser-check --no-first-run --disable-features=PasswordManagerEnabled "${TD_WEBSITE}" &
|
|
118
|
-
exit
|
|
119
|
-
windows:
|
|
120
|
-
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "${TD_WEBSITE}"
|
|
121
|
-
exit
|
|
122
|
-
- command: wait-for-text
|
|
123
|
-
text: "Google Chrome"
|
|
124
|
-
timeout: 30000
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Take note that it defaults to launching the Chrome browser. If you want to use a different browser, you can modify the `prompt` and `commands` sections accordingly.
|
|
128
|
-
|
|
129
|
-
<Warning>
|
|
130
|
-
The `wait-For-text` command is crucial for ensuring that the browser is fully loaded before proceeding with the test steps. If you are testing a webapplication, you may want to adjust the `text` parameter to match the expected title or content of the page.
|
|
131
|
-
</Warning>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
## Notes
|
|
135
|
-
- Prerun scripts are executed on the VM before the test suite begins.
|
|
136
|
-
- They are essential for ensuring a consistent and reliable test environment.
|
|
137
|
-
- For advanced workflows, combine prerun scripts with TestDriver prompts to create dynamic and flexible test setups.
|