forked from cardosofelipe/fast-next-template
Refactor Playwright tests to use cached authentication state for improved performance
- Removed redundant `loginViaUI` calls across E2E tests, leveraging cached storage state for faster test execution. - Enhanced Playwright configuration to include a `setup` project for pre-caching admin and regular user authentication states. - Added new `auth.setup.ts` to handle initial authentication and save storage states to `.auth` directory. - Increased local worker count to 16 (CI unchanged) to optimize parallel execution. - Updated `.gitignore` to exclude authentication state files.
This commit is contained in:
@@ -12,7 +12,7 @@ test.describe('Password Change', () => {
|
||||
await setupAuthenticatedMocks(page);
|
||||
|
||||
// Login via UI to establish authenticated session
|
||||
await loginViaUI(page);
|
||||
// Auth already cached in storage state (loginViaUI removed for performance)
|
||||
|
||||
// Navigate to password page
|
||||
await page.goto('/settings/password', { waitUntil: 'networkidle' });
|
||||
|
||||
Reference in New Issue
Block a user