test(frontend): add real-auth Playwright e2e suite

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 21:55:10 +03:00
parent 0ef7728ac0
commit d2f044db07
5 changed files with 182 additions and 4 deletions

View File

@@ -1,6 +1,31 @@
import { defineConfig } from '@playwright/test';
// e2e runs against the dev server (vite :5173), which proxies /api to a backend
// instance pointed at the isolated `loft_test` database (see .env.test).
export default defineConfig({
webServer: { command: 'npm run build && npm run preview', port: 4173 },
testMatch: '**/*.e2e.{ts,js}'
testDir: './e2e',
testMatch: '**/*.e2e.{ts,js}',
fullyParallel: false,
workers: 1,
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry'
},
webServer: [
{
// backend on :3000, pointed at the test DB via .env.test
command: 'cd ../backend && set -a && . ./.env.test && set +a && cargo run',
url: 'http://localhost:3000/health',
reuseExistingServer: true,
timeout: 180_000,
stdout: 'pipe',
stderr: 'pipe'
},
{
command: 'pnpm dev',
url: 'http://localhost:5173',
reuseExistingServer: true,
timeout: 60_000
}
]
});