From 63a88efb5d6bdfd6cb612ba481414deaecc601da Mon Sep 17 00:00:00 2001 From: Pedro Ferreira <10789765+apedroferreira@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:44:42 +0000 Subject: [PATCH] Fix flaky authentication test: Wait for network idle in tests again (#3290) --- test/integration/auth/domain.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/auth/domain.spec.ts b/test/integration/auth/domain.spec.ts index 3a6a77b0a2c..f8c92e68e3c 100644 --- a/test/integration/auth/domain.spec.ts +++ b/test/integration/auth/domain.spec.ts @@ -60,8 +60,8 @@ test('Must be authenticated with valid domain to access app', async ({ page, req await page.waitForURL(/\/prod\/signin/); - // Wait for page content to render so that next CSRF request does not collide with ongoing auth requests - await expect(page.getByRole('button', { name: 'Sign in' })).toBeVisible(); + // Must wait for network to be idle or next CSRF request fails with "Failed to fetch", somehow due to the ongoing requests + await page.waitForLoadState('networkidle'); // Is redirected when unauthenticated await page.goto('/prod/pages/mypage');