From 52ecea964d73a8bb301f6736a7bd26199e59a0f2 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Tue, 14 Oct 2025 00:03:30 +0530 Subject: [PATCH] fix: add tests for embed (#23561) * fix: add tests for embed * update * fix test * fix: use immediate interpolation for cancel button link - Change from delayed evaluation (${...}) to immediate interpolation (${...}) - Remove unnecessary fallback value and complex expression - Remove frame.goto() from cancelBookingThroughEmbed as iframe already at cancel page - Remove unused page parameter from selectFirstAvailableTimeSlotNextMonth - This aligns with working pattern from line 294 and avoids parser issues with complex expressions + query params Co-Authored-By: anik@cal.com * chore: fix formatting in testUtils Co-Authored-By: anik@cal.com * fix: read popupCancelUid from URL parameter instead of copying rescheduleUid The cancel button was using the wrong booking UID because it was copying from popupRescheduleUid instead of reading from the URL parameter. This caused the embed iframe to never appear when clicking the cancel button, resulting in test timeouts. The test navigates to /?popupCancelUid= which should be read by the JavaScript, just like popupRescheduleUid is read from its URL parameter. Co-Authored-By: anik@cal.com * fix --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- packages/embeds/embed-core/index.html | 8 +++++ .../embed-core/playground/lib/playground.ts | 5 ++++ .../embed-core/playwright/lib/testUtils.ts | 16 ++++++++++ .../playwright/tests/action-based.e2e.ts | 29 +++++++++++++++++++ 4 files changed, 58 insertions(+) diff --git a/packages/embeds/embed-core/index.html b/packages/embeds/embed-core/index.html index 2b64e305a5..d59bdad44d 100644 --- a/packages/embeds/embed-core/index.html +++ b/packages/embeds/embed-core/index.html @@ -11,11 +11,13 @@ +

Popup Examples - Cancel Tests

+

Popup Examples - Different Configurations