Add VRT (Visual Regression Testing) with Playwright + Storybook#45
Draft
Add VRT (Visual Regression Testing) with Playwright + Storybook#45
Conversation
|
|
- Install @playwright/test and http-server in storybook package - Create playwright.config.ts with Storybook webServer integration - Create VRT test covering 16 key stories (rendering, compositing, React) - Generate baseline screenshots for all stories - Add test:vrt and test:vrt:update scripts - Update .gitignore for Playwright artifacts Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
…threshold Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add visual regression testing for alibaba/canvas-ui
Add VRT (Visual Regression Testing) with Playwright + Storybook
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds screenshot-based visual regression testing leveraging the existing 25 Storybook stories and Playwright's built-in
toHaveScreenshotcomparison.Changes
packages/storybook/playwright.config.ts): Chromium-only, auto-startshttp-serveragainst the built Storybook static outputpackages/storybook/vrt/vrt.spec.ts): Data-driven test covering 16 stories across core rendering (rect, circle, rrect, text, flex, canvas, path, image), compositing (clip layers, rasterizing), and React components (canvas, text, chunk, scroll-view)vrt/__snapshots__/*.png): 16 baseline PNGs committed for comparisonpnpm test:vrt/pnpm test:vrt:updateat both package and root levelUsage
Adding new VRT cases
Add an entry to the
storiesarray invrt/vrt.spec.ts:Story IDs are visible in
storybook-static/index.jsonor Storybook's URL bar. Runtest:vrt:updateto generate the new baseline.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
storybook.js.org/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/canvas-ui/canvas-ui/packages/storybook/node_modules/.bin/../storybook/bin/index.cjs build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.