Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

testing-visual-regression

/testing-visual-regression

Wykrywa zmiany wizualne w komponentach UI przez porównywanie zrzutów ekranu, także niezamierzone zmiany i różnice pikseli.

Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
11
Skrypty
4
Komentarze HTML
0
Adresy URL w SKILL.md
6
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 4 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: assets/example_backstop_config.js, scripts/analyze_diffs.py, scripts/run_visual_tests.py, scripts/update_baselines.py

Co robi i kiedy

Wykrywa zmiany wizualne w komponentach UI przez porównywanie zrzutów ekranu, także niezamierzone zmiany i różnice pikseli.

Wyzwalacze z opisu

test visual changescompare screenshotsdetect UI regressions
Oryginalny opis (EN)

Detect visual changes in UI components using screenshot comparison. Use when detecting unintended UI changes or pixel differences. Trigger with phrases like "test visual changes", "compare screenshots", or "detect UI regressions".

Jak działa

  1. Overview
  2. Prerequisites
  3. Instructions
  4. Output
  5. Error Handling
  6. Examples
  7. Resources
Sekcje z nagłówków SKILL.md, w oryginale · 98 linii, 622 słów
Podgląd SKILL.md
---
name: testing-visual-regression
description: 'Detect visual changes in UI components using screenshot comparison.

  Use when detecting unintended UI changes or pixel differences.

  Trigger with phrases like "test visual changes", "compare screenshots", or "detect
  UI regressions".

  '
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(test:visual-*)
version: 1.25.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
tags:
- testing
- testing-visual
compatibility: Designed for Claude Code
---
# Visual Regression Tester

## Overview

Detect unintended visual changes in UI components by capturing screenshots and comparing them pixel-by-pixel against approved baselines. Supports Playwright visual comparisons, Percy, Chromatic, BackstopJS, and reg-suit.

## Prerequisites

- Browser automation tool installed (Playwright, Puppeteer, or Cypress)
- Visual regression library configured (Playwright `toHaveScreenshot`, Percy, Chromatic, or BackstopJS)
- Baseline screenshots committed to version control or stored in a cloud service
- Storybook or component playground running for isolated component captures (optional)
- Consistent rendering environment (Docker or CI with fixed OS/fonts/GPU settings)

## Instructions

1. Identify all UI components and pages requiring visual coverage using Glob to scan component directories and route definitions.
2. Create a visual test file for each component or page:
   - Navigate to the component URL or Storybook story.
   - Wait for all network requests, animations, and lazy-loaded images to complete.
   - Set a consistent viewport size (e.g., 1280x720 for desktop, 375x812 for mobile).
3. Capture screenshots with deterministic settings:
   - Disable animations and transitions (`* { animation: none !important; transition: none !important; }`).
   - Mask dynamic content (timestamps, random avatars, ads) with CSS overlays.
   - Use `fullPage: true` for scrollable pages.
4. Compare captured screenshots against baselines:
   - Configure pixel difference threshold (recommended: 0.1% for component tests, 0.5% for full-page).
   - Generate diff images highlighting changed regions.
   - Flag tests as failed when differences exceed the threshold.
5. For responsive testing, capture at multiple breakpoints:
   - Mobile: 375px width
   - Tablet: 768px width
   - Desktop: 1280px width
   - Wide: 1920px width
6. Review diff images for each failure and classify as:
   - **Intentional change**: Update the baseline with `--update-snapshots`.
   - **Regression**: File a bug with the diff image attached.
7. Integrate into CI so visual tests run on every pull request with diff images uploaded as artifacts.

## Output

- Screenshot baseline images stored in `__screenshots__/` or equivalent directory
- Diff images highlighting pixel-level changes between baseline and current
- Visual regression test report with pass/fail status per component
- CI artifacts containing all captured, baseline, and diff images
- Responsive coverage matrix showing results across breakpoints

## Error Handling

| Error | Cause | Solution |
|-------|-------|---------|
| Anti-aliasing differences across OS | Font rendering varies between macOS, Linux, and Windows | Run visual tests in Docker with fixed fonts; use `threshold` option to allow sub-pixel variance |
| Flaky screenshots from animations | CSS transitions or JS animations still running at capture time | Inject `prefers-reduced-motion` or disable animations via `addStyleTag` before capture |
| Missing baseline on first run | No previous screenshot exists to compare against | Run with `--update-snapshots` to create initial baselines; commit them to the repository |
| Viewport size mismatch | Browser chrome or scrollbar width differs between environments | Use `setViewportSize` explicitly; hide scrollbars with CSS `overflow: hidden` |
| Dynamic content causes false failures | Timestamps, user avatars, or ads change between runs | Mask dynamic elements with `mask` option or replace content via `page.evaluate` |

## Examples

**Playwright visual regression test:**

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

test('homepage matches baseline', async ({ page }) => {
  await page.goto('/');
  await page.waitForLoadState('networkidle');
  await page.addStyleTag({ content: '* { animation: none !important; }' });
  await expect(page).toHaveScreenshot('homepage.png', {
    maxDiffPixelRatio: 0.001,
    fullPage: true,
  });
});
```

**BackstopJS scenario configuration:**

```json
{
  "label": "Login Page",
  "url": "http://localhost:3000/login",  # 3000: 3 seconds in ms
  "selectors": ["document"],
  "misMatchThreshold": 0.1,
  "viewports": [
    { "label": "phone", "width": 375, "height": 812 },  # 812: 375 = configured value
    { "label": "desktop", "width": 1280, "height": 720 }  # 1280: 720 = configured value
  ]
}
```

## Resources

- Playwright visual comparisons: https://playwright.dev/docs/test-snapshots
- Percy visual testing: https://www.percy.io/
- Chromatic (Storybook): https://www.chromatic.com/
- BackstopJS: https://github.com/garris/BackstopJS
- reg-suit visual regression: https://reg-viz.github.io/reg-suit/
Pliki w paczce (11)
  • SKILL.md 5 KB
  • assets/README.md 1 KB
  • assets/example_backstop_config.js 3 KB
  • assets/example_chromatic_config.yml 2 KB
  • assets/example_percy_config.yml 2 KB
  • assets/html_report_template.html 3 KB
  • references/README.md 1 KB
  • scripts/README.md 1 KB
  • scripts/analyze_diffs.py 5 KB
  • scripts/run_visual_tests.py 3 KB
  • scripts/update_baselines.py 3 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · jeremylongshore/tons-of-skills-marketplace100MIT
HelixDevelopment/agent100MIT

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki 756c35abc3a5 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100visual-regression-testing-playwright-percy
    Automatycznie wykrywa niezamierzone zmiany wizualne i przesunięcia pikseli w różnych widokach przeglądarki.
  • 90visual-regression
    Wykrywa niezamierzone zmiany interfejsu przez porównanie powtarzalnych zrzutów z zatwierdzonymi wzorcami, bez akceptowania zmian na siłę.
  • 100visual-regression
    Wykrywa niezamierzone zmiany wizualne, porównując zrzuty ekranu z wzorcem po każdej zmianie interfejsu webowego przed zgłoszeniem.
  • 100visual-regression-testing
    Wychwytuje niezamierzone zmiany UI przez porównanie zrzutów ekranu z zatwierdzonymi wzorcami z dostrojonymi progami i kontrolą niestabilności testów.
  • 100test-visual-regression
    Konfiguruje wzorce zrzutów ekranu Playwright i porównywanie w CI, tak by zmiany interfejsu wywalały testy piksel po pikselu.
  • 100visual-diff
    Porównuje zrzuty ekranu przed i po zmianach, wykrywając regresje wizualne w interfejsie, CSS i układzie.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.