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
  • Prerun files
  • Testing multiple browsers and operating systems

Was this helpful?

Export as PDF
  1. Guides
  2. GitHub Actions

Environment Config

How to change the operating system platform.

PreviousPrerun ScriptsNextParallel Testing

Last updated 1 month ago

Was this helpful?

To configure the operating system, simply supply the os param to the GitHub action. The current available operating systems are windows and mac.

Mac execution is only available to Enterprise customers.

Key
Version
Instance Type
Architecture

windows

Windows Server 2022 Base 10

t2.large

64-bit (x86)

mac

MacOS Sanoma

mac1.metal

x86_64_mac

Prerun files

Note that prerun files are executed on these machines themselves. You must use powershell on Windows and bash on mac.

Testing multiple browsers and operating systems

The following example will run the same test using 4 different configurations by utilizing .

name: Test action

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

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
  test-action:
    name: Test action
    runs-on: ubuntu-latest
    strategy:
      matrix:
        os: [windows, mac]
        browser: [chrome, firefox]
    steps:
      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Install Dashcam Chrome
        run: |
          npm init -y
          npm install dashcam-chrome

      - uses: replayableio/testdriver-action@main
        with:
          prompt: |
            1. open youtube
            2. find a cat video
            3. quit the browser
            4. /summarize
          os: ${{ matrix.os }}
          prerun: |
            if [ "${{ matrix.browser }}" == "chrome" ]; then
              if [ "${{ matrix.os }}" == "windows" ]; then
                # Install Google Chrome on Windows
                $ProgressPreference = 'SilentlyContinue'
                Invoke-WebRequest -Uri "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile "$env:TEMP\chrome_installer.exe"
                Start-Process -FilePath "$env:TEMP\chrome_installer.exe" -ArgumentList "/silent", "/install" -Wait
              else
                # Install Google Chrome on macOS
                brew install --cask google-chrome
              fi
            else
              if [ "${{ matrix.os }}" == "windows" ]; then
                # Install Firefox on Windows
                $ProgressPreference = 'SilentlyContinue'
                Invoke-WebRequest -Uri "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US" -OutFile "$env:TEMP\firefox_installer.exe"
                Start-Process -FilePath "$env:TEMP\firefox_installer.exe" -ArgumentList "/S" -Wait
              else
                # Install Firefox on macOS
                brew install --cask firefox
              fi
            fi
            if [ "${{ matrix.browser }}" == "chrome" ]; then
              if [ "${{ matrix.os }}" == "windows" ]; then
                Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized","--load-extension=$(pwd)/node_modules/dashcam-chrome/build" &
              else
                /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --start-maximized --load-extension=$(pwd)/node_modules/dashcam-chrome/build &
              fi
            else
              if [ "${{ matrix.os }}" == "windows" ]; then
                Start-Process "C:/Program Files/Mozilla Firefox/firefox.exe" -ArgumentList "--start-maximized" &
              else
                /Applications/Firefox.app/Contents/MacOS/firefox --start-maximized &
              fi
            fi
          key: ${{ secrets.TESTDRIVER_API_KEY }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FORCE_COLOR: "3"
the GitHub matrix strategy