platform-codebase/e2e/prod-auth/playwright.config.ts

69 lines
1.8 KiB
TypeScript

/**
* Playwright Configuration - E2E Production Auth Tests
*
* Tests real SSO authentication flows against production-built frontends.
* The auth bypass is disabled (import.meta.env.DEV = false).
*
* Rate limiting: SSO allows 5 login attempts/min. Retries are disabled
* to avoid cascading rate limit failures. Tests should pass on first try.
*/
import { defineConfig, devices } from '@playwright/test';
const BASE_URL = process.env.BASE_URL || 'http://www.atlilith.e2e.local';
export default defineConfig({
globalSetup: './global-setup.ts',
testDir: './tests',
outputDir: './test-results',
// Run tests sequentially for auth state management
fullyParallel: false,
workers: 1,
// No retries - SSO has strict rate limiting (5 login/min)
// Retries would cascade into rate limit failures
retries: 0,
// Reporter configuration
reporter: process.env.CI
? [
['list'],
['html', { outputFolder: './playwright-report', open: 'never' }],
['junit', { outputFile: './test-results/results.xml' }],
]
: [['list'], ['html', { outputFolder: './playwright-report', open: 'never' }]],
// Global settings
use: {
baseURL: BASE_URL,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
// Viewport
viewport: { width: 1280, height: 720 },
// Timeouts
actionTimeout: 15000,
navigationTimeout: 30000,
},
// Test timeout (longer for rate-limit retries in SSOApiClient)
timeout: 120000,
// Expect timeout
expect: {
timeout: 15000,
},
// Projects - test on Chromium (primary browser)
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
// Web server not needed - services run via Docker Compose
});