Skip to content

Commit a0b2ccb

Browse files
mchestrclaude
andcommitted
fix: improve E2E test stability for onboarding page check
- Wait for network idle and loading screen before checking page state - Add proper timeouts to element visibility assertions Co-Authored-By: Claude <[email protected]>
1 parent 7f40943 commit a0b2ccb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

e2e/public-flows.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ test.describe('Public Flows', () => {
5151
});
5252

5353
test('onboarding page accessibility check', async ({ page }) => {
54-
5554
await page.goto('/onboarding');
5655

56+
// Wait for any redirects to complete
57+
await page.waitForLoadState('networkidle');
58+
await waitForLoadingGone(page);
59+
5760
const isHome = page.url().endsWith('/');
5861
const isSignin = page.url().includes('signin');
5962
const isOnboarding = page.url().includes('/onboarding');
6063

6164
if (isOnboarding) {
6265
// If we stay on onboarding, verify the wizard is visible
63-
await expect(page.getByTestId('onboarding-wizard-heading')).toBeVisible();
64-
await expect(page.getByTestId('onboarding-wizard-subheading')).toBeVisible();
66+
await expect(page.getByTestId('onboarding-wizard-heading')).toBeVisible({ timeout: WAIT_TIMEOUTS.PAGE_CONTENT });
67+
await expect(page.getByTestId('onboarding-wizard-subheading')).toBeVisible({ timeout: WAIT_TIMEOUTS.PAGE_CONTENT });
6568
} else {
6669
// If redirected, ensure we are on a safe page
6770
expect(isHome || isSignin).toBeTruthy();

0 commit comments

Comments
 (0)