From 784a91709cb6b9251e6256303a6b27c6a8ff4a1b Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 10 May 2022 22:46:22 -0600 Subject: [PATCH] Update dynamic-booking-pages.test.ts --- apps/web/playwright/dynamic-booking-pages.test.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/web/playwright/dynamic-booking-pages.test.ts b/apps/web/playwright/dynamic-booking-pages.test.ts index ec3a3fb037..fe0c257603 100644 --- a/apps/web/playwright/dynamic-booking-pages.test.ts +++ b/apps/web/playwright/dynamic-booking-pages.test.ts @@ -1,4 +1,4 @@ -import { Page, test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; import { deleteAllBookingsByEmail } from "./lib/teardown"; import { @@ -28,13 +28,7 @@ test.describe("dynamic booking", () => { await page.click('[data-testid="event-type-link"]'); await selectFirstAvailableTimeSlotNextMonth(page); await bookTimeSlot(page); - - // Make sure we're navigated to the success page - await page.waitForNavigation({ - url(url) { - return url.pathname.endsWith("/success"); - }, - }); + await expect(page.locator("[data-testid=success-page]")).toBeVisible(); }); test("can reschedule a booking", async ({ page }) => { @@ -58,6 +52,7 @@ test.describe("dynamic booking", () => { return url.pathname === "/success" && url.searchParams.get("reschedule") === "true"; }, }); + await expect(page.locator("[data-testid=success-page]")).toBeVisible(); }); test("Can cancel the recently created booking", async ({ page }) => {