import { defineConfig, devices } from '@playwright/test'; // E2E against the production build served by the real server. // Run `npm run build` first. Uses a throwaway data dir per run. // Set E2E_BASE_URL to test an already running deployment instead (e.g. the // compose stack: E2E_BASE_URL=https://localhost:8483). const external = process.env.E2E_BASE_URL; const port = 8490; const dataDir = `${process.env.TMPDIR ?? '/tmp'}/oweme-e2e-${Date.now()}`; export default defineConfig({ testDir: 'e2e', timeout: 90_000, fullyParallel: false, workers: 1, reporter: [['list']], use: { baseURL: external ?? `http://127.0.0.1:${port}`, ignoreHTTPSErrors: !!external, trace: 'retain-on-failure' }, projects: [ { name: 'mobile-chromium', use: { ...devices['Pixel 7'] } }, ], webServer: external ? undefined : { command: 'node --disable-warning=ExperimentalWarning apps/server/src/main.ts', url: `http://127.0.0.1:${port}/api/health`, reuseExistingServer: false, env: { PORT: String(port), DATA_DIR: dataDir, STATIC_DIR: 'apps/web/dist', GROUP_CREATE_PER_HOUR: '100' }, }, });