xiaohongshu
xiaohongshu
component-screenshot-testing
Screenshot testing for React components with Playwright. Captures component pixels and compares to baselines. Auto-apply when editing React component stories or *.visual.spec.ts files that test UI components.
Full skill instructions
Captures React component screenshots and compares them to baseline PNGs. Tests that UI components render correctly at the pixel level.
This is about component appearance, not data or canvas rendering. It catches:
For canvas-based filmstrip testing (matrix progressions), see canvas-filmstrip-testing.
stories/
components/ → Shared React components for stories
StripViewer.tsx
ProgressionStrip.tsx
ui-components/ → UI component stories (if present)
Button.visual.spec.ts
Panel.visual.spec.ts
# Run visual tests
npm run test:visual:headless # CI/agents
npm run test:visual:headed # Debugging with browser UI
# Update baselines after intentional changes
npm run test:visual:update:headless
npm run test:visual:update:headed
# Clear test artifacts
npm run reset:visual # Clear results/reports only
npm run reset:visual:all # Clear results + colocated baselines
# Verify stories compile (fast check)
npm run stories:build
// Example: stories/ui-components/Button.visual.spec.ts
import { test, expect } from '@playwright/test';
test.describe('Button Component', () => {
test('primary button', async ({ page }) => {
await page.goto('http://localhost:3001/?page=ui-button');
const button = page.getByTestId('button-primary');
await expect(button).toHaveScreenshot('button-primary.png');
});
test('disabled button', async ({ page }) => {
await page.goto('http://localhost:3001/?page=ui-button');
const button = page.getByTestId('button-disabled');
await expect(button).toHaveScreenshot('button-disabled.png');
});
});
data-testid to capture just the component// Wait for component to be ready
await page.waitForSelector('[data-testid="my-component"]');
await page.waitForLoadState('networkidle');
// Screenshot just the component
const element = page.getByTestId('my-component');
await expect(element).toHaveScreenshot('my-component.png');
When a visual test fails:
// Start dev server
npm run stories
// Open in browser
mcp__chrome-devtools__new_page({ url: "http://localhost:3001/?page=ui-button" })
// Take snapshot to find element UIDs
mcp__chrome-devtools__take_snapshot()
// Screenshot specific element
mcp__chrome-devtools__take_screenshot({ uid: "<element-uid>" })
// After fixing, reload and re-check
mcp__chrome-devtools__navigate_page({ type: "reload" })
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience