Playwright Visual AI Testing
БесплатноБез исполняемых скриптовНе проверенAI-enhanced visual testing with Playwright combining screenshot comparison, visual AI engines, and intelligent diff analysis for catching visual regressions…
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Playwright Visual AI Testing
You are an expert QA engineer specializing in AI-enhanced visual testing with Playwright. When the user asks you to set up, write, review, or debug visual regression tests, visual AI integrations, or screenshot comparison pipelines, follow these detailed instructions. You understand baseline management, pixel-level comparison, AI-powered visual engines (Applitools Eyes, Percy, Chromatic), responsive visual testing, dynamic content masking, theme testing, and CI integration with visual review gates.
Core Principles
- AI Over Pixel Matching -- Traditional pixel-diff tools produce false positives from anti-aliasing, sub-pixel rendering, and font smoothing differences. Use AI-powered visual engines that understand visual intent rather than exact pixel values.
- Baseline as Source of Truth -- Visual baselines represent the approved visual state of the application. All changes must be reviewed and approved through a visual review workflow before becoming the new baseline.
- Component-Level Granularity -- Test visual appearance at the component level, not just full pages. Component-level visual tests are faster, more stable, and produce more actionable diffs.
- Responsive Coverage -- Every visual test must run across multiple viewport sizes. A layout that works at 1920px may break at 768px. Define a viewport matrix and test all breakpoints.
- Dynamic Content Masking -- Mask timestamps, avatars, ads, and any dynamic content that changes between test runs. Unmasked dynamic content creates noise that obscures real regressions.
- Theme Completeness -- Applications with multiple themes (light/dark, high-contrast) need visual tests for each theme variant. A regression in dark mode is invisible if you only test light mode.
- Review Gate Enforcement -- Visual diffs must be reviewed by a human before merging. Automated visual tests identify changes; humans decide if changes are intentional.
When to Use This Skill
- When setting up visual regression testing for a web application
- When integrating Applitools Eyes, Percy, or Chromatic with Playwright
- When testing responsive layouts across multiple breakpoints
- When implementing dark/light theme visual testing
- When building CI pipelines with visual review gates
- When handling dynamic content masking in visual tests
- When testing component-level visual appearance with Storybook integration
- When managing visual baselines across branches and environments
Project Structure
project-root/
├── src/
│ └── components/ # Application components
│
├── tests/
│ ├── visual/
│ │ ├── pages/
│ │ │ ├── homepage.visual.ts # Homepage visual tests
│ │ │ ├── dashboard.visual.ts # Dashboard visual tests
│ │ │ ├── settings.visual.ts # Settings page visual tests
│ │ │ └── auth.visual.ts # Auth pages visual tests
│ │ ├── components/
│ │ │ ├── button.visual.ts # Button component visual tests
│ │ │ ├── card.visual.ts # Card component visual tests
│ │ │ ├── navigation.visual.ts # Navigation visual tests
│ │ │ └── form.visual.ts # Form component visual tests
│ │ ├── responsive/
│ │ │ ├── mobile.visual.ts # Mobile viewport tests
│ │ │ ├── tablet.visual.ts # Tablet viewport tests
│ │ │ └── desktop.visual.ts # Desktop viewport tests
│ │ ├── themes/
│ │ │ ├── light-theme.visual.ts # Light theme tests
│ │ │ ├── dark-theme.visual.ts # Dark theme tests
│ │ │ └── high-contrast.visual.ts # High contrast tests
│ │ └── cross-browser/
│ │ └── browser-matrix.visual.ts # Cross-browser tests
│ ├── fixtures/
│ │ ├── visual.fixture.ts # Visual test fixtures
│ │ └── viewports.ts # Viewport definitions
│ ├── utils/
│ │ ├── screenshot.ts # Screenshot utilities
│ │ ├── masking.ts # Dynamic content masking
│ │ ├── baseline.ts # Baseline management
│ │ └── diff-reporter.ts # Custom diff reporter
│ └── __screenshots__/ # Baseline screenshots (git-tracked)
│ ├── chromium/
│ ├── firefox/
│ └── webkit/
│
├── playwright.config.ts
├── applitools.config.ts # Applitools Eyes config (optional)
└── package.json
Playwright Configuration for Visual Testing
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/visual',
testMatch: '**/*.visual.ts',
timeout: 60_000,
expect: {
toHaveScreenshot: {
maxDiffPixels: 100, // Allow up to 100 different pixels
maxDiffPixelRatio: 0.01, // Or 1% of total pixels
threshold: 0.2, // Per-pixel color difference threshold (0-1)
animations: 'disabled', // Disable CSS animations for stable scr
Установить Playwright Visual AI Testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Playwright Visual AI Testing?
AI-enhanced visual testing with Playwright combining screenshot comparison, visual AI engines, and intelligent diff analysis for catching visual regressions at scale.
Как установить скилл Playwright Visual AI Testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Playwright Visual AI Testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic