From cdc3c49b23f67c6778d06697ae7bc1e8eef627e9 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Thu, 30 Jan 2025 17:08:36 +0530 Subject: [PATCH] fix: few flaky e2e tests (#19010) * fix: flaky test organization.spec * fix: few flaky tests * Update apps.ts * Update apps.ts * Update testUtils.ts --- apps/web/playwright/fixtures/apps.ts | 4 ++++ apps/web/playwright/lib/testUtils.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/apps/web/playwright/fixtures/apps.ts b/apps/web/playwright/fixtures/apps.ts index 1822a098da..bda5c11c70 100644 --- a/apps/web/playwright/fixtures/apps.ts +++ b/apps/web/playwright/fixtures/apps.ts @@ -18,6 +18,8 @@ export function createAppsFixture(page: Page) { installAnalyticsAppSkipConfigure: async (app: string) => { await page.getByTestId(`app-store-app-card-${app}`).click(); await page.getByTestId("install-app-button").click(); + await page.waitForURL(`apps/installation/accounts?slug=${app}`); + await page.reload(); await page.click('[data-testid="install-app-button-personal"]'); await page.waitForURL(`apps/installation/event-types?slug=${app}`); await page.click('[data-testid="set-up-later"]'); @@ -25,6 +27,8 @@ export function createAppsFixture(page: Page) { installAnalyticsApp: async (app: string, eventTypeIds: number[]) => { await page.getByTestId(`app-store-app-card-${app}`).click(); (await page.waitForSelector('[data-testid="install-app-button"]')).click(); + await page.waitForURL(`apps/installation/accounts?slug=${app}`); + await page.reload(); await page.click('[data-testid="install-app-button-personal"]'); await page.waitForURL(`apps/installation/event-types?slug=${app}`); diff --git a/apps/web/playwright/lib/testUtils.ts b/apps/web/playwright/lib/testUtils.ts index 0552d6bdec..a752cb9a64 100644 --- a/apps/web/playwright/lib/testUtils.ts +++ b/apps/web/playwright/lib/testUtils.ts @@ -221,6 +221,7 @@ export async function setupManagedEvent({ export const createNewSeatedEventType = async (page: Page, args: { eventTitle: string }) => { const eventTitle = args.eventTitle; await createNewEventType(page, { eventTitle }); + await page.waitForSelector('[data-testid="event-title"]'); await page.locator('[data-testid="vertical-tab-event_advanced_tab_title"]').click(); await page.locator('[data-testid="offer-seats-toggle"]').click(); await page.locator('[data-testid="update-eventtype"]').click();