Skip to content

Commit

Permalink
Fix flaky authentication test: Wait for network idle in tests again (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira authored Mar 13, 2024
1 parent 602ec5d commit 63a88ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/integration/auth/domain.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 63a88ef

Please sign in to comment.