Prompt
Google visual regression testing CI
Latest observation
Oct 27, 2026
OpenAI APIWeb search: off
If you want to add visual regression testing to a Google-based CI setup (for example using GitHub Actions + Playwright/Percy, or Cloud Build), the typical approach is:
Common options
1) Playwright screenshot diff
- Run your app in CI
- Capture screenshots of key pages/components
- Compare them against committed baselines
- Fail the build if diffs exceed a threshold
2) Percy / Chromatic / Applitools
- These services specialize in visual regression
- CI uploads screenshots
- The service compares against baseline and gives a visual diff UI
Example: Playwright in CI
name: visual-regression
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build
- run: npm run start &
- run: npx playwright test
Example Playwright test
import { test, expect } from '@playwright/test';
test('homepage visual', async ({ page }) => {
await page.goto('http://localhost:3000');
await expect(page).toHaveScreenshot('homepage.png');
});
Best practices
- Stabilize fonts and animations
- Use fixed viewport sizes
- Mock dynamic data/time
- Run on the same OS/browser in CI
- Review diffs before updating baselines
If you mean Google Cloud Build
You can do the same thing in a cloudbuild.yaml:
steps:
- name: node:20
entrypoint: bash
args:
- -c
- |
npm ci
npm run build
npm test
If you want, I can give you:
- a GitHub Actions + Playwright setup,
- a Percy integration, or
- a Google Cloud Build example.