fix(e2e): repair failing weekly test suite#696
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Disabled knowledge base sources:
WalkthroughTwo E2E test files are updated. Event selection tests set a default lens cookie before each run, and marketing dashboard drawer tests now open via drawer content selectors and wait for stats visibility explicitly. ChangesE2E Test Stability
Estimated code review effort: 2 (Simple) | ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the weekly Playwright e2e suite by removing lens-dependent routing flakiness in the events tests and reducing drawer-loading timing sensitivity in the marketing dashboard tests.
Changes:
- Forces the “me” lens via
lfx-active-lenscookie before navigating to/me/events, preventing redirects into the foundation lens flow. - Updates 5 marketing drawer tests to wait for
*-drawer-contentfirst, then assert*-drawer-statswith an explicit data-load timeout to avoid CI timeouts under slow API responses.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/lfx-one/e2e/marketing-dashboard.spec.ts | Adjusts drawer-open wait targets to be resilient to slow-loading stats content. |
| apps/lfx-one/e2e/event-selection-robust.spec.ts | Sets active lens cookie before navigation to avoid lensRedirectGuard sending tests to the wrong lens route. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
asithade
left a comment
There was a problem hiding this comment.
Small, well-scoped e2e stabilization PR fixing real flakiness root causes (lensRedirectGuard divert on /me/events, drawer-content vs drawer-stats race in slow CI). The PR body clearly documents the root cause for each fix.
Two items to address:
- Use the shared lens constants in
event-selection-robust.spec.tsinstead of hard-coding'lfx-active-lens'and'me'.LENS_COOKIE_KEYandDEFAULT_LENSare already exported from@lfx-one/shared/constantsand the e2e tsconfig supports the import. This also resolves the unaddressed Copilot review comment from 2026-05-12. - JIRA ticket — no
LFXV2-XXXreference in commits, branch, or PR body. Percommit-workflow.md, work should be tracked in JIRA.
No backend changes; upstream API contract validation skipped. No protected files touched.
Address review comments from @asithade, copilot-pull-request-reviewer[bot]: - apps/lfx-one/e2e/event-selection-robust.spec.ts: import DEFAULT_LENS and LENS_COOKIE_KEY from @lfx-one/shared/constants instead of hard-coding 'lfx-active-lens' and 'me' literals (per @asithade, copilot-pull-request-reviewer[bot]) Resolves 2 review threads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1780 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Review Feedback AddressedCommit: 29db3f1 Changes Made
JIRA Tracking
Threads Resolved2 of 2 unresolved threads addressed in this iteration. |
Review feedback has been addressed in commit 29db3f1. Re-requesting your review.
Address review comments from @asithade, copilot-pull-request-reviewer[bot]: - apps/lfx-one/e2e/event-selection-robust.spec.ts: import DEFAULT_LENS and LENS_COOKIE_KEY from @lfx-one/shared/constants instead of hard-coding 'lfx-active-lens' and 'me' literals (per @asithade, copilot-pull-request-reviewer[bot]) Resolves 2 review threads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1780 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
29db3f1 to
fca949c
Compare
asithade
left a comment
There was a problem hiding this comment.
Tight, well-scoped e2e stabilization PR. Root causes documented clearly (lensRedirectGuard divert + drawer-content vs drawer-stats race), and the original review feedback (shared lens constants + JIRA ticket) is fully addressed in commit 29db3f13.
One outstanding issue: the unresolved Copilot comment about email-ctr-drawer-chart-section is valid. That testid does not exist in email-ctr-drawer.component.html — only attribution-section, paid-section, and email-section are present. The Email CTR test is one of the five this PR targets, so leaving the assertion broken keeps that test failing after the fix. Either retarget the assertion or add the missing testid in the drawer template.
Branch-name nit (uses GitHub issue # instead of fix/LFXV2-1780) — non-blocking, just flagging for next time. No backend changes — upstream API validation skipped. No protected files touched.
Address review comments from @asithade, copilot-pull-request-reviewer[bot]: - apps/lfx-one/e2e/event-selection-robust.spec.ts: import DEFAULT_LENS and LENS_COOKIE_KEY from @lfx-one/shared/constants instead of hard-coding 'lfx-active-lens' and 'me' literals (per @asithade, copilot-pull-request-reviewer[bot]) Resolves 2 review threads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1780 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
fca949c to
91989df
Compare
Review iteration 2 — addressedIssue: Fix (commit 91989df): Retargeted to Replied to and resolved both the Copilot and @asithade threads. |
Addressed in commit 91989df — retargeted email-ctr-drawer-chart-section to existing email-ctr-drawer-email-section.
MRashad26
left a comment
There was a problem hiding this comment.
Strict pass against ~/LFX/code-enforcer-agent.md (note: enforcer rules are scoped to Angular/SSR/component code; this PR is e2e-only, so most rules don't apply). The two fixes are correct and address the failure modes the PR description identifies. Two suggestions worth a look — one about portability of the cookie hard-coded to localhost, one about cleaning up the now-duplicated post-open data-wait idiom across the 5 marketing drawer tests.
Address review comments from @MRashad26, copilot-pull-request-reviewer: - event-selection-robust.spec.ts: derive cookie domain from Playwright's baseURL in test.beforeEach so the lens cookie is portable across dev, CI, and preview environments — removes hard-coded 'localhost' (per @MRashad26) - marketing-dashboard.spec.ts: extract openDrawerAndWaitForData helper and collapse 5 duplicated open+wait callsites — stats wait is now in the helper instead of repeated at each callsite (per @MRashad26) - marketing-dashboard.spec.ts: rename 'shows stats and chart sections' to 'shows stats and email sections' to match the actual assertions (per copilot-pull-request-reviewer) Resolves 3 review threads. Issue: LFXV2-1780 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Review Feedback AddressedCommit: f1fd8a3 Changes Made
Threads Resolved5 of 5 unresolved threads addressed in this iteration (including 2 outdated threads from prior commits that had responses but were not yet marked resolved). |
Set lfx-active-lens cookie before navigating to /me/events so lensRedirectGuard no longer diverts to /foundation/events. Make dashboard drawer tests wait for *-drawer-content before asserting *-drawer-stats to avoid race conditions when API responses are slow in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: #670 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Address review comments from @asithade, copilot-pull-request-reviewer[bot]: - apps/lfx-one/e2e/event-selection-robust.spec.ts: import DEFAULT_LENS and LENS_COOKIE_KEY from @lfx-one/shared/constants instead of hard-coding 'lfx-active-lens' and 'me' literals (per @asithade, copilot-pull-request-reviewer[bot]) Resolves 2 review threads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1780 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Replace non-existent `email-ctr-drawer-chart-section` with `email-ctr-drawer-email-section` which maps to the Email Performance section present in the template. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1780 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Address review comments from @MRashad26, copilot-pull-request-reviewer: - event-selection-robust.spec.ts: derive cookie domain from Playwright's baseURL in test.beforeEach so the lens cookie is portable across dev, CI, and preview environments — removes hard-coded 'localhost' (per @MRashad26) - marketing-dashboard.spec.ts: extract openDrawerAndWaitForData helper and collapse 5 duplicated open+wait callsites — stats wait is now in the helper instead of repeated at each callsite (per @MRashad26) - marketing-dashboard.spec.ts: rename 'shows stats and chart sections' to 'shows stats and email sections' to match the actual assertions (per copilot-pull-request-reviewer) Resolves 3 review threads. Issue: LFXV2-1780 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
044d0b0 to
37fe384
Compare
Summary
Fixes the weekly e2e test failures reported in #670 (also #624).
lfx-active-lens=mecookie before navigating to/me/eventsso thelensRedirectGuard(added in feat(routing): redirect flat routes to active lens prefix #653) no longer diverts the test to/foundation/events, which renders a different component lacking the expected testids.*-drawer-content(always visible once the drawer opens) before asserting*-drawer-stats, preventing timeouts in CI when API responses are slow and the loading skeleton hasn't cleared yet.Root Causes
lensRedirectGuardon/eventsredirects to/{lens}/eventswhen the active lens isfoundationorproject. The test user's saved lens state in CI caused/me/events→/events→/foundation/events, where the expected testids don't exist.openDrawer()calls passed*-drawer-statsas the wait target, but those elements are behind adrawerLoading()gate. If the upstream API was slow, the drawer opened butopenDrawer()timed out before the skeleton cleared.JIRA
LFXV2-1780
Closes #670
Closes #624
🤖 Generated with Claude Code