mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-08-28 02:44:59 +00:00
Backend tests (9 new files): - summary-service, metrics-helpers, template-service - status-history-service, trace-service, diff-service - conflict-service, preview-service, digest-service - Coverage: 44.27% → 53.52% (897 tests passing) E2E tests (fixed + hardened): - Removed debug spec left by sub-agent - API seed calls now hit backend directly (port 3001) to avoid IPv6/Vite proxy issues on macOS - task-status tests use unique names (prevent strict mode) - Added waitForResponse for status change assertions - Enabled webServer auto-start in playwright.config.ts - All 19 E2E tests passing
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
import { readFileSync } from 'fs';
|
|
import { resolve } from 'path';
|
|
|
|
// Load VERITAS_ADMIN_KEY from server/.env so E2E tests use the same key as the server
|
|
if (!process.env.VERITAS_ADMIN_KEY) {
|
|
try {
|
|
const envContent = readFileSync(resolve(__dirname, 'server', '.env'), 'utf-8');
|
|
const match = envContent.match(/^VERITAS_ADMIN_KEY=(.+)$/m);
|
|
if (match) {
|
|
process.env.VERITAS_ADMIN_KEY = match[1].trim();
|
|
}
|
|
} catch {
|
|
// server/.env not found — fall through to default
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Playwright E2E test configuration for Veritas Kanban.
|
|
*
|
|
* Expects the dev server to be running:
|
|
* - Vite dev server on http://localhost:3000 (serves frontend, proxies API)
|
|
* - Express API server on http://localhost:3001
|
|
*
|
|
* Start with: pnpm dev
|
|
*/
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: false, // Run sequentially — tests may share board state
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: 1,
|
|
reporter: process.env.CI ? 'github' : 'html',
|
|
timeout: 30_000,
|
|
|
|
use: {
|
|
baseURL: 'http://localhost:3000',
|
|
trace: 'on-first-retry',
|
|
screenshot: 'only-on-failure',
|
|
// Auth — read admin key from server/.env (loaded via dotenv above)
|
|
extraHTTPHeaders: {
|
|
'X-API-Key': process.env.VERITAS_ADMIN_KEY || 'dev-admin-key',
|
|
},
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
|
|
/* Run dev servers before starting tests (if not already running) */
|
|
webServer: [
|
|
{
|
|
command: 'pnpm --filter server dev',
|
|
port: 3001,
|
|
reuseExistingServer: true,
|
|
timeout: 15_000,
|
|
},
|
|
{
|
|
command: 'pnpm --filter web dev',
|
|
url: 'http://localhost:3000',
|
|
reuseExistingServer: true,
|
|
timeout: 15_000,
|
|
},
|
|
],
|
|
});
|