visual-regression-setup
Configure visual regression testing for desktop applications to catch unintended UI changes.
Capabilities
- Configure Percy integration
- Set up Chromatic for Storybook
- Custom screenshot comparison
- Configure threshold settings
- Handle dynamic content masking
- Set up CI/CD integration
Input Schema
{
"type": "object",
"properties": {
"projectPath": { "type": "string" },
"provider": { "enum": ["percy", "chromatic", "reg-suit", "custom"] },
"framework": { "enum": ["playwright", "cypress", "puppeteer"] }
},
"required": ["projectPath"]
}
Percy Integration
// playwright.config.js
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
screenshot: 'only-on-failure'
}
});
// test.spec.js
import { test } from '@playwright/test';
import percySnapshot from '@percy/playwright';
test('visual test', async ({ page }) => {
await page.goto('/');
await percySnapshot(page, 'Home page');
});
Custom Comparison
const { toMatchImageSnapshot } = require('jest-image-snapshot');
expect.extend({ toMatchImageSnapshot });
test('matches screenshot', async () => {
const screenshot = await page.screenshot();
expect(screenshot).toMatchImageSnapshot({
failureThreshold: 0.01,
failureThresholdType: 'percent'
});
});
Related Skills
playwright-electron-config
desktop-ui-testing process
1---
2name: visual-regression-setup
3description: Configure visual regression testing with Percy, Chromatic, or custom screenshot comparison
4allowed-tools: Read, Write, Edit, Bash, Glob, Grep
5tags: [testing, visual-regression, screenshots, ui-testing, desktop]
6graph:
7 domains: [domain:software-engineering]
8 specializations: [specialization:desktop-development]
9 skillAreas: [skill-area:visual-regression-testing, skill-area:cross-platform-desktop]
10 roles: [role:desktop-developer, role:fullstack-engineer]
11 workflows: [workflow:feature-development, workflow:release-management]
12metadata:
13 source: https://skillmd.com/skills/a5c-ai/visual-regression-setup
14---
15
16# visual-regression-setup
17
18Configure visual regression testing for desktop applications to catch unintended UI changes.
19
20## Capabilities
21
22- Configure Percy integration
23- Set up Chromatic for Storybook
24- Custom screenshot comparison
25- Configure threshold settings
26- Handle dynamic content masking
27- Set up CI/CD integration
28
29## Input Schema
30
31```json
32{
33 "type": "object",
34 "properties": {
35 "projectPath": { "type": "string" },
36 "provider": { "enum": ["percy", "chromatic", "reg-suit", "custom"] },
37 "framework": { "enum": ["playwright", "cypress", "puppeteer"] }
38 },
39 "required": ["projectPath"]
40}
41```
42
43## Percy Integration
44
45```javascript
46// playwright.config.js
47import { defineConfig } from '@playwright/test';
48
49export default defineConfig({
50 use: {
51 screenshot: 'only-on-failure'
52 }
53});
54
55// test.spec.js
56import { test } from '@playwright/test';
57import percySnapshot from '@percy/playwright';
58
59test('visual test', async ({ page }) => {
60 await page.goto('/');
61 await percySnapshot(page, 'Home page');
62});
63```
64
65## Custom Comparison
66
67```javascript
68const { toMatchImageSnapshot } = require('jest-image-snapshot');
69expect.extend({ toMatchImageSnapshot });
70
71test('matches screenshot', async () => {
72 const screenshot = await page.screenshot();
73 expect(screenshot).toMatchImageSnapshot({
74 failureThreshold: 0.01,
75 failureThresholdType: 'percent'
76 });
77});
78```
79
80## Related Skills
81
82- `playwright-electron-config`
83- `desktop-ui-testing` process