Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
anikdhabal committed Feb 14, 2025
1 parent c55a737 commit 69b3310
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 7 additions & 7 deletions apps/web/playwright/event-types.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,10 @@ test.describe("Event Types tests", () => {
await saveEventType(page);
await gotoBookingPage(page);
await selectFirstAvailableTimeSlotNextMonth(page);

await page.waitForLoadState("networkidle");

await page.locator(`[data-fob-field-name="location"] input`).waitFor();
await page.locator(`[data-fob-field-name="location"] input`).fill("919999999999");
await page.waitForResponse(
(res) => res.url().includes("/api/trpc/public/countryCode?batch=1") && res.status() === 200
);
await page.locator(`[data-fob-field-name="location"] input`).fill("19199999999");
await bookTimeSlot(page);

await expect(page.locator("[data-testid=success-page]")).toBeVisible();
Expand All @@ -221,8 +220,9 @@ test.describe("Event Types tests", () => {

await page.getByTestId("location-select").click();
await page.locator(`text="Organizer Phone Number"`).click();

await page.waitForLoadState("networkidle");
await page.waitForResponse(
(res) => res.url().includes("/api/trpc/public/countryCode?batch=1") && res.status() === 200
);
const locationInputName = "locations[0].hostPhoneNumber";
await page.locator(`input[name="${locationInputName}"]`).waitFor();
await page.locator(`input[name="${locationInputName}"]`).fill("19199999999");
Expand Down
3 changes: 3 additions & 0 deletions apps/web/playwright/lib/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ export const bookTimeSlot = async (
await page.fill('[name="title"]', opts.title);
}
if (opts?.attendeePhoneNumber) {
await page.waitForResponse(
(res) => res.url().includes("/api/trpc/public/countryCode?batch=1") && res.status() === 200
);
await page.fill('[name="attendeePhoneNumber"]', opts.attendeePhoneNumber ?? "+918888888888");
}
await submitAndWaitForResponse(page, "/api/book/event", {
Expand Down

0 comments on commit 69b3310

Please sign in to comment.