LogoLogo
  • Overview
    • Quickstart
    • FAQ
    • Overview
    • Pricing
    • Comparison
    • Discord
  • Pro Setup
    • Book a Demo
    • 30x30 Promotion
  • Guides
    • Generate a Test Suite
    • Local Agent Setup
    • Prompting
    • Getting an API Key
    • GitHub Actions
      • GitHub Action Setup
      • Prerun Scripts
      • Environment Config
      • Parallel Testing
      • Storing Secrets
      • Optimizing Performance
      • Action Output
      • Examples
        • Test Generation
        • Parallel Testing
        • Importing Tests
        • Desktop Apps
        • Secure Log In
    • Debugging Test Runs
    • Monitoring Performance
  • Reference
    • Test Steps
      • assert
      • exec
      • focus-application
      • hover-image
      • match-image
      • hover-text
      • if
      • press-keys
      • remember
      • run
      • scroll
      • scroll-until-image
      • scroll-until-text
      • type
      • wait
      • wait-for-image
      • wait-for-text
    • Interactive Commands
      • /assert
      • /undo
      • /save
      • /run
      • /generate
    • CLI
      • testdriverai init
      • testdriverai [file]
      • testdriverai run [file]
  • Security & Privacy
    • Agent
    • Action
    • Dashboard
  • FAQ
    • Screen Recording Permissions (Mac Only)
    • Status Page
Powered by GitBook
On this page
  • Installing the GitHub action
  • Get your API Key
  • Create your workflow
  • Output
  • How it works
  • Deploy the test

Was this helpful?

Export as PDF
  1. Guides
  2. GitHub Actions

GitHub Action Setup

PreviousGitHub ActionsNextPrerun Scripts

Last updated 1 month ago

Was this helpful?

Installing the GitHub action

TestDriver Cloud Testing is performed via . You can learn more by visiting the marketplace page.

Get your API Key

You'll need a paid account to use the TestDriver GitHub action

In order to execute your TestDriver actions on our VMs you'll need to add your API key as a GitHub secret. If you don't see an API key, you'll need ot upgrade your account.

Create your workflow

Now it's time to create your first TestDriver workflow.

In .github/workflows/testdriver.yml add the following code.

If you used testdriverai init to create your TestDriver project, these files will already be in your repository.

name: TestDriver.ai

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

on:
  pull_request: # run on every PR event
  schedule:
    - cron: '0 * * * *' # run every hour
  push:
    branches:
      - main # run on merge to the main branch
  workflow_dispatch:

jobs:
  test:
    name: "TestDriver"
    runs-on: ubuntu-latest
    steps:
      - uses: dashcamio/testdriver@main
        version: "v5.0.7"
        key: ${{secrets.TESTDRIVER_API_KEY}}
        os: linux
        with:
          prompt: |
            1. /run testdriver/testdriver.yaml
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FORCE_COLOR: "3"

Notice that on line 23 we're invoking the agent. In this case we're using the /run command to execute our file from our local directory.

You can also use commands like /explore, use variables, or supply your prompts dynamically from earlier steps. A common workflow is wait for staging to deploy before executing the test.

Output

See Action Output for output definitions and code samples.

How it works

  1. The GitHub action is triggered via the conditions supplied via on

  2. The key value is used to authenticate you

  3. An ephemeral virtual machine is spawn on our infrastructure

  4. The code from the current branch will be cloned on to the VM

  5. prompt is parsed as a markdown list.

  6. Each list item from promp is fed into TestDriver one by one

  7. TestDriver summarizes the test and sets it's exit code depending on it's pass or failed state

  8. The VM is destroyed and all data is wiped

Deploy the test

Save the file, make a new branch, push to your repository, and create a new pull request.

git checkout -b testdriver
git commit -am 'add testdriver github action'
git push origin testdriver
gh pr create --web

This will trigger a new TestDriver execution.

Log in the team page in and .

Paste the API key as a named TESTDRIVER_API_KEY

begins recording

If supplied, the

ends recording

copy your API key from there
new GitHub secret
Dashcam
prerun shell script runs
Dashcam
our GitHub action
TestDriver.ai - GitHub MarketplaceGitHub
Click here to install the GitHub action in your repository.
Logo