Skip to content

Comments

test: fixed flaky e2e tests#24490

Merged
anikdhabal merged 2 commits intomainfrom
fix-flaky-tests
Oct 15, 2025
Merged

test: fixed flaky e2e tests#24490
anikdhabal merged 2 commits intomainfrom
fix-flaky-tests

Conversation

@anikdhabal
Copy link
Contributor

What does this PR do?

fixed flaky e2e tests

@keithwillcode keithwillcode added the core area: core, team members only label Oct 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

Updates E2E tests and fixtures:

  • booking-seats.e2e.ts now targets a specific attendee (found by email) to fetch booking seats, extracts and validates seatReferenceUid from reschedule URLs, and removes the prior rescheduleUid URL wait, adding seatReferenceUid checks across flows.
  • fixtures/apps.ts asserts aria-current="page" on the Apps vertical tab in goToAppsTab and verifyAppsInfoNew.
  • out-of-office.e2e.ts creates response promises for outOfOfficeEntriesList before navigation, then awaits them post-load to avoid race conditions.
  • payment-apps.e2e.ts introduces a local goToAppsTab(page, eventTypeId) helper to navigate to the Apps tab and assert active state, replacing repeated direct navigations.

Possibly related PRs

  • fix: v2 seated bookings #23514: Introduces/uses seatReferenceUid in platform links and seated-booking attendee handling, aligning with seatReferenceUid validations added in booking-seats tests.
  • fix: unable to cancel a seated event as a host #24426: Centralizes/uses seatReferenceUid in booking action URLs, matching the test updates that assert attendee-specific seatReferenceUid in reschedule links.
  • fix: few e2e flakes #23926: Adjusts out-of-office tests to await API responses by attaching waits before navigation, mirroring the responsePromise pattern applied here.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly indicates that the pull request addresses flaky end-to-end tests, which directly reflects the modifications made to stabilize various e2e test files. It is concise, clearly related to the changeset, and provides enough context for a reviewer scanning the project history.
Description Check ✅ Passed The description directly states that the pull request fixes flaky e2e tests, which aligns with the test stability improvements in the changeset. Although minimal, it is on-topic and clearly relates to the modifications made.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-flaky-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

E2E results are ready!

@vercel
Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Oct 15, 2025 6:44pm
cal-eu Ignored Ignored Oct 15, 2025 6:44pm

@anikdhabal anikdhabal marked this pull request as ready for review October 15, 2025 19:05
@graphite-app graphite-app bot requested a review from a team October 15, 2025 19:05
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/web/playwright/booking-seats.e2e.ts (1)

544-548: Add null-safety assertion for the second attendee.

The .find() can return undefined if the attendee is not found. While the optional chaining (?.) handles this, the test would fail later with a less clear error. Add an explicit assertion to fail early with a clear message.

Apply this diff:

 const secondAttendeeId = bookingAttendees.find((attendee)=> attendee.email === "second+seats@cal.com");
+expect(secondAttendeeId).toBeDefined();

 const references = await prisma.bookingSeat.findFirst({
   where: { bookingId: booking.id, attendeeId: secondAttendeeId?.id },
 });
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 94ae3a5 and 589df77.

📒 Files selected for processing (4)
  • apps/web/playwright/booking-seats.e2e.ts (2 hunks)
  • apps/web/playwright/fixtures/apps.ts (2 hunks)
  • apps/web/playwright/out-of-office.e2e.ts (2 hunks)
  • apps/web/playwright/payment-apps.e2e.ts (9 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • apps/web/playwright/payment-apps.e2e.ts
  • apps/web/playwright/out-of-office.e2e.ts
  • apps/web/playwright/fixtures/apps.ts
  • apps/web/playwright/booking-seats.e2e.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • apps/web/playwright/payment-apps.e2e.ts
  • apps/web/playwright/out-of-office.e2e.ts
  • apps/web/playwright/fixtures/apps.ts
  • apps/web/playwright/booking-seats.e2e.ts
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • apps/web/playwright/payment-apps.e2e.ts
  • apps/web/playwright/out-of-office.e2e.ts
  • apps/web/playwright/fixtures/apps.ts
  • apps/web/playwright/booking-seats.e2e.ts
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Publish HTML report / publish-report
🔇 Additional comments (7)
apps/web/playwright/fixtures/apps.ts (2)

118-121: LGTM! Improved race condition handling.

The explicit aria-current="page" assertion after navigation ensures the Apps tab is fully active before proceeding, reducing flakiness.


128-132: LGTM! Consistent tab-state verification.

The change aligns with the updated goToAppsTab flow by verifying the Apps tab is active rather than the Basics tab, and the comment clarifies this fixes a race condition.

apps/web/playwright/out-of-office.e2e.ts (2)

656-661: LGTM! Proper response promise handling.

Creating the response promise before navigation and awaiting it after domcontentloaded prevents race conditions where the API response might complete before the listener is registered.


671-676: LGTM! Consistent pattern applied.

The same race condition fix is applied here, ensuring consistent and reliable test behavior.

apps/web/playwright/payment-apps.e2e.ts (2)

12-15: LGTM! Centralized navigation helper.

The goToAppsTab helper encapsulates navigation and tab-state verification, reducing duplication and ensuring consistent race condition handling across all tests.


38-38: LGTM! Consistent use of the navigation helper.

Replacing direct page.goto() calls with goToAppsTab() ensures all tests benefit from the centralized navigation and assertion logic.

Also applies to: 84-84, 124-124, 167-167, 194-194, 229-229, 276-276, 323-323

apps/web/playwright/booking-seats.e2e.ts (1)

560-566: LGTM! Robust URL parameter validation.

Extracting and validating the seatReferenceUid from the reschedule link before navigation is a good pattern that ensures the correct reference is used, preventing flakiness from incorrect URL parameters.

@anikdhabal anikdhabal enabled auto-merge (squash) October 15, 2025 19:12
@anikdhabal anikdhabal merged commit 9133bc5 into main Oct 15, 2025
38 of 39 checks passed
@anikdhabal anikdhabal deleted the fix-flaky-tests branch October 15, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only ready-for-e2e size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants