From 24c5d4c78c18f4a4864b0f4acee2d486ca307caf Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Fri, 9 May 2025 12:55:27 -0600 Subject: [PATCH] Update waits for problematic tests --- web/playwright-tests/dashboard-updates.test.ts | 8 +++++++- web/playwright-tests/invite-user.test.ts | 13 ++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/web/playwright-tests/dashboard-updates.test.ts b/web/playwright-tests/dashboard-updates.test.ts index 1899b5706..f1bee1b8d 100644 --- a/web/playwright-tests/dashboard-updates.test.ts +++ b/web/playwright-tests/dashboard-updates.test.ts @@ -6,6 +6,9 @@ test('Go to dashboard', async ({ page }) => { await expect(page.getByRole('button', { name: 'New dashboard' })).toBeVisible(); await expect(page.getByRole('button', { name: '12px star' })).toBeVisible(); await page.getByRole('link', { name: 'Important Metrics 12px star' }).click(); + await page.waitForTimeout(100); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); await expect(page.getByRole('textbox', { name: 'New dashboard' })).toHaveValue( 'Important Metrics' ); @@ -152,9 +155,12 @@ test('Can edit name and description of a dashboard', async ({ page }) => { await page.waitForLoadState('networkidle'); await page.getByTestId('segmented-trigger-file').click(); await page.getByTestId('segmented-trigger-file').click(); + await page.waitForTimeout(1000); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); await expect(page.getByRole('code').getByText('Important Metrics SWAG')).toBeVisible({ - timeout: 5000 + timeout: 22000 }); await expect(page.locator('.current-line').first()).toBeVisible(); await page.getByTestId('segmented-trigger-dashboard').click(); diff --git a/web/playwright-tests/invite-user.test.ts b/web/playwright-tests/invite-user.test.ts index efb2bf4ee..ef24e92bc 100644 --- a/web/playwright-tests/invite-user.test.ts +++ b/web/playwright-tests/invite-user.test.ts @@ -12,11 +12,16 @@ test('Invite User', async ({ page }) => { .getByRole('textbox', { name: 'buster@bluthbananas.com,' }) .fill('nate+integration-test@buser.so'); await page.getByRole('button', { name: 'Send invites' }).click(); + await page.waitForTimeout(100); await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); await expect(page.getByText('Invites sent').first()).toBeVisible({ timeout: 3000 }); await page.getByRole('button').filter({ hasText: /^$/ }).first().click(); await page.getByRole('link', { name: 'Users' }).click(); + await page.waitForTimeout(1000); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); await expect(page.getByRole('link', { name: 'nate+integration-test@buser.' })).toBeVisible(); await expect(page.getByRole('main')).toMatchAriaSnapshot(` - img @@ -24,13 +29,18 @@ test('Invite User', async ({ page }) => { `); await page.getByRole('link', { name: 'nate+integration-test@buser.' }).click(); - + await page.waitForTimeout(100); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); await expect(page.getByText('nate+integration-test@buser.so')).toBeVisible(); }); test('Can change user role', async ({ page }) => { await page.goto('http://localhost:3000/app/settings/users'); await page.getByRole('link', { name: 'B blake blake@buster.so' }).click(); + await page.waitForTimeout(1000); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); await expect(page.getByText('blake@buster.so')).toBeVisible(); await expect(page.getByRole('combobox')).toHaveText(/Querier/); await page.getByRole('combobox').click(); @@ -51,4 +61,5 @@ test('Can change user role', async ({ page }) => { ).toBeVisible(); await page.waitForTimeout(15); await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); });