ci: Fix fetch() error, improvements to booking-seats test (#9203)

pull/9198/head^2
Alex van Andel 2023-05-30 15:52:07 +02:00 committed by GitHub
parent feb31fae6e
commit 9b9defc0f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 326 additions and 332 deletions

View File

@ -99,6 +99,7 @@ testBothBookers.describe("Booking with Seats", (bookerVariant) => {
// todo("Attendee #1 should be able to reschedule his booking");
// TODO: Make E2E test: All attendees canceling should delete the booking for the User
// todo("All attendees canceling should delete the booking for the User");
});
testBothBookers.describe("Reschedule for booking with seats", () => {
test("Should reschedule booking with seats", async ({ page, users, bookings }) => {
@ -154,10 +155,11 @@ testBothBookers.describe("Booking with Seats", (bookerVariant) => {
expect(oldBooking?.seatsReferences.length).toBe(2);
});
// FIXME: https://github.com/calcom/cal.com/issues/9193
test.fixme(
"Should reschedule booking with seats and if everyone rescheduled it should be deleted",
async ({ page, users, bookings }) => {
test("Should reschedule booking with seats and if everyone rescheduled it should be deleted", async ({
page,
users,
bookings,
}) => {
const { booking } = await createUserWithSeatedEventAndAttendees({ users, bookings }, [
{ name: "John First", email: "first+seats@cal.com", timeZone: "Europe/Berlin" },
{ name: "Jane Second", email: "second+seats@cal.com", timeZone: "Europe/Berlin" },
@ -213,14 +215,9 @@ testBothBookers.describe("Booking with Seats", (bookerVariant) => {
});
expect(oldBooking?.status).toBe(BookingStatus.CANCELLED);
}
);
});
test("Should cancel with seats and have no attendees and cancelled", async ({
page,
users,
bookings,
}) => {
test("Should cancel with seats and have no attendees and cancelled", async ({ page, users, bookings }) => {
const { user, booking } = await createUserWithSeatedEventAndAttendees({ users, bookings }, [
{ name: "John First", email: "first+seats@cal.com", timeZone: "Europe/Berlin" },
{ name: "Jane Second", email: "second+seats@cal.com", timeZone: "Europe/Berlin" },
@ -427,6 +424,7 @@ testBothBookers.describe("Booking with Seats", (bookerVariant) => {
'p[data-testid="attendee-email-second+seats@cal.com"]'
);
await expect(foundSecondAttendeeAsOwner).toHaveCount(1);
await page.goto("auth/logout");
// Now we cancel the booking as the first attendee
@ -436,9 +434,7 @@ testBothBookers.describe("Booking with Seats", (bookerVariant) => {
);
// No attendees should be displayed only the one that it's cancelling
const notFoundSecondAttendee = await page.locator(
'p[data-testid="attendee-email-second+seats@cal.com"]'
);
const notFoundSecondAttendee = await page.locator('p[data-testid="attendee-email-second+seats@cal.com"]');
await expect(notFoundSecondAttendee).toHaveCount(0);
const foundFirstAttendee = await page.locator('p[data-testid="attendee-email-first+seats@cal.com"]');
@ -467,4 +463,3 @@ testBothBookers.describe("Booking with Seats", (bookerVariant) => {
await expect(foundFirstAttendeeAgain).toHaveCount(1);
});
});
});

View File

@ -178,7 +178,7 @@ test.describe("Embed Code Generator Tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto(`/event-types`);
await Promise.all([
page.locator('[href*="/event-types/"]').first().click(),
page.locator('a[href*="/event-types/"]').first().click(),
page.waitForURL((url) => url.pathname.startsWith("/event-types/")),
]);
});

View File

@ -35,11 +35,9 @@ test.describe("user can login & logout succesfully", async () => {
const signOutBtn = await page.locator(`text=${signOutLabel}`);
await signOutBtn.click();
// 2s of delay to assure the session is cleared
await page.waitForURL("/auth/logout");
await page.locator('a[href="/auth/login"]').click();
// Reroute to the home page to check if the login form shows up
await page.goto("/");
await expect(page.locator(`[data-testid=login-form]`)).toBeVisible();
});
});

View File

@ -11,8 +11,8 @@ const outputDir = path.join(__dirname, "test-results");
// Dev Server on local can be slow to start up and process requests. So, keep timeouts really high on local, so that tests run reliably locally
// So, if not in CI, keep the timers high, if the test is stuck somewhere and there is unnecessary wait developer can see in browser that it's stuck
const DEFAULT_NAVIGATION_TIMEOUT = process.env.CI ? 15000 : 120000;
const DEFAULT_EXPECT_TIMEOUT = process.env.CI ? 15000 : 120000;
const DEFAULT_NAVIGATION_TIMEOUT = process.env.CI ? 30000 : 120000;
const DEFAULT_EXPECT_TIMEOUT = process.env.CI ? 30000 : 120000;
// Test Timeout can hit due to slow expect, slow navigation.
// So, it should me much higher than sum of expect and navigation timeouts as there can be many async expects and navigations in a single test
@ -25,7 +25,8 @@ const IS_EMBED_REACT_TEST = process.argv.some((a) => a.startsWith("--project=@ca
const webServer: PlaywrightTestConfig["webServer"] = [
{
command: "NEXT_PUBLIC_IS_E2E=1 yarn workspace @calcom/web start -p 3000",
command:
"NEXT_PUBLIC_IS_E2E=1 NODE_OPTIONS='--dns-result-order=ipv4first' yarn workspace @calcom/web start -p 3000",
port: 3000,
timeout: 60_000,
reuseExistingServer: !process.env.CI,