Skip to content

[Chore] Run VRT per variant#9721

Draft
weronikaolejniczak wants to merge 6 commits into
elastic:mainfrom
weronikaolejniczak:fix/vrt-mobile
Draft

[Chore] Run VRT per variant#9721
weronikaolejniczak wants to merge 6 commits into
elastic:mainfrom
weronikaolejniczak:fix/vrt-mobile

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Several issues after having merged #9594...

Lack of mobile snapshots

Turns out playwright.config.ts isn'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-vrt flag doesn't re-trigger eui-deploy-docs

The result is that when you add skip-vrt to labels, the CI doesn't trigger the failed eui-deploy-docs again.

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 under chore(eui): update VRT baseline screenshots which 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 the add commit when they've added a new story.

[TBD] Still a couple of flakes

I think some of the flakes like EuiPopover Playground might be caused by font subpixel positioning and there's a Chromium flag to disable it: --disable-font-subpixel-positioning.

QA instructions for reviewer

  • VRT is ran both for desktop and mobile
  • Wiki is clear
  • VRT baselines for mobile are added

@weronikaolejniczak weronikaolejniczak self-assigned this Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 15:23
@weronikaolejniczak weronikaolejniczak requested a review from a team as a code owner June 5, 2026 15:23
@weronikaolejniczak weronikaolejniczak added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 current test-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.

Comment thread wiki/contributing-to-eui/testing/visual-regression-testing.md Outdated
weronikaolejniczak and others added 2 commits June 5, 2026 17:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@weronikaolejniczak weronikaolejniczak marked this pull request as draft June 5, 2026 16:19
@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

@elasticmachine

Copy link
Copy Markdown
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @weronikaolejniczak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants