refactor: update e2e tests to use 'load' state for page navigation

- Changed instances of `waitForLoadState('networkidle')` to `waitForLoadState('load')` across multiple test files and utility functions to improve test reliability in applications with persistent connections.
- Added documentation to the e2e testing guide explaining the rationale behind using 'load' state instead of 'networkidle' to prevent timeouts and flaky tests.
This commit is contained in:
Test User
2025-12-22 17:16:55 -05:00
parent c4df2c141a
commit 036a7d9d26
6 changed files with 55 additions and 16 deletions

View File

@@ -27,7 +27,7 @@ test.describe('Project Creation', () => {
await setupWelcomeView(page, { workspaceDir: TEST_TEMP_DIR });
await page.goto('/');
await page.waitForLoadState('networkidle');
await page.waitForLoadState('load');
await expect(page.locator('[data-testid="welcome-view"]')).toBeVisible({ timeout: 10000 });

View File

@@ -75,7 +75,7 @@ test.describe('Open Project', () => {
// Navigate to the app
await page.goto('/');
await page.waitForLoadState('networkidle');
await page.waitForLoadState('load');
// Wait for welcome view to be visible
await expect(page.locator('[data-testid="welcome-view"]')).toBeVisible({ timeout: 10000 });