Visual testing in every GitHub Actions workflow
Catch UI regressions on every pull request with automated screenshots
Add screenshot capture to your GitHub Actions CI/CD pipeline. Automatically capture screenshots of preview deployments on every PR, compare them against baselines, and catch visual regressions before they reach production.
Add workflow file
Create a .github/workflows/screenshots.yml file in your repository.
Store your API key
Add your Allscreenshots API key as a GitHub repository secret.
Capture on PR
Use curl in a workflow step to capture screenshots of your preview deployment.
Upload as artifacts
Store screenshots as GitHub Actions artifacts for review and comparison.
1name: Visual Regression Tests
2on:
3 pull_request:
4 branches: [main]
5
6jobs:
7 screenshots:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v4
11
12 - name: Capture Screenshots
13 run: |
14 curl -X POST 'https://api.allscreenshots.com/v1/screenshot' \
15 -H 'Authorization: Bearer ${{ secrets.SCREENSHOT_API_KEY }}' \
16 -H 'Content-Type: application/json' \
17 -d '{
18 "url": "https://preview-${{ github.event.number }}.yourapp.com",
19 "fullPage": true,
20 "viewport": { "width": 1920, "height": 1080 }
21 }' -o screenshot.png
22
23 - name: Upload Screenshot
24 uses: actions/upload-artifact@v4
25 with:
26 name: screenshots
27 path: screenshot.pngNo browser setup
Skip installing Puppeteer or Playwright in your CI. One API call captures any page.
Fast and reliable
Screenshots are captured on Allscreenshots' infrastructure, not your CI runner. No flaky browser tests.
PR-level visibility
Attach screenshots as artifacts to every PR for easy visual review.