Documentation
Integrations

CI/CD Integration

Integrate AegisRunner with your CI/CD pipeline for automated testing on every deployment.

CI/CD Integration

Integrate AegisRunner into your continuous integration and deployment pipelines to automatically run tests on every code change or deployment.

Availability: API access for CI/CD integration is available on Pro ($29/mo) and Business ($59/mo) plans.

Integration Options

šŸ”Œ
REST API
Trigger test runs programmatically via API
šŸ“¤
Playwright Export
Export tests and run in your own CI
šŸŖ
Webhooks
Receive notifications on test completion

API-Based Integration

Trigger test runs from your CI/CD pipeline using the AegisRunner API.

Get Your API Key

  1. Go to Settings → Security
  2. Scroll to API Keys
  3. Click Generate API Key
  4. Copy and securely store the key
Security: Store API keys as secrets in your CI/CD platform. Never commit them to version control.

Trigger a Test Run

# Trigger a test run via API
curl -X POST https://api.aegisrunner.com/v1/runs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "suite_id": "suite_abc123",
    "browser": "chromium"
  }'

Check Run Status

# Get run status
curl https://api.aegisrunner.com/v1/runs/run_xyz789 \
  -H "Authorization: Bearer YOUR_API_KEY"

Wait for Completion

# Poll for completion (example bash script)
while true; do
  STATUS=$(curl -s https://api.aegisrunner.com/v1/runs/$RUN_ID \
    -H "Authorization: Bearer $API_KEY" | jq -r '.status')
  
  if [ "$STATUS" = "passed" ]; then
    echo "Tests passed!"
    exit 0
  elif [ "$STATUS" = "failed" ]; then
    echo "Tests failed!"
    exit 1
  fi
  
  sleep 10
done

GitHub Actions Example

name: E2E Tests

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  e2e-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger AegisRunner Tests
        id: trigger
        run: |
          RESPONSE=$(curl -s -X POST https://api.aegisrunner.com/v1/runs \
            -H "Authorization: Bearer ${{ secrets.AEGISRUNNER_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"suite_id": "${{ secrets.TEST_SUITE_ID }}", "browser": "chromium"}')
          RUN_ID=$(echo $RESPONSE | jq -r '.id')
          echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT

      - name: Wait for Results
        run: |
          for i in {1..60}; do
            STATUS=$(curl -s https://api.aegisrunner.com/v1/runs/${{ steps.trigger.outputs.run_id }} \
              -H "Authorization: Bearer ${{ secrets.AEGISRUNNER_API_KEY }}" | jq -r '.status')
            
            if [ "$STATUS" = "passed" ]; then
              echo "āœ… Tests passed!"
              exit 0
            elif [ "$STATUS" = "failed" ]; then
              echo "āŒ Tests failed!"
              exit 1
            fi
            
            echo "Status: $STATUS - waiting..."
            sleep 10
          done
          echo "Timeout waiting for tests"
          exit 1

GitLab CI Example

e2e_tests:
  stage: test
  script:
    - |
      RUN_ID=$(curl -s -X POST https://api.aegisrunner.com/v1/runs \
        -H "Authorization: Bearer $AEGISRUNNER_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{"suite_id": "'"$TEST_SUITE_ID"'", "browser": "chromium"}' | jq -r '.id')
      
      for i in $(seq 1 60); do
        STATUS=$(curl -s https://api.aegisrunner.com/v1/runs/$RUN_ID \
          -H "Authorization: Bearer $AEGISRUNNER_API_KEY" | jq -r '.status')
        
        if [ "$STATUS" = "passed" ]; then
          echo "Tests passed!"
          exit 0
        elif [ "$STATUS" = "failed" ]; then
          echo "Tests failed!"
          exit 1
        fi
        
        sleep 10
      done
  variables:
    AEGISRUNNER_API_KEY: $AEGISRUNNER_API_KEY
    TEST_SUITE_ID: $TEST_SUITE_ID

Jenkins Pipeline Example

pipeline {
    agent any
    
    environment {
        AEGISRUNNER_API_KEY = credentials('aegisrunner-api-key')
        TEST_SUITE_ID = 'suite_abc123'
    }
    
    stages {
        stage('E2E Tests') {
            steps {
                script {
                    def response = sh(
                        script: """
                            curl -s -X POST https://api.aegisrunner.com/v1/runs \
                                -H "Authorization: Bearer ${AEGISRUNNER_API_KEY}" \
                                -H "Content-Type: application/json" \
                                -d '{"suite_id": "${TEST_SUITE_ID}", "browser": "chromium"}'
                        """,
                        returnStdout: true
                    )
                    def runId = readJSON(text: response).id
                    
                    timeout(time: 10, unit: 'MINUTES') {
                        waitUntil {
                            def status = sh(
                                script: """
                                    curl -s https://api.aegisrunner.com/v1/runs/${runId} \
                                        -H "Authorization: Bearer ${AEGISRUNNER_API_KEY}" \
                                        | jq -r '.status'
                                """,
                                returnStdout: true
                            ).trim()
                            
                            if (status == 'passed') {
                                return true
                            } else if (status == 'failed') {
                                error 'Tests failed'
                            }
                            
                            sleep 10
                            return false
                        }
                    }
                }
            }
        }
    }
}

Playwright Export Integration

Alternatively, export your tests and run them directly in your CI environment:

1
Export Tests

Click Export Playwright on your test suites.

2
Add to Repository

Commit the exported test files to your repo.

3
Run in CI

Use standard Playwright commands in your pipeline.

# Example CI step for exported tests
- name: Run Playwright Tests
  run: |
    npm ci
    npx playwright install --with-deps
    npx playwright test

Best Practices

CI/CD Tips:
  • Run smoke tests on every PR, full regression on merge to main
  • Set appropriate timeouts for test completion
  • Use parallel browser testing for faster feedback
  • Store API keys securely as CI/CD secrets
  • Fail the build on test failures to catch issues early
  • Consider running tests against preview/staging environments

Related Documentation

Need help?

Can't find what you're looking for? Our support team is here to help.