playwright-visual-regression
Skill3 starsChanged 48 days agoApache-2.0View on GitHub
Implements automated visual regression testing, pixelmatch snapshot diffing, cross-browser viewport matrices, dynamic element masking, and containerized baseline stability using Playwright.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ella79/agentic-playwright-suitetheir own version, first seen Oct 8, 2026
- FutureAtoms/claude-skills-backuptheir own version, first seen Mar 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ella79/agentic-playwright-suite★ 10same name
- FutureAtoms/claude-skills-backup★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository117 other files it gives its agents.
- AGENTS.mdAGENTS.md
- everything-gemini-maintainerSkill
- adversarial-fuzz-generatorSkill
- agency-boardroomSkill
- agency-design-systemSkill
- agency-growth-engineSkill
- agency-sprint-runnerSkill
- agent-evalsSkill
- agent-ui-micro-componentsSkill
- ai-first-engineeringSkill
- alloydb-omni-vectorSkill
- apache-kafka-streamsSkill
- api-craftsmanSkill
- architecture-designerSkill
- argon-3d-game-engineSkill
- argon-3d-scene-architectSkill
- argon-procedural-asset-generatorSkill
- argon-visual-critique-loopSkill
- argo-workflowsSkill
- astryx-agent-design-systemSkill
- autonomous-incident-healerSkill
- axum-web-serviceSkill
- bigquery-vector-searchSkill
- browser-qa-testerSkill
- chromadb-vector-storeSkill
- cilium-ebpf-networkingSkill
- clickhouse-analyticsSkill
- cloud-deploy-canarySkill
- cloudflare-r2-object-storageSkill
- cloudflare-workersSkill
- cloud-run-agentsSkill
- context-cachingSkill
- context-distillation-compressorSkill
- context-warmerSkill
- continuous-learningSkill
- cost-oracle-finopsSkill
- cross-repo-swarm-syncSkill
- cve-remediation-orchestratorSkill
- database-architectSkill
- dataproc-spark-analyticsSkill
- dbt-transformationSkill
- debezium-cdcSkill
- devops-pipelineSkill
- distributed-rate-limitingSkill
- docker-compose-orchestratorSkill
- duckdb-local-olapSkill
- dynamic-thinking-allocationSkill
- ebpf-microvm-sandboxSkill
- ebpf-sandbox-enforcerSkill
- elephant-goldfish-modelSkill
- envoy-ai-gatewaySkill
- ephemeral-swarm-orchestratorSkill
- fastapi-productionSkill
- fullstack-nextjsSkill
- game-audio-synthesizerSkill
- game-studioSkill
- gemini-function-callingSkill
- gemini-groundingSkill
- gemini-live-audio-transcriberSkill
- gemini-live-multimodalSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Deterministic Environment: Always generate reference snapshots inside the same containerized Linux environment …
- Distinctive: line 17
Wait for Font & Network Idle: Ensure web fonts and critical API payloads are loaded before capturing snapshots.
- Very specific: line 18
Strict Diff Thresholds: Use maxDiffPixelRatio: 0.01 (1% tolerance) to balance anti-aliasing tolerance against regression detection.
- Distinctive: line 101
Run snapshots inside the official Playwright Docker container to prevent cross-platform font rendering diffs:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playwright Visual Regression Testing & Snapshot Diffing
This skill provides production standards for catching unintended UI regressions, CSS layout shifts, and visual anomalies across viewports using Playwright's native screenshot comparison engine.
⚡ The Golden Rules of Visual Testing
- Deterministic Environment: Always generate reference snapshots inside the same containerized Linux environment (
mcr.microsoft.com/playwright) to avoid font rendering divergence between macOS and CI runners. - Mask Dynamic Elements: Mask timestamps, avatars, animations, and non-deterministic text using Playwright's
maskoption. - Wait for Font & Network Idle: Ensure web fonts and critical API payloads are loaded before capturing snapshots.
- Strict Diff Thresholds: Use
maxDiffPixelRatio: 0.01(1% tolerance) to balance anti-aliasing tolerance against regression detection.
🏗️ Production Playwright Configuration (playwright.config.ts)
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/visual',
snapshotPathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}',
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.01,
animations: 'disabled',
threshold: 0.2, // Pixel color sensitivity (0.0 to 1.0)
},
},
use: {
baseURL: process.env.BASE_URL || 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'Desktop Chrome',
use: { ...devices['Desktop Chrome'], viewport: { width: 1440, height: 900 } },
},
{
name: 'Mobile Safari',
use: { ...devices['iPhone 14'], viewport: { width: 390, height: 844 } },
},
{
name: 'Tablet iPad',
use: { ...devices['iPad Pro 11'], viewport: { width: 834, height: 1194 } },
},
],
});🧪 Visual Test Implementation (tests/visual/dashboard.spec.ts)
import { test, expect } from '@playwright/test';
test.describe('Dashboard Visual Regression Suite', () => {
test.beforeEach(async ({ page }) => {
// Navigate and stabilize network
await page.goto('/dashboard', { waitUntil: 'networkidle' });
// Wait for custom web fonts to be completely rendered
await page.evaluate(() => document.fonts.ready);
});
test('full dashboard page layout matches baseline', async ({ page }) => {
// Dynamic locators that vary between test runs
const dynamicTimestamp = page.locator('[data-testid="last-sync-time"]');
const userAvatar = page.locator('[data-testid="user-avatar"]');
await expect(page).toHaveScreenshot('dashboard-main-view.png', {
fullPage: true,
mask: [dynamicTimestamp, userAvatar],
maskColor: '#1e293b',
});
});
test('component-level snapshot for modal dialog', async ({ page }) => {
await page.click('[data-testid="open-settings-modal"]');
const modal = page.locator('[role="dialog"]');
await expect(modal).toBeVisible();
await expect(modal).toHaveScreenshot('settings-modal.png');
});
});🐳 Containerized Snapshot Workflow (CI Stability)
Run snapshots inside the official Playwright Docker container to prevent cross-platform font rendering diffs:
# 1. Update baseline snapshots inside Docker container
docker run --rm --network host -v $(pwd):/work/ -w /work/ \
mcr.microsoft.com/playwright:v1.45.0-jammy \
npx playwright test --update-snapshots
# 2. Run visual validation in CI
docker run --rm --network host -v $(pwd):/work/ -w /work/ \
mcr.microsoft.com/playwright:v1.45.0-jammy \
npx playwright test📋 Checklist & Anti-Patterns
| Category | ❌ Anti-Pattern | ✅ Production Best Practice |
| Animation | Taking snapshots with active CSS transitions | Set animations: 'disabled' in config |
| Flakiness | Relying on page.waitForTimeout(3000) | Wait on networkidle, document.fonts.ready, and locator visibility |
| Scope | Capturing entire page for minor widget changes | Use element locators: expect(locator).toHaveScreenshot() |
| OS Mismatch | Committing macOS snapshots to run in Ubuntu CI | Generate reference snapshots with Docker container |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

