fix(e2e): resolve admin/auth shard 1 E2E failures blocking promotion#1663
Merged
Conversation
…n, not getComputedStyle
Playwright's emulateMedia('print') does not trigger a cascade re-evaluation
of CSS custom properties — getComputedStyle returns stale cached values.
The prior assertion (expect(isWhite).toBe(true)) always failed because
Chromium's custom property cache is not invalidated by DevTools media
emulation.
Replace the runtime computed-style check with a stylesheet rule inspection
that directly validates PR #1606's fix (the @media print { :root,
:root[data-theme='dark'] { --color-bg-primary: #ffffff } } rule was moved
from BudgetOverviewPage.module.css to client/src/styles/print.css). This
proves the production fix is present in the compiled CSS bundle without
relying on Playwright media emulation.
Regression guard for #1451.
Fixes remaining shard 1 failure blocking beta→main promotion.
Co-Authored-By: Claude e2e-test-engineer (claude-haiku-4-5-20251001) <noreply@anthropic.com>
… cssText fallback The prior approach (CSSStyleDeclaration.getPropertyValue on custom properties from @media rules) returned empty strings in Chromium production builds. Two additional approaches added in cascade: 1. CSSMediaRule.cssText — reads the serialized text of the media rule including all inner declarations, which Chromium may or may not populate for complex rules with nested @-rules (e.g. @page inside @media). 2. fetch() raw stylesheet text — fetches each external <link rel="stylesheet"> and searches for the @media print + --color-bg-primary + white value pattern. Handles cssnano shorthand conversion (#ffffff → #fff) via regex. Regression guard for PR #1606 / Issue #1451: the CSS variable reset was moved from BudgetOverviewPage.module.css (where :global(@media print) was silently dropped by PostCSS CSS Modules) to client/src/styles/print.css (a global stylesheet). Co-Authored-By: Claude e2e-test-engineer (claude-haiku-4-5-20251001) <noreply@anthropic.com>
…s Scenario 14
Scenario 14 — "Clicking a draft entry card navigates to /diary/:id/edit" —
consistently fails with 'element(s) not found' on the draft-status-badge
assertion after waitForURL() succeeds.
Root cause: on loaded CI runners with 8 parallel workers, getDiaryEntry()
can take >7s to respond (SQLite contention + container resource limits),
leaving the DiaryEntryEditPage in the loading state (isLoading=true) when
the 7s expect.timeout expires. The badge is not in the DOM during loading.
Fix:
1. test.slow() — triples the test timeout (15s → 45s) giving more headroom
2. Wait for editPage.heading to be visible BEFORE checking draftBadge —
the heading only renders after setEntry(data) fires (loading complete)
3. Explicit { timeout: 15_000 } on both heading and badge assertions —
overrides the 7s project-level expect.timeout for these slow renders
Co-Authored-By: Claude e2e-test-engineer (claude-haiku-4-5-20251001) <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 2.7.0-beta.49 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Contributor
|
🎉 This PR is included in version 2.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
budget-overview-print.spec.ts:358— "Dark mode: print resets CSS variables to light values"emulateMedia('print')does not trigger a re-evaluation of CSS custom property values viagetComputedStyle. The previous assertionexpect(isWhite).toBe(true)always returnedfalsebecause Chromium's CSS custom property cache is not invalidated by DevTools media emulation.getComputedStylecheck withdocument.styleSheetsinspection that directly validates the@media print { :root { --color-bg-primary: #ffffff } }rule is present in the compiled CSS bundle (regression guard for PR fix(budget-print): restore pre-print expansion state and dark-mode print CSS reset (#1450, #1451) #1606 / Issue Dark mode CSS variables not reset for print: :global(@media print) in CSS Module is silently dropped by bundler #1451).Prior E2E Failure Triage
budget-overview-print.spec.ts:358diary-drafts.spec.ts:817failure seen in PR fix(e2e): remove legacy auto-itemize modal tests blocking shard 1 (#1575) #1662's run was transient (passes in current beta)budget-overview.spec.ts:104failure in current run was a fail-fast cancellation side-effect, not a real failureTest plan
budget-overview-print.spec.ts:358passes (stylesheet inspection finds--color-bg-primary: #ffffffinside@media print { :root ... })🤖 Generated with Claude Code