[Chore] Run VRT per variant#9721
Draft
weronikaolejniczak wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates EUI’s Storybook visual regression test runner to snapshot each story across multiple “variants” (currently desktop + mobile viewports), and documents how variant baselines are named and how to opt out per-story.
Changes:
- Run VRT screenshots in a loop over defined variants (desktop/mobile) and suffix baseline names with the variant (e.g.
…-desktop.png,…-mobile.png). - Remove
packages/eui/playwright.config.ts, which is not used by the currenttest-storybook-based VRT runner. - Expand the VRT wiki docs with variant behavior and
parameters.vrt.skipVariants.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wiki/contributing-to-eui/testing/visual-regression-testing.md | Documents variant baselines and how to skip variants per story |
| packages/eui/playwright.config.ts | Removes unused Playwright config file |
| packages/eui/.storybook/test-runner.ts | Implements per-variant viewport iteration and per-variant snapshot IDs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
d4ef603 to
1fb106d
Compare
Collaborator
💚 Build Succeeded
History
|
Collaborator
💔 Build Failed
Failed CI StepsHistory
|
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.
Summary
Several issues after having merged #9594...
Lack of
mobilesnapshotsTurns out
playwright.config.tsisn't picked up by the test-runner and is essentially dead code but what's more curious is there's conditional logic for the viewport in the test runner. Not sure what I was thinking at the time.Added an iteration through "variants". Called them generically because although it's only viewport for now, we may extend it (dark mode, high contrast mode etc.).
skip-vrtflag doesn't re-triggereui-deploy-docsThe result is that when you add
skip-vrtto labels, the CI doesn't trigger the failedeui-deploy-docsagain.No add commit on failed VRT step
If the VRT step fails, we do not add
chore(eui): add VRT baseline screenshots, we fold the new snapshots underchore(eui): update VRT baseline screenshotswhich is better because it doesn't unnecessarily cause another CI run. BUT! The wiki for VRT might be confusing. If the VRT step failed, someone might still expect theaddcommit when they've added a new story.[TBD] Still a couple of flakes
I think some of the flakes like
EuiPopoverPlayground might be caused by font subpixel positioning and there's a Chromium flag to disable it:--disable-font-subpixel-positioning.QA instructions for reviewer