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
@@ -1,120 +0,0 @@
1
- ---
2
- title: "CI Setup Guide"
3
- sidebarTitle: "CI Setup"
4
- description: "Learn how to set up and configure TestDriver CLI for automated cloud-based testing in your CI workflows."
5
- icon: "square-terminal"
6
- ---
7
-
8
- ## Overview
9
-
10
- TestDriver enables cloud-based testing using TestDriver's infrastructure directly through the CLI. This guide will walk you through the steps to configure TestDriver for GitHub actions, but the principles apply to other CI/CD platforms as well.
11
-
12
- ---
13
-
14
- ## Step 1: Get Your API key
15
-
16
- To execute TestDriver actions on our virtual machines, you'll need an API key. Follow these steps to retrieve and configure your API key:
17
-
18
- 1. **Upgrade Your Account**: Ensure you have a paid TestDriver account.
19
- 2. **Log In**: Go to the **Team Page** in your TestDriver dashboard.
20
- 3. **Copy Your API Key**: Locate and copy your API key.
21
- 4. **Add the API Key as a GitHub Secret**:
22
-
23
- - Navigate to your repository settings in GitHub.
24
- - Add a new secret named `TD_API_KEY` and paste your API key.
25
-
26
- ---
27
-
28
- ## Step 2: Create your workflow
29
-
30
- Now it's time to create your first TestDriver workflow. Add the following configuration to `.github/workflows/testdriver.yaml`:
31
-
32
- ```yaml
33
- name: TestDriver
34
-
35
- permissions:
36
- actions: read
37
- contents: read
38
- statuses: write
39
- pull-requests: write
40
-
41
- on:
42
- pull_request: # Run on every pull request event
43
- schedule:
44
- - cron: "0 * * * *" # Run every hour
45
- push:
46
- branches:
47
- - main # Run on merge to the main branch
48
- workflow_dispatch: # Manual trigger
49
-
50
- jobs:
51
- test:
52
- name: "TestDriver"
53
- runs-on: ubuntu-latest
54
- steps:
55
- - name: Checkout code
56
- uses: actions/checkout@v4
57
-
58
- - name: Run TestDriver tests
59
- run: npx testdriverai@latset run testdriver/testdriver.yaml
60
- env:
61
- TD_API_KEY: ${{ secrets.TD_API_KEY }}
62
- FORCE_COLOR: "3"
63
- ```
64
-
65
- ### Key points:
66
-
67
- - **Trigger Conditions**: The `on` section defines when the workflow runs (for example, pull requests, scheduled events, or manual triggers).
68
- - **API Key**: The `TD_API_KEY` environment variable uses the secret for authentication.
69
- - **Test Execution**: TestDriver is called directly with your test commands.
70
-
71
- ---
72
-
73
- ## Step 3: Deploy the workflow
74
-
75
- Save the workflow file, create a new branch, and push it to your repository. Then, create a pull request to trigger the workflow.
76
-
77
- ```bash
78
- git checkout -b testdriver
79
- git commit -am 'Add TestDriver workflow'
80
- git push origin testdriver
81
- gh pr create --web
82
- ```
83
-
84
- ---
85
-
86
- ## How it works
87
-
88
- 1. **Trigger**: The GitHub workflow is triggered based on the conditions defined in the `on` section.
89
- 2. **Code Checkout**: The current branch's code is checked out in the GitHub runner.
90
- 3. **CLI Installation**: The TestDriver CLI is installed globally using npm.
91
- 4. **Authentication**: The `TD_API_KEY` environment variable authenticates your account.
92
- 5. **VM Setup**: An ephemeral virtual machine is spawned on TestDriver's infrastructure.
93
- 6. **Code Cloning**: The current branch's code is cloned onto the VM.
94
- 7. **Dashcam Recording**: Dashcam begins recording the test execution.
95
- 8. **Test Execution**: The TestDriver CLI executes your commands on the cloud VM.
96
- 9. **Test Summary**: TestDriver summarizes the test and sets the exit code based on the pass or fail state.
97
- 10. **Cleanup**: The VM is destroyed, and all data is wiped.
98
-
99
- ---
100
-
101
- ## Additional features
102
-
103
- - **Multiple Commands**: You can run multiple TestDriver commands in sequence within your workflow.
104
- - **Environment Variables**: Pass custom environment variables to your tests.
105
- - **Staging Workflows**: A common workflow involves waiting for staging to deploy before executing tests.
106
-
107
- ---
108
-
109
- ## Output
110
-
111
- For details on interpreting the output of TestDriver, refer to the [CLI Output Documentation](../cli/overview).
112
-
113
- ---
114
-
115
- ## Notes
116
-
117
- - TestDriver CLI provides a simple and direct way to run cloud-based testing in your CI/CD pipelines.
118
- - Ensure your API key is securely stored as a GitHub secret.
119
- - The CLI automatically handles authentication and cloud VM provisioning when the `TD_API_KEY` is provided.
120
- - For advanced workflows, consider using multiple TestDriver commands or custom environment variables.
@@ -1,65 +0,0 @@
1
- ---
2
- title: "/assert"
3
- sidebarTitle: "/assert"
4
- description: "Use the /assert command to ensure specific conditions are met in your tests."
5
- icon: "clipboard-check"
6
- ---
7
-
8
- # Command: `/assert`
9
-
10
- ## Description
11
-
12
- The `/assert` command ensures that a specific condition is true within your test. This is useful for verifying that tasks were completed successfully, just as a user would observe.
13
-
14
- ## Usage
15
-
16
- ```bash
17
- /assert <criteria>
18
- ```
19
-
20
- ## Behavior
21
-
22
- - The `/assert` command generates an assertion based on the specified criteria.
23
- - TestDriver takes a screenshot and uses it to verify that the condition described in the `expect` field is true.
24
- - If the condition isn't met, the test will fail and exit immediately.
25
-
26
- ## Example usage
27
-
28
- ### Basic assertion
29
-
30
- ```bash
31
- /assert No error message is displayed
32
- ```
33
-
34
- This generates the following command:
35
-
36
- ```yaml
37
- - command: assert
38
- expect: There is no error message
39
- ```
40
-
41
- ### Asynchronous assertion
42
-
43
- To speed up tests, use `async: true` to allow the test to continue without waiting for the assertion to pass:
44
-
45
- ```yaml
46
- - command: assert
47
- expect: There is no error message
48
- async: true
49
- ```
50
-
51
- ## Protips
52
-
53
- - Use assertions sparingly to avoid slowing down your tests.
54
- - Combine `async: true` with assertions to improve test performance while still validating critical conditions.
55
- - Ensure the `expect` field clearly describes the condition to avoid ambiguity.
56
-
57
- ## Gotchas
58
-
59
- - If the condition in `expect` isn't met, the test will fail and exit immediately.
60
- - Overusing assertions can make tests slower and harder to maintain.
61
-
62
- ## Notes
63
-
64
- - The `/assert` command is ideal for validating key checkpoints in your test workflow.
65
- - Use this command to ensure that critical tasks, such as error-free execution or successful navigation, are completed as expected.
@@ -1,58 +0,0 @@
1
- ---
2
- title: "/dry"
3
- sidebarTitle: "/dry"
4
- description: "See and write a test file without running the commands."
5
- icon: "forward-step"
6
- ---
7
-
8
- ## Description
9
-
10
- The `/dry` command is used to create a test file and write to a specified file. This command won't run steps it creates. It's a **dry** run.
11
-
12
- ## Usage
13
-
14
- ```bash
15
- /dry <file>
16
- ```
17
-
18
- ## Example usage
19
-
20
- ```bash
21
- npx testdriverai@latest <filename.yaml>
22
- > /dry click the 'log in' button
23
- ```
24
-
25
- This command generates the steps to `click the 'log in' button` with an explanation and adds them to the current test file, without executing any command.
26
-
27
- ## Behavior
28
-
29
- - TestDriver will create steps for the test file, writing them in the file.
30
- - TestDriver will also show the reasoning and test steps in the CLI:
31
-
32
- ```bash
33
- thinking...
34
-
35
- To click the 'log in' button, we need to identify and
36
- click on the text "Log in" visible in the screenshot.
37
- Here's how to accomplish this:
38
-
39
- commands:
40
- - command: hover-text
41
- text: Log in
42
- description: log in button in the code editor
43
- action: click
44
-
45
- ### Explanation:
46
-
47
- 1. Click the 'Log in' Button: We use hover-text to locate and click on the "Log in" text visible in the code editor. This ensures the button is activated.
48
- ```
49
-
50
- ## Protips
51
-
52
- - Ensure you run the `testdriverai` command with a valid file path before using `/dry`.
53
- - Use descriptive filenames for your test files to make them easier to identify.
54
- - Combine `/dry` with `/undo` to write test files without executing them.
55
-
56
- ## Notes
57
-
58
- - The `/dry` command is ideal for writing out a series of steps before executing.
@@ -1,55 +0,0 @@
1
- ---
2
- title: "/generate"
3
- sidebarTitle: "/generate"
4
- description: "Use the /generate command to create exploratory test cases automatically."
5
- icon: "wand-sparkles"
6
- ---
7
-
8
- # Command: `/generate`
9
-
10
- ## Description
11
-
12
- The `/generate` command is an experimental feature that instructs TestDriver to create its own exploratory prompts. This command is used in the "Generate a Test Suite" demo and is designed to help automate the creation of exploratory test cases.
13
-
14
- ## Usage
15
-
16
- ```bash
17
- /generate
18
- ```
19
-
20
- ## Behavior
21
-
22
- - The `/generate` command analyzes the display and generates exploratory prompts for testing.
23
- - Each exploratory test is saved as a simple Markdown file containing a list of steps.
24
- - TestDriver generates 10 Markdown files every time the `/generate` command is called.
25
- - The generated files are stored in the `./testdriver/generate/*.md` directory.
26
-
27
- ## Example output
28
-
29
- Here's an example of a generated test file (`test-search-function.md`):
30
-
31
- ```markdown
32
- 1. Click on the search icon.
33
- 2. Type "real-time chat" into the search bar.
34
- 3. Assert that search results are relevant and displayed.
35
- ```
36
-
37
- ## Protips
38
-
39
- - Use `/generate` to quickly create exploratory tests for regression testing or feature validation.
40
- - Combine `/generate` with the GitHub Action to generate and run regression tests in parallel.
41
- - Review the generated Markdown files and convert them into YAML test scripts for reuse.
42
-
43
- ## Gotchas
44
-
45
- - The `/generate` command is experimental and may not always produce perfect test cases. Review and refine the generated tests as needed.
46
- - Ensure the `./testdriver/generate/` directory exists and has write permissions.
47
-
48
- ## Notes
49
-
50
- - The `/generate` command is ideal for automating the creation of exploratory test cases and generating regression tests.
51
- - Generated tests can be merged into a regression test suite for continuous testing and validation.
52
-
53
- ```
54
-
55
- ```
@@ -1,58 +0,0 @@
1
- ---
2
- title: "/undo"
3
- sidebarTitle: "/undo"
4
- description: "Remove the last generated command or step from the current test script."
5
- icon: "arrow-rotate-left"
6
- ---
7
-
8
- ## Description
9
-
10
- The `/undo` command removes the last generated command or step from the current test script. This is useful for quickly correcting mistakes or removing unintended actions during an interactive session.
11
-
12
- ## Usage
13
-
14
- ```bash
15
- /undo
16
- ```
17
-
18
- ## Behavior
19
-
20
- - The `/undo` command removes the most recently added command or step from the test script.
21
- - You can call `/undo` multiple times to remove multiple commands or steps.
22
-
23
- ## Example usage
24
-
25
- ### Before `/undo`
26
-
27
- ```yaml
28
- - step:
29
- - command: scroll-until-text
30
- text: Add to cart
31
- - step:
32
- - command: hover-text
33
- text: Add to cart
34
- action: click
35
- ```
36
-
37
- ### After `/undo`
38
-
39
- ```yaml
40
- - step:
41
- - command: scroll-until-text
42
- text: Add to cart
43
- ```
44
-
45
- ## Protips
46
-
47
- - Use `/undo` immediately after generating a command to quickly fix mistakes or refine your test script.
48
- - Combine `/undo` with `/save` to iteratively build and refine your test scripts.
49
-
50
- ## Gotchas
51
-
52
- - The `/undo` command only removes the last generated command or step. If you need to undo multiple actions, call `/undo` repeatedly.
53
- - Once a session is closed, you can't undo previously saved commands.
54
-
55
- ## Notes
56
-
57
- - The `/undo` command is ideal for interactive sessions where you are experimenting with test generation.
58
- - This command helps maintain a clean and accurate test script by allowing quick corrections.
@@ -1 +0,0 @@
1
- <div id="discourse-comments"></div>
@@ -1,5 +0,0 @@
1
- <iframe
2
- src="https://app.dashcam.io/replay/6866b262409e098717b0151f?share=dZG9aaVeNpIcA1CzcotuQ&embed=true&timestamp=90000&playbackRate=5"
3
- width="100%"
4
- height="300"
5
- />
@@ -1,10 +0,0 @@
1
- ```yaml
2
- version: 5.7.7
3
- session: 682f5aab811bd5a322c0e5a1
4
- steps:
5
- - prompt: enter a valid username, password, and sign in
6
- - prompt: assert
7
- commands:
8
- - command: assert
9
- expect: the testdriver sandbox is visible
10
- ```
@@ -1,4 +0,0 @@
1
- <Warning>
2
- TestDriver v5 uses the `.yaml` file extension for all test files. This is a
3
- breaking change from v4 which uses the `.yml` extension!
4
- </Warning>