Compare visual state
compare-visual-stateCapture a live page or element, compare it to a stored baseline, and report pixel changes, changed regions, and average color shift. Use the first run to save the baseline and output a diff image.
Instructions
Visual regression check: screenshot a live page (or element), compare it to a stored baseline, and report how many pixels changed, WHERE they changed (bounding regions), and the average color shift ("blue → red"). First call saves the baseline; later calls compare. Writes a red-highlighted diff image for review.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full URL of the page (or element target) to capture | |
| name | Yes | Baseline id, e.g. "checkout-page" or "submit-button" | |
| action | No | 'baseline' overwrites the stored baseline; 'compare' (default) compares against it | |
| actions | No | Steps run after load to reach a state (modal, step 3) | |
| headers | No | Extra HTTP headers, e.g. Authorization | |
| waitFor | No | Wait for this selector before capturing | |
| fullPage | No | Capture the full scrollable page (default false) | |
| selector | No | Capture only this element (selector or locator) | |
| viewport | No | ||
| timeoutMs | No | ||
| tolerance | No | Percent of pixels that may differ before reporting a change (default 0.1) | |
| waitUntil | No | ||
| projectRoot | No | Project directory; defaults to the server working directory | |
| storageState | No | Logged-in session: storageState JSON inside the project, e.g. playwright/.auth/user.json | |
| pixelThreshold | No | Combined per-pixel channel delta considered different (default 60) |