Skip to content

Fix docs #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/account/team.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ In the Team tab, you can manage your team name, team members, API key, and subsc
</Frame>

1. **Team Name**: The name of your team. This is used to identify your team in TestDriver.
2. **API Key**: Your API key is used to authenticate your requests to the TestDriver API. You can regenerate it if you suspect it has been compromised.
3. **Usage & Billing**: Monitor your usage and billing information. This includes your current plan, usage limits, and billing history.
2. **Personal API Key**: Your personal API key that you can use for creating the tests.
3. **Shared API Key**: Your shared API key that can be used for CI/CD workflows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so I made changes for the "user specific API key", like I added new image assets and all the other stuff, recently I saw we moved back, so I need to revert these 😕

4. **Usage & Billing**: Monitor your usage and billing information. This includes your current plan, usage limits, and billing history.
<Tip>Note: this button is where you 'Upgrade to Pro' to start your free trial.</Tip>
4. **Replay Visibility**: Toggle whether your replays are public or private by default. This defaults to **private**.
5. **Don't forget to save your changes!**: After making any changes, be sure to click the **Update** button to apply them.
5. **Replay Visibility**: Toggle whether your replays are public or private by default. This defaults to **private**.
6. **Don't forget to save your changes!**: After making any changes, be sure to click the **Update** button to apply them.

<Note>
The rotate icon next to the API key will generate a new key.
Only the administrators can rotate the CI/CD key.
</Note>

### Team members
<Frame caption="Team Members">
Expand Down
2 changes: 1 addition & 1 deletion docs/action/ami.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ icon: "image"
---

<Tip>
This guide is specifically for **Enterprise Plan customers** who have access
This guide is specifically for [Enterprise Plan customers](/account/enterprise) who have access
to the shared TestDriver AMI. If you are on a different plan, please contact
your account manager for more information.
</Tip>
Expand Down
34 changes: 26 additions & 8 deletions docs/action/performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,28 @@ Parallel testing allows you to split your test actions into multiple files and r
run multiple separate tests, use a test matrix strategy.
</Warning>

Example:
#### Example

```yaml
strategy:
matrix:
test_file:
- tests/login.yaml
- tests/search.yaml
- tests/cart.yaml
```yaml .github/workflows/testdriver.yaml focus={3-9, 14}
run tests:
name: Run tests in parallel
strategy:
matrix:
test_file:
- tests/login.yaml
- tests/search.yaml
- tests/cart.yaml
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run the tests
run: npx testdriverai@latest run testdriver/${{ matrix.test_file }}
env:
FORCE_COLOR: 3
TD_API_KEY: ${{ secrets.TD_API_KEY }}
TD_WEBSITE: https://testdriver-sandbox.vercel.app
TD_THIS_FILE: ${{ matrix.test }}
```

---
Expand All @@ -55,6 +68,11 @@ action: click
method: turbo
```

<Note>
`turbo` is the default method that is currently implemented. The other method being `ai`
</Note>


---

### 3. Use `async` asserts
Expand Down
42 changes: 12 additions & 30 deletions docs/action/secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ To securely use secrets in your TestDriver test files, replace hardcoded values

### Example test file

```yaml
version: 4.1.35
```yaml login.yaml highlight={11, 12, 21, 22}
version: 6.0.0
steps:
- prompt: sign in with username and password
commands:
Expand All @@ -48,6 +48,10 @@ steps:
action: click
- command: type
text: ${TD_PASSWORD}
- command: hover-text
text: Log In
description: log in button
action: click
```

---
Expand All @@ -69,41 +73,19 @@ For detailed instructions, refer to the [GitHub Docs on using secrets](https://d

When running TestDriver tests via the CLI in GitHub Actions, supply your secrets in the `env` section of the workflow step.

### Example workflow

```yaml .github/workflows/testdriver.yaml
name: TestDriver Test

permissions:
actions: read
contents: read
statuses: write
pull-requests: write

jobs:
test:
name: "TestDriver"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Run TestDriver
run: npx testdriverai@latest run tests/signin.yaml --headless
env:
TD_API_KEY: ${{ secrets.TD_API_KEY }}
TD_USERNAME: ${{ secrets.TD_USERNAME }}
TD_PASSWORD: ${{ secrets.TD_PASSWORD }}
```

---
<Card title="Adding secrets to CI" icon="link" href="/guide/authentication">
Check out our authentication page to see how to add secrets in your CI workflow.
</Card>

## Best practices

- **Use Descriptive Names**: Name your secrets clearly (for example, `TD_USERNAME`, `TD_PASSWORD`) to make them easy to identify.
- **Rotate Secrets Regularly**: Update your secrets periodically to enhance security.
- **Limit Access**: Only provide access to secrets for workflows and team members that require them.
- **Mask Secrets**: Ensure all secrets are masked in logs by using the `TD_` prefix.

<Note>
To ensure all secrets are masked in logs, use the `TD_` prefix.
</Note>
---

## Notes
Expand Down
120 changes: 0 additions & 120 deletions docs/action/setup.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apps/chrome-extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TestDriver can be used to test Chrome extensions. This guide provides an overvie
## How do I test Chrome extensions?
TestDriver provides a powerful solution for testing Chrome extensions. With our platform, you can easily create and run tests to ensure your extension functions as expected across different browsers and operating systems.
## Getting started
You can test a preinstalled extension or test by installing an extension. If the extension is in development mode, turn this on by checking the "Developer mode" checkbox in the Chrome extensions page. From there you can load the unpacked extension by selecting the folder where your extension is located. To download the files onto the VM if you are performing a test on cloud hosted runners, see the [Lifecycle](/guide/lifecycle-prerun) and [Prerun](/action/pre-post-scripts) docs.
You can test a preinstalled extension or test by installing an extension. If the extension is in development mode, turn this on by checking the "Developer mode" checkbox in the Chrome extensions page. From there you can load the unpacked extension by selecting the folder where your extension is located. To download the files onto the VM if you are performing a test on cloud hosted runners, see the [Lifecycle](/guide/lifecycle) docs.

## Sample test steps
1. Load a the Chrome Web Store.
Expand Down
19 changes: 11 additions & 8 deletions docs/apps/desktop-apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,29 @@ TestDriver supports a wide range of desktop applications, including:

## Installation

To use TestDriver with desktop applications, no special setup is needed. Simply run the local agent to interact with applications on your local machine, or add instructions to `prerun.yaml` to tell the runner to launch or install the application. Here is an example that performs a calculation on a calculator app:
To use TestDriver with desktop applications, no special setup is needed. Simply run the local agent to interact with applications on your local machine, or add instructions to `provision.yaml` to tell the runner to launch or install the application. Here is an example that performs a calculation on a calculator app:

```yaml
version: 5.5.5
```yaml testdriver/lifecycle/provision.yaml
version: 6.0.0
steps:
- prompt: launch a calculator
commands:
- command: exec
lang: pwsh
code: start /B calc.exe
code: |
start /B calc.exe
timeout /t 5
- command: wait-for-text
text: "calculator"
timeout: 30000
```

A `calculator_test.yaml` file might look like this:
A `calculator.yaml` file might look like this:

```yaml
version: 5.5.5
```yaml calculator.yaml
version: 6.0.0
steps:
- prompt: /try performing the operation 2 + 2 = on the calculator that is opened
- prompt: perform the operation 2 + 2 = on the calculator that is opened
commands:
- command: focus-application
name: galculator
Expand All @@ -83,6 +84,8 @@ steps:
- command: hover-image
description: equals button on the calculator
action: click
- command: assert
expected: 4 is displayed as the result
```

## Conclusion
Expand Down
14 changes: 7 additions & 7 deletions docs/apps/static-websites.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ To get started with testing static websites using TestDriver, follow these steps
1. [**Follow our quick start guide to set up your TestDriver account.**](/getting-started/setup)
2. **Create a new test project** in your TestDriver dashboard.
3. **Add your static website URL** to the test settings.
It looks like this in the `prerun.yaml` file:
It looks like this in the `provision.yaml` file:

```yaml
version: 5.1.1
```yaml testdriver/lifecycle/provision.yaml
version: 6.0.0
steps:
- prompt: launch chrome
commands:
- command: exec
lang: pwsh
code:
code: |
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "${TD_WEBSITE}"
exit
- command: wait-for-text
text: "Google Chrome"
text: $
timeout: 30000
```

Set the `TD_WEBSITE` environment variable to the URL of your static website. This will allow TestDriver to launch the browser and navigate to your website. You can do this by adding this `prerun.yaml` file to your project or by simply using:
Set the `TD_WEBSITE` environment variable to the URL of your static website. This will allow TestDriver to launch the browser and navigate to your website. You can do this by adding this `provision.yaml` file to your project or by simply using:

```bash
npx testdriverai@latest init
```

Running init will create the `prerun.yaml` file for you and ask you which website to load with your test.
Running init will create the `provision.yaml` file for you and ask you which website to load with your test.
Loading
Loading