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

Was this helpful?

Export as PDF
  1. Guides
  2. GitHub Actions
  3. Examples

Parallel Testing

Test multiple URLs in parallel

This workflow uses parallel testing to test several URLs in a short amount of time

This workflow:

  • Runs on each push to the "main" branch & every day at midnight

  • Defines a matrix of tests to be ran on individual, non-sequential, ephemeral VMs

  • Runs the matrix of tests

    • Each test in the matrix will have Dashcam installed, and Chrome opened to the respective URL defined in the URL value in the matrix

name: TestDriver.ai

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

on:
  push:
    branches: ["main"]
  pull_request:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

jobs:
  testdriver_matrix:
    name: "TestDriver Matrix"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        test:
          - name: "Functions testdriver"
            file: "testdriver/functions.yml"
            url: "https://example.com"
          - name: "Chat testdriver"
            file: "testdriver/chat_test.yml"
            url: "https://www.exmaple.com/demos/chat/"
          - name: "P2P dynamic payment testdriver"
            file: "testdriver/p2p_dynamic_payment.yml"
            url: "https://www.exmaple.com/demos/fintech/"
          - name: "Dynamic matchmaking testdriver"
            file: "testdriver/skill_based_matchmaking.yml"
            url: "https://www.example.com/demos/skill-based-matchmaking-dashboard/"
          - name: "Support search testdriver"
            file: "testdriver/support_search.yml"
            url: "https://support.example.com/hc/en-us"
          - name: "Ask AI testdriver"
            file: "testdriver/ask_ai.yml"
            url: "https://www.example.com"
          - name: "Edit settings testdriver"
            file: "testdriver/edit_account_settings.yml"
            url: "https://www.example.com"
          - name: "Debug console testdriver"
            file: "testdriver/debug_console.yml"
            url: "https://www.example.com"
    steps:
      - uses: testdriverai/action@main
        with:
          key: ${{ secrets.TESTDRIVER_API_KEY }}
          prompt: |
            1. /run ${{ matrix.test.file }}
          prerun: |
            cd $env:TEMP
            npm init -y
            npm install dashcam-chrome
            Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "${{ matrix.test.url }}"
            exit
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FORCE_COLOR: "3"
PreviousTest GenerationNextImporting Tests

Last updated 1 month ago

Was this helpful?