Repository navigation
fix(e2e): screenshot the data-quality page once it has loaded - #33662
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
✅ Playwright Results — workflow succeededValidated commit ✅ 4540 passed · ❌ 0 failed · 🟡 5 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 1h 0m 35s ⏱️ Max setup 4m 43s · max shard execution 22m 13s · max shard-job elapsed before upload 25m 19s · reporting 23s 🌐 224.00 requests/attempt · 2.23 app boots/UI scenario · 45.39% common-shard skew Optimization targets still in progress:
🟡 5 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
`data-quality.png` was recorded mid-load. The committed baseline is the page's skeleton placeholders — grey blocks where the three Data Health cards go — so the test only passed while the next run was equally slow, and CI has been red on it at 16708 pixels. `gotoForScreenshot` calls `waitForPageLoaded`, which clears loader *spinners*. A widget that renders `<Skeleton />` while its query is in flight shows no spinner, so the page reads as settled while half of it is still grey. Wait for the skeletons too. Matched on `animate-pulse` rather than a testid because core-components' `Skeleton` exposes none, and the substring match sidesteps escaping the `tw:` prefix. Loading the page fully then exposes the second problem: the Data Health donuts count whatever assets the environment holds — 322 tables in CI, 486 here — so they cannot be baselined. Masked, like the other per-environment regions in this file. The page chrome, tabs, filter row and the Data Dimensions section stay under test. Baseline re-recorded in the image CI uses, mcr.microsoft.com/playwright:v1.57.0-jammy, so the PNG is comparable rather than a macOS rendering. The skeleton wait applies to every page in the suite, so the whole project was run before and after against the same server: the same five pages fail either way on local data (bots, explore, glossary, teams, users), the wait never timed out, and data-quality is the only difference — it now passes.
Review feedback, and it was right: masking each card whole also hid its icon, heading and chrome, so a regression in those would have passed unnoticed. Only two things vary by environment — the donut and the individual legend counts. The chart carries `id="<name>-pie-chart"` and each count carries `data-testid="legend-count-<name>"`, and the legend sits beside the chart rather than inside it, so both can be named directly. The cards, their icons and headings, and the legend's dots and labels are back under test. Re-recorded in mcr.microsoft.com/playwright:v1.57.0-jammy and re-run without --update to confirm it compares clean.
Code Review ✅ No issues found🟡 Medium risk · Shared screenshot navigation now waits on every animate-pulse element across the suite. Fixes the data-quality visual regression baseline by waiting for Tailwind skeleton placeholders to load before capturing the screenshot and masking the environment-dependent Data Health cards. The baseline is now recorded from the CI Playwright environment with fully-loaded content instead of mid-load skeleton placeholders. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
The bug
data-quality.pngwas recorded mid-load. The committed baseline is the page's skeleton placeholders — grey blocks where the three Data Health cards go. The test only passed while the next run happened to be equally slow, and CI has been red on it at 16708 pixels.Expected (committed) vs actual, from the failing run's artifact:
That also explains the 55px shift I originally mistook for a layout change: skeleton blocks and loaded cards are different heights.
Fix
1. Wait for skeletons.
gotoForScreenshotcallswaitForPageLoaded, which clears loader spinners. A widget rendering<Skeleton />while its query is in flight shows no spinner, so the page reads as settled while half of it is grey. Matched onanimate-pulserather than a testid because core-components'Skeletonexposes none, and the substring match sidesteps escaping thetw:prefix.2. Mask the donuts. Loading the page fully exposes the second problem: the Data Health cards count whatever assets the environment holds — 322 tables in CI, 486 locally — so they cannot be baselined. Masked, the same way this file already handles
services-container tbody,search-results-countand the rest. Page chrome, tabs, filter row and the Data Dimensions section stay under test.3. Re-recorded the baseline in the image CI uses,
mcr.microsoft.com/playwright:v1.57.0-jammy, so the PNG is comparable rather than a macOS rendering.Verification
The skeleton wait applies to every page in the suite, so I ran the whole project before and after against the same server:
mainIdentical failure sets — those five are local-data mismatches, unrelated to this change. The skeleton wait never timed out (0 occurrences).
data-qualityis the only difference: it now passes.Replaces #33650
That PR added an
update_snapshotsdispatch flag on the premise that baselines could only be regenerated in CI. That premise was wrong — the CI image runs locally — and the flag would have papered over the real bug rather than fixing it. Closed.🤖 Generated with Claude Code
The PR appears safe to merge with no outstanding correctness, security, or repository-rule issues.
Summary
This PR stabilizes the Data Quality visual-regression snapshot by waiting for skeleton placeholders to disappear, masking only environment-dependent chart data, and updating the CI-compatible baseline.
Reviews (5) · Last reviewed commit: "Merge branch 'main' into fix/visual-regr..."