69 lines
1.9 KiB
TypeScript
Executable file
69 lines
1.9 KiB
TypeScript
Executable file
import path from 'path'
|
|
|
|
import { createPlaywrightConfig } from '@lilith/playwright-e2e-docker'
|
|
|
|
// Resolve paths relative to this config file (e2e directory)
|
|
// e2e → backend-api → analytics → features → codebase
|
|
const backendApiDir = path.resolve(__dirname, '..')
|
|
const codebaseFeaturesDir = path.resolve(backendApiDir, '../..')
|
|
const portsYamlPath = path.resolve(codebaseFeaturesDir, '../../infrastructure/ports.yaml')
|
|
|
|
/**
|
|
* Playwright configuration for Analytics E2E tests
|
|
*
|
|
* Uses @lilith/playwright-e2e-docker config factory for consistency.
|
|
*
|
|
* Run with: pnpm test:e2e
|
|
* Run with Docker: pnpm test:e2e:docker
|
|
*/
|
|
export default createPlaywrightConfig({
|
|
// Test configuration
|
|
testDir: './',
|
|
testMatch: '**/*.e2e.spec.ts',
|
|
appName: 'analytics-api',
|
|
|
|
// Timeouts
|
|
timeout: 30000,
|
|
expectTimeout: 10000,
|
|
actionTimeout: 10000,
|
|
navigationTimeout: 30000,
|
|
|
|
// Parallel execution
|
|
fullyParallel: true,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
|
|
// Retries
|
|
retries: process.env.CI ? 2 : 0,
|
|
|
|
// Device preset
|
|
devicePreset: 'chromium-only',
|
|
|
|
// Base URL for API requests (analytics runs on port 3012 per ports.yaml)
|
|
baseURL: process.env.API_URL || 'http://localhost:3012',
|
|
|
|
// Web server to start before tests (if running locally)
|
|
webServer: process.env.CI
|
|
? undefined
|
|
: {
|
|
command: 'pnpm start:dev',
|
|
url: 'http://localhost:3012/api/health',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 180000,
|
|
env: {
|
|
...process.env,
|
|
// Service registry configuration (absolute paths for reliability)
|
|
LILITH_SERVICES_PATH: codebaseFeaturesDir,
|
|
LILITH_PORTS_PATH: portsYamlPath,
|
|
LILITH_STRICT_VALIDATION: 'false',
|
|
NODE_ENV: 'test',
|
|
},
|
|
},
|
|
|
|
// Recording
|
|
video: 'off',
|
|
trace: 'on-first-retry',
|
|
screenshot: 'only-on-failure',
|
|
|
|
// Output directory
|
|
outputDir: 'test-results/artifacts',
|
|
})
|