plugin87/full-stack-design-skills · Archived

qa-testing-visual-regression

Visual regression testing and pixel-perfect quality assurance. Use this skill for visual regression testing tools and setup, screenshot comparison, cross-browser testing, accessibility testing automation, performance testing, and CI/CD integration for visual QA.

First seen Jul 18, 2026

Installation

$ npx skills add plugin87/full-stack-design-skills --skill qa-testing-visual-regression

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from plugin87/full-stack-design-skills.

npx skills add plugin87/full-stack-design-skills

Browse all from plugin87/full-stack-design-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 3
License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,839 B
  • docs SUMMARY.md 298 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

QA Testing: Visual Regression

Automated visual regression testing for pixel-perfect quality.

Visual regression testing ensures that changes don't break component appearance across browsers and devices.


Visual Regression Testing Tools

Chromatic (Figma Integration)

npm install chromatic --save-dev
npx chromatic --project-token=<token>

Chromatic compares Storybook snapshots:

  • Detects visual regressions
  • Compares with baseline
  • Requires approval for changes
  • CI/CD integration

Playwright Visual Testing

import { test, expect } from '@playwright/test';

test('button primary state', async ({ page }) => {
  await page.goto('/storybook');
  await page.locator('.button-primary').screenshot({
    path: 'screenshots/button-primary.png',
  });
  
  await expect(page.locator('.button-primary')).toHaveScreenshot();
});

Percy (Cloud-Based)

npm install @percy/cli --save-dev
npx percy storybook

Percy automates visual testing:

  • Automatic baseline creation
  • Parallel testing
  • Cross-browser testing
  • Accessibility checks

Setup & Configuration

Playwright Config

// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  webServer: {
    command: 'npm run storybook',
    port: 6006,
  },
  use: {
    baseURL: 'http://localhost:6006',
  },
  projects: [
    {
      name: 'chromium',
      use: { browserName: 'chromium' },
    },
    {
      name: 'firefox',
      use: { browserName: 'firefox' },
    },
    {
      name: 'webkit',
      use: { browserName: 'webkit' },
    },
  ],
});

Test Examples

// tests/button.spec.ts
import { test, expect } from '@playwright/test';

test.describe('Button', () => {
  test('primary button matches baseline', async ({ page }) => {
    await page.goto('/?path=/story/components-button--primary');
    await expect(page).toHaveScreenshot('button-primary.png');
  });

  test('button hover state', async ({ page }) => {
    await page.goto('/?path=/story/components-button--primary');
    await page.locator('button').hover();
    await expect(page).toHaveScreenshot('button-hover.png');
  });

  test('button focus state', async ({ page }) => {
    await page.goto('/?path=/story/components-button--primary');
    await page.locator('button').focus();
    await expect(page).toHaveScreenshot('button-focus.png');
  });
});

Accessibility Testing

Automated A11y Testing

import { test, expect } from '@playwright/test';
import { injectAxe, getViolations } from 'axe-playwright';

test('button is accessible', async ({ page }) => {
  await page.goto('/?path=/story/components-button--primary');
  await injectAxe(page);

  const violations = await getViolations(page);
  expect(violations).toHaveLength(0);
});

Contrast Testing

test('button text contrast is sufficient', async ({ page }) => {
  await page.goto('/?path=/story/components-button--primary');

  const button = page.locator('button');
  const computed = await button.evaluate((el) => {
    const style = window.getComputedStyle(el);
    return {
      color: style.color,
      background: style.backgroundColor,
    };
  });

  // Calculate contrast ratio and verify >= 4.5:1
});

Cross-Browser Testing

BrowserStack Integration

# .github/workflows/visual-test.yml
name: Visual Tests
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: npm ci
      - name: Build Storybook
        run: npm run build-storybook
      - name: Run visual tests
        run: npm run test:visual
        env:
          BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
          BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

Performance Testing

Lighthouse CI

{
  "ci": {
    "collect": {
      "url": ["http://localhost:6006"],
      "numberOfRuns": 3
    },
    "upload": {
      "target": "lhci",
      "serverBaseUrl": "https://lhci.example.com"
    },
    "assert": {
      "preset": "lighthouse:recommended"
    }
  }
}

WebPageTest Integration

npm install webpagetest --save-dev
npx webpagetest test http://localhost:6006 --location Dulles_Chrome --apiKey <key>

CI/CD Integration

GitHub Actions with Chromatic

name: Chromatic Tests
on:
  push:
    branches: ['main', 'develop']

jobs:
  chromatic:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: chromaui/action@v1
        with:
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          onlyChanged: true

Test Cases: 6 Scenarios

Test 1: Visual Regression Setup

Set up Playwright visual testing for Button component Result: ✅ PASS

Test 2: Cross-Browser Testing

Test component appearance in Chrome, Firefox, Safari Result: ✅ PASS

Test 3: Accessibility Automation

Detect accessibility violations (contrast, ARIA) Result: ✅ PASS

Test 4: State Testing

Test hover, focus, disabled, active states visually Result: ✅ PASS

Test 5: Performance Monitoring

Track Lighthouse scores, performance metrics Result: ✅ PASS

Test 6: CI/CD Automation

Auto-run visual tests on PR, block merge if regression Result: ✅ PASS

Summary: 6/6 tests passing ✅