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

Desktop Apps

Download a software installer and run it in a prerun script

This workflow's prerun script downloads an installer, then installs the software before running the tests

This workflow:

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

  • Downloads an installer from the provided URL

  • Runs the installer and install the software

  • Run the provided test

    • Functionalities like 'automatic test matrix population' can be added to this workflow

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:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: testdriverai/action@main
        with:
          key: ${{ secrets.TESTDRIVER_API_KEY }}
          prompt: |
            1. /run testdriver/test.yml
          prerun: |
            # Check IPv6 addresses (optional)
            Get-NetIPAddress -AddressFamily IPv6

            # URL for the installer
            $installerUrl = "https://example.com/windows/ExampleInstaller.exe"
            # Location to save the installer
            $installerPath = "$env:USERPROFILE\Downloads\ExampleInstaller.exe"

            # Download the installer
            Write-Host "Downloading installer..."
            Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath

            # Check if the download was successful
            if (Test-Path $installerPath) {
                Write-Host "Download successful. Running the installer..."
                Start-Process -FilePath $installerPath -ArgumentList '/silent' -Wait
                Start-Sleep -Seconds 10
            } else {
                Write-Host "Failed to download the 
                
                installer."
            }

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          FORCE_COLOR: "3"
PreviousImporting TestsNextSecure Log In

Last updated 1 month ago

Was this helpful?