test: few more e2e flakes (#26278)

* test: few more e2e flakes

* fix another
This commit is contained in:
Anik Dhabal Babu
2025-12-29 19:58:15 -03:00
committed by GitHub
parent 7c373ddad6
commit ff9d88479c
7 changed files with 25 additions and 21 deletions
@@ -24,6 +24,7 @@ test.describe("Can signup from a team invite", async () => {
email: `${proUser.username}-member@example.com`,
};
await page.goto("/settings/teams/new");
await page.waitForLoadState("networkidle");
// Create a new team
await page.locator('input[name="name"]').fill(teamName);
+2 -2
View File
@@ -113,7 +113,7 @@ test.describe("Availability", () => {
test("Schedule listing", async ({ page }) => {
await test.step("Can add a new schedule", async () => {
await page.getByTestId("new-schedule").click();
await page.getByTestId("new-schedule").first().click();
await page.locator('[id="name"]').fill("More working hours");
page.locator('[type="submit"]').click();
await expect(page.getByTestId("availablity-title")).toHaveValue("More working hours");
@@ -149,7 +149,7 @@ test.describe("Availability", () => {
await page.getByTestId("availablity-title").click();
// change availability name
await page.getByTestId("availablity-title").fill("Working Hours test");
await expect(page.getByTestId("subtitle")).toBeVisible();
await expect(page.getByTestId("subtitle").first()).toBeVisible();
await page.getByTestId(sunday).getByRole("switch").click();
await page.getByTestId(monday).first().click();
await page.getByTestId(wednesday).getByRole("switch").click();
+13 -5
View File
@@ -449,19 +449,27 @@ test.describe("prefill", () => {
test.describe("Booking on different layouts", () => {
test.beforeEach(async ({ page, users }) => {
const user = await users.create();
// Create user with specific availability (9 AM - 5 PM UTC, Monday-Friday)
// This ensures slots are available and reduces race conditions
const dateRanges: TimeRange = {
start: new Date(new Date().setUTCHours(9, 0, 0, 0)),
end: new Date(new Date().setUTCHours(17, 0, 0, 0)),
};
const schedule: Schedule = [[], [dateRanges], [dateRanges], [dateRanges], [dateRanges], [dateRanges], []];
const user = await users.create({ schedule });
await page.goto(`/${user.username}`);
});
test("Book on week layout", async ({ page }) => {
// Click first event type
await page.click('[data-testid="event-type-link"]');
await page.locator('[data-testid="event-type-link"]').first().click();
await page.click('[data-testid="toggle-group-item-week_view"]');
await page.click('[data-testid="incrementMonth"]');
await page.locator('[data-testid="calendar-empty-cell"]').nth(0).click();
await page.locator('[data-testid="calendar-empty-cell"]').nth(1).click();
// Fill what is this meeting about? name email and notes
await page.locator('[name="name"]').fill("Test name");
@@ -476,13 +484,13 @@ test.describe("Booking on different layouts", () => {
test("Book on column layout", async ({ page }) => {
// Click first event type
await page.click('[data-testid="event-type-link"]');
await page.locator('[data-testid="event-type-link"]').first().click();
await page.click('[data-testid="toggle-group-item-column_view"]');
await page.click('[data-testid="incrementMonth"]');
await page.locator('[data-testid="time"]').nth(0).click();
await page.locator('[data-testid="time"]').nth(1).click();
// Fill what is this meeting about? name email and notes
await page.locator('[name="name"]').fill("Test name");
+5 -11
View File
@@ -39,9 +39,7 @@ test.describe("Locale-specific pages must not 404", () => {
await user.apiLogin();
const response = await page.goto(`/${locale}/event-types`);
expect(response?.status()).not.toBe(404);
await expect(
page.locator("text=Create events to share for people to book on your calendar.")
).toBeVisible();
await expect(page.getByTestId("subtitle").first()).toBeVisible();
});
test(`/${locale}/availability page shouldn't 404`, async ({ page, users }) => {
@@ -49,7 +47,7 @@ test.describe("Locale-specific pages must not 404", () => {
await user.apiLogin();
const response = await page.goto(`/${locale}/availability`);
expect(response?.status()).not.toBe(404);
await expect(page.locator("text=Configure times when you are available for bookings.")).toBeVisible();
await expect(page.getByTestId("subtitle").first()).toBeVisible();
});
test(`/${locale}/bookings/upcoming page shouldn't 404`, async ({ page, users }) => {
@@ -65,9 +63,7 @@ test.describe("Locale-specific pages must not 404", () => {
await user.apiLogin();
const response = await page.goto(`/${locale}/teams`);
expect(response?.status()).not.toBe(404);
await expect(
page.locator("text=Create and manage teams to use collaborative features.")
).toBeVisible();
await expect(page.getByTestId("subtitle").first()).toBeVisible();
});
test(`/${locale}/routing page shouldn't 404`, async ({ page, users }) => {
@@ -75,9 +71,7 @@ test.describe("Locale-specific pages must not 404", () => {
await user.apiLogin();
const response = await page.goto(`/${locale}/routing`);
expect(response?.status()).not.toBe(404);
await expect(
page.locator("text=Create forms to direct attendees to the correct destinations")
).toBeVisible();
await expect(page.getByTestId("subtitle").first()).toBeVisible();
});
test(`/${locale}/insights page shouldn't 404`, async ({ page, users }) => {
@@ -85,7 +79,7 @@ test.describe("Locale-specific pages must not 404", () => {
await user.apiLogin();
const response = await page.goto(`/${locale}/insights`);
expect(response?.status()).not.toBe(404);
await expect(page.locator("text=View booking insights across your events")).toBeVisible();
await expect(page.getByTestId("subtitle").first()).toBeVisible();
});
});
}
@@ -57,7 +57,7 @@ test.describe("Organization - Privacy", () => {
await secondPage.goto(`/settings/organizations/${org.slug}/members`);
await secondPage.waitForLoadState("domcontentloaded");
const userDataTable = secondPage.getByTestId("user-list-data-table").first();
const membersPrivacyWarning = secondPage.getByTestId("members-privacy-warning");
const membersPrivacyWarning = secondPage.getByTestId("members-privacy-warning").first();
await expect(userDataTable).toBeHidden();
await expect(membersPrivacyWarning).toBeVisible();
await secondContext.close();
@@ -28,7 +28,7 @@ test.describe("Teams", () => {
await test.step("Can create team", async () => {
// Click text=Create Team
await page.locator("text=Create a new Team").click();
await page.waitForURL((url) => url.pathname === "/settings/teams/new");
await page.waitForLoadState("networkidle");
// Fill input[name="name"]
await page.locator('input[name="name"]').fill(`${user.username}'s Team`);
// Click text=Continue
+2 -1
View File
@@ -141,6 +141,7 @@ test.describe("Teams - NonOrg", () => {
// Go directly to the create team page
await page.goto("/settings/teams/new");
await page.waitForLoadState("networkidle");
// Fill input[name="name"]
await page.locator('input[name="name"]').fill(uniqueName);
await page.click("[type=submit]");
@@ -161,7 +162,7 @@ test.describe("Teams - NonOrg", () => {
await test.step("Can create team with same name", async () => {
// Click text=Create Team
await page.locator("text=Create Team").click();
await page.waitForURL("/settings/teams/new");
await page.waitForLoadState("networkidle");
// Fill input[name="name"]
await page.locator('input[name="name"]').fill(uniqueName);
// Click text=Continue