Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions apps/web/playwright/booking-seats.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,10 @@ test.describe("Reschedule for booking with seats", () => {
data: bookingSeats,
});

const references = await prisma.bookingSeat.findMany({
where: { bookingId: booking.id },
orderBy: { id: "asc" },
const secondAttendeeId = bookingAttendees.find((attendee)=> attendee.email === "second+seats@cal.com");

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

const secondUser = await users.create({
Expand All @@ -556,13 +557,14 @@ test.describe("Reschedule for booking with seats", () => {
await page.waitForSelector('[data-testid="bookings"]');

await page.locator('[data-testid="booking-actions-dropdown"]').nth(0).click();
const href = await page.locator('[data-testid="reschedule"]').getAttribute("href");
expect(href).toBeTruthy();
const url = new URL(href!, page.url());
const seatReferenceUid = url.searchParams.get('seatReferenceUid');
expect(seatReferenceUid).toBeTruthy();
expect(seatReferenceUid).toBe(references?.referenceUid);
await page.locator('[data-testid="reschedule"]').click();

await page.waitForURL((url) => {
const rescheduleUid = url.searchParams.get("rescheduleUid");
return !!rescheduleUid && rescheduleUid === references[1].referenceUid;
});

await selectFirstAvailableTimeSlotNextMonth(page);

const nameElement = page.locator("input[name=name]");
Expand Down
3 changes: 2 additions & 1 deletion apps/web/playwright/fixtures/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function createAppsFixture(page: Page) {
},
goToAppsTab: async () => {
await page.getByTestId("vertical-tab-apps").click();
await expect(page.getByTestId("vertical-tab-apps")).toHaveAttribute("aria-current", "page");
},
activeApp: async (app: string) => {
await page.locator(`[data-testid='${app}-app-switch']`).click();
Expand All @@ -126,7 +127,7 @@ export function createAppsFixture(page: Page) {
},
verifyAppsInfoNew: async (app: string, eventTypeId: number) => {
await page.goto(`event-types/${eventTypeId}?tabName=apps`);
await expect(page.getByTestId("vertical-tab-basics")).toContainText("Basics"); // fix the race condition
await expect(page.getByTestId("vertical-tab-apps")).toHaveAttribute("aria-current", "page"); // fix the race condition
await expect(page.locator(`[data-testid='${app}-app-switch'][data-state="checked"]`)).toBeVisible();
},
};
Expand Down
14 changes: 8 additions & 6 deletions apps/web/playwright/out-of-office.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,12 @@ test.describe("Out of office", () => {
test("Default date range filter set to `Last 7 Days`", async ({ page, users }) => {
const user = await users.create({ name: `userOne=${Date.now()}` });
await user.apiLogin();
await page.goto("/settings/my-account/out-of-office");
await page.waitForLoadState("domcontentloaded");
await page.waitForResponse(
const responsePromise = page.waitForResponse(
(response) => response.url().includes("outOfOfficeEntriesList") && response.status() === 200
);
await page.goto("/settings/my-account/out-of-office");
await page.waitForLoadState("domcontentloaded");
await responsePromise;
await addFilter(page, "dateRange");
await expect(
page.locator('[data-testid="filter-popover-trigger-dateRange"]', { hasText: "Last 7 Days" }).first()
Expand All @@ -667,11 +668,12 @@ test.describe("Out of office", () => {
test("Can choose date range presets", async ({ page, users }) => {
const user = await users.create({ name: `userOne=${Date.now()}` });
await user.apiLogin();
await page.goto("/settings/my-account/out-of-office");
await page.waitForLoadState("domcontentloaded");
await page.waitForResponse(
const responsePromise = page.waitForResponse(
(response) => response.url().includes("outOfOfficeEntriesList") && response.status() === 200
);
await page.goto("/settings/my-account/out-of-office");
await page.waitForLoadState("domcontentloaded");
await responsePromise;
await addFilter(page, "dateRange");

await expect(page.locator('[data-testid="date-range-options-tdy"]')).toBeVisible(); //Today
Expand Down
22 changes: 14 additions & 8 deletions apps/web/playwright/payment-apps.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { expect } from "@playwright/test";

import prisma from "@calcom/prisma";
import type { Page } from "@playwright/test";

import { test } from "./lib/fixtures";
import { selectFirstAvailableTimeSlotNextMonth, submitAndWaitForResponse } from "./lib/testUtils";

test.describe.configure({ mode: "parallel" });
test.afterEach(({ users }) => users.deleteAll());

async function goToAppsTab(page: Page, eventTypeId?: number) {
await page.goto(`event-types/${eventTypeId}?tabName=apps`);
await expect(page.getByTestId("vertical-tab-apps")).toHaveAttribute("aria-current", "page");
}

test.describe("Payment app", () => {
test("Should be able to edit alby price, currency", async ({ page, users }) => {
const user = await users.create();
Expand All @@ -29,7 +35,7 @@ test.describe("Payment app", () => {
},
});

await page.goto(`event-types/${paymentEvent?.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.locator("#event-type-form").getByRole("switch").click();
await page.getByPlaceholder("Price").click();
Expand Down Expand Up @@ -75,7 +81,7 @@ test.describe("Payment app", () => {
},
});

await page.goto(`event-types/${paymentEvent?.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);
await page.locator("#event-type-form").getByRole("switch").click();
await page.getByTestId("stripe-currency-select").click();
await page.getByTestId("select-option-usd").click();
Expand Down Expand Up @@ -115,7 +121,7 @@ test.describe("Payment app", () => {
},
});

await page.goto(`event-types/${paymentEvent?.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.locator("#event-type-form").getByRole("switch").click();

Expand Down Expand Up @@ -158,7 +164,7 @@ test.describe("Payment app", () => {
},
});

await page.goto(`event-types/${paymentEvent?.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.locator("#event-type-form").getByRole("switch").click();

Expand All @@ -185,7 +191,7 @@ test.describe("Payment app", () => {
},
});

await page.goto(`event-types/${paymentEvent?.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.locator("#event-type-form").getByRole("switch").click();

Expand Down Expand Up @@ -220,7 +226,7 @@ test.describe("Payment app", () => {
},
});

await page.goto(`event-types/${paymentEvent?.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.locator("#event-type-form").getByRole("switch").click();
// make sure Tracking ID is displayed
Expand Down Expand Up @@ -267,7 +273,7 @@ test.describe("Payment app", () => {
],
});

await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.locator("[data-testid='paypal-app-switch']").click();
await page.locator("[data-testid='stripe-app-switch']").isDisabled();
Expand Down Expand Up @@ -314,7 +320,7 @@ test.describe("Payment app", () => {
],
});

await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
await goToAppsTab(page, paymentEvent?.id);

await page.getByTestId("paypal-app-switch").click();
await page.getByTestId("paypal-price-input").fill("100");
Expand Down
Loading