Remove redundant timeout parameters across E2E tests and add performance optimization documentation.

- Reduced E2E test execution time by removing unnecessary `{ timeout: 10000 }` overrides for assertions and element waits, relying on global `expect` configuration.
- Removed redundant `networkidle` wait states for faster form render validations.
- Documented comprehensive performance optimization strategies in `E2E_PERFORMANCE_OPTIMIZATION.md`.
- Added `E2E_COVERAGE_GUIDE.md` for integrating and merging E2E test coverage with unit test coverage.
This commit is contained in:
2025-11-09 00:30:56 +01:00
parent a6a10855fa
commit d5eb855ae1
15 changed files with 1024 additions and 107 deletions

View File

@@ -96,10 +96,10 @@ test.describe('Login Flow', () => {
const passwordInput = page.locator('input[name="password"]');
const submitButton = page.locator('button[type="submit"]');
await expect(emailInput).toBeVisible({ timeout: 10000 });
await expect(passwordInput).toBeVisible({ timeout: 10000 });
await expect(submitButton).toBeVisible({ timeout: 10000 });
await expect(submitButton).toBeEnabled({ timeout: 10000 });
await expect(emailInput).toBeVisible();
await expect(passwordInput).toBeVisible();
await expect(submitButton).toBeVisible();
await expect(submitButton).toBeEnabled();
// Touch fields to mimic user interaction
await emailInput.focus();
@@ -111,8 +111,8 @@ test.describe('Login Flow', () => {
await submitButton.click();
// Wait for validation errors - allow extra time for slower browsers
await expect(page.locator('#email-error')).toBeVisible({ timeout: 10000 });
await expect(page.locator('#password-error')).toBeVisible({ timeout: 10000 });
await expect(page.locator('#email-error')).toBeVisible();
await expect(page.locator('#password-error')).toBeVisible();
// Verify error messages
await expect(page.locator('#email-error')).toContainText('Email is required');
@@ -163,7 +163,7 @@ test.describe('Login Flow', () => {
const forgotLink = page.getByRole('link', { name: 'Forgot password?' });
await Promise.all([
page.waitForURL('/password-reset', { timeout: 10000 }),
page.waitForURL('/password-reset'),
forgotLink.click()
]);
@@ -177,7 +177,7 @@ test.describe('Login Flow', () => {
const signupLink = page.getByRole('link', { name: 'Sign up' });
await Promise.all([
page.waitForURL('/register', { timeout: 10000 }),
page.waitForURL('/register'),
signupLink.click()
]);