Skip to content

fix(e2e): repair failing weekly test suite#696

Merged
dealako merged 5 commits into
mainfrom
fix/weekly-e2e-670
Jul 2, 2026
Merged

fix(e2e): repair failing weekly test suite#696
dealako merged 5 commits into
mainfrom
fix/weekly-e2e-670

Conversation

@bramwelt

@bramwelt bramwelt commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the weekly e2e test failures reported in #670 (also #624).

  • Event selection tests: Set lfx-active-lens=me cookie before navigating to /me/events so the lensRedirectGuard (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.
  • Marketing dashboard drawer tests: Change 5 drawer tests to wait for *-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

  1. lensRedirectGuard on /events redirects to /{lens}/events when the active lens is foundation or project. The test user's saved lens state in CI caused /me/events/events/foundation/events, where the expected testids don't exist.
  2. Five openDrawer() calls passed *-drawer-stats as the wait target, but those elements are behind a drawerLoading() gate. If the upstream API was slow, the drawer opened but openDrawer() timed out before the skeleton cleared.

JIRA

LFXV2-1780

Closes #670
Closes #624

🤖 Generated with Claude Code

@bramwelt bramwelt requested a review from a team as a code owner May 12, 2026 18:40
Copilot AI review requested due to automatic review settings May 12, 2026 18:40
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 65641217-884c-4529-97e0-1425ee2d7609

📥 Commits

Reviewing files that changed from the base of the PR and between f1fd8a3 and 3dfe0af.

📒 Files selected for processing (2)
  • apps/lfx-one/e2e/event-selection-robust.spec.ts
  • apps/lfx-one/e2e/marketing-dashboard.spec.ts

Disabled knowledge base sources:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

Two 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.

Changes

E2E Test Stability

Layer / File(s) Summary
Event selection lens initialization
apps/lfx-one/e2e/event-selection-robust.spec.ts
Imports lens cookie constants and sets the default lens cookie in beforeEach before navigating to /me/events.
Marketing dashboard drawer test selectors
apps/lfx-one/e2e/marketing-dashboard.spec.ts
Adds a drawer-opening helper with an explicit visibility wait, then updates the Website Visits, Email CTR, Paid Social Reach, Social Media, and Member Growth tests to use drawer-content selectors and wait for stats elements.

Estimated code review effort: 2 (Simple) | ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing the failing weekly E2E test suite.
Description check ✅ Passed The description directly explains the event-selection and dashboard drawer test fixes.
Linked Issues check ✅ Passed The PR addresses both linked issues by stabilizing the event-selection test and the drawer wait logic.
Out of Scope Changes check ✅ Passed The changed tests and helper refactor are all aligned with the reported weekly E2E failures.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/weekly-e2e-670

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

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 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-lens cookie before navigating to /me/events, preventing redirects into the foundation lens flow.
  • Updates 5 marketing drawer tests to wait for *-drawer-content first, then assert *-drawer-stats with 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.

Comment thread apps/lfx-one/e2e/event-selection-robust.spec.ts Outdated

@asithade asithade 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.

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:

  1. Use the shared lens constants in event-selection-robust.spec.ts instead of hard-coding 'lfx-active-lens' and 'me'. LENS_COOKIE_KEY and DEFAULT_LENS are already exported from @lfx-one/shared/constants and the e2e tsconfig supports the import. This also resolves the unaddressed Copilot review comment from 2026-05-12.
  2. JIRA ticket — no LFXV2-XXX reference in commits, branch, or PR body. Per commit-workflow.md, work should be tracked in JIRA.

No backend changes; upstream API contract validation skipped. No protected files touched.

Comment thread apps/lfx-one/e2e/event-selection-robust.spec.ts Outdated
bramwelt added a commit that referenced this pull request May 13, 2026
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>
@bramwelt

bramwelt commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Review Feedback Addressed

Commit: 29db3f1

Changes Made

  • apps/lfx-one/e2e/event-selection-robust.spec.ts: imported LENS_COOKIE_KEY and DEFAULT_LENS from @lfx-one/shared/constants; replaced hard-coded 'lfx-active-lens' and 'me' literals (per @asithade, copilot-pull-request-reviewer[bot])

JIRA Tracking

Threads Resolved

2 of 2 unresolved threads addressed in this iteration.

@bramwelt bramwelt dismissed asithade’s stale review May 13, 2026 16:38

Review feedback has been addressed in commit 29db3f1. Re-requesting your review.

@bramwelt bramwelt requested review from asithade and Copilot May 13, 2026 16:38
bramwelt added a commit that referenced this pull request May 13, 2026
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>
@bramwelt bramwelt force-pushed the fix/weekly-e2e-670 branch from 29db3f1 to fca949c Compare May 13, 2026 16:42

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread apps/lfx-one/e2e/marketing-dashboard.spec.ts Outdated

@asithade asithade 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.

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.

Comment thread apps/lfx-one/e2e/marketing-dashboard.spec.ts Outdated
bramwelt added a commit that referenced this pull request May 13, 2026
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>
@bramwelt bramwelt force-pushed the fix/weekly-e2e-670 branch from fca949c to 91989df Compare May 13, 2026 21:30
@bramwelt

Copy link
Copy Markdown
Contributor Author

Review iteration 2 — addressed

Issue: email-ctr-drawer-chart-section testid asserted in marketing-dashboard.spec.ts:226 did not exist in any template.

Fix (commit 91989df): Retargeted to email-ctr-drawer-email-section (Email Performance section, line 347 of email-ctr-drawer.component.html), consistent with how the other four drawer tests reference their respective content sections.

Replied to and resolved both the Copilot and @asithade threads.

@bramwelt bramwelt dismissed asithade’s stale review May 13, 2026 21:31

Addressed in commit 91989df — retargeted email-ctr-drawer-chart-section to existing email-ctr-drawer-email-section.

@bramwelt bramwelt requested review from asithade and Copilot May 13, 2026 21:31

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread apps/lfx-one/e2e/marketing-dashboard.spec.ts Outdated

@MRashad26 MRashad26 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.

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.

Comment thread apps/lfx-one/e2e/event-selection-robust.spec.ts Outdated
Comment thread apps/lfx-one/e2e/marketing-dashboard.spec.ts Outdated
bramwelt added a commit that referenced this pull request Jun 30, 2026
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>
@bramwelt

Copy link
Copy Markdown
Contributor Author

Review Feedback Addressed

Commit: f1fd8a3

Changes Made

  • event-selection-robust.spec.ts: moved lens cookie setup into a test.beforeEach at the outer describe level; derive domain from Playwright's baseURL (fallback: 'localhost') so the cookie works across dev, CI, and preview deployments — removes hard-coded 'localhost' (per @MRashad26)
  • marketing-dashboard.spec.ts: extracted openDrawerAndWaitForData helper and collapsed 5 duplicated open+stats-wait patterns into it; tests needing only the drawer open keep bare openDrawer (per @MRashad26)
  • marketing-dashboard.spec.ts: renamed 'shows stats and chart sections''shows stats and email sections' to match the actual assertions (per copilot-pull-request-reviewer)

Threads Resolved

5 of 5 unresolved threads addressed in this iteration (including 2 outdated threads from prior commits that had responses but were not yet marked resolved).

Copilot AI review requested due to automatic review settings June 30, 2026 21:25
@bramwelt bramwelt requested a review from MRashad26 June 30, 2026 22:03

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

bramwelt and others added 4 commits July 2, 2026 09:54
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>
@dealako dealako force-pushed the fix/weekly-e2e-670 branch from 044d0b0 to 37fe384 Compare July 2, 2026 16:56
@dealako dealako merged commit 2e1b7f0 into main Jul 2, 2026
8 of 9 checks passed
@dealako dealako deleted the fix/weekly-e2e-670 branch July 2, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weekly E2E Tests Failed - 2026-05-10 Weekly E2E Tests Failed - 2026-05-03

5 participants