mirror of
https://github.com/siop-spelev/siop2.git
synced 2026-08-08 12:41:54 +00:00
- ESLint 10 flat config racine (typescript-eslint, react-hooks) ; règle ADR-001 codée : no-restricted-imports interdit « minio » partout sauf minio-storage.service.ts (violation vérifiée) ; jobs lint par paquet - Playwright apps/web/e2e : redirection sans jeton, connexion démo 1 clic, coquille (rail actif, chip DÉMO), bascule de rôle chronométrée < 3 s (ADR-002), /design, déconnexion avec purge ; webServer api dist + vite, seed idempotent en globalSetup, PW_CHANNEL=chrome en local - CI : jobs lint + e2e (services PostgreSQL/Redis, artefact playwright-report sur échec) ; vitest restreint à src/ Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
/**
|
|
* Parcours e2e (R0.12) — démarre l'API construite (dist) et Vite, puis joue
|
|
* le parcours démo. Localement : PW_CHANNEL=chrome évite le téléchargement
|
|
* de Chromium (utilise le Chrome installé) ; en CI, Chromium Playwright.
|
|
* Prérequis : PostgreSQL/Redis joignables, `pnpm --filter @siop/api build`.
|
|
*/
|
|
const API_ENV = {
|
|
NODE_ENV: 'test',
|
|
PORT: '3000',
|
|
DEMO_MODE: 'true',
|
|
JWT_SECRET: process.env.JWT_SECRET ?? 'e2e-secret-0123456789abcdef',
|
|
DATABASE_URL:
|
|
process.env.DATABASE_URL ?? 'postgresql://siop:siop@localhost:5432/siop',
|
|
REDIS_URL: process.env.REDIS_URL ?? 'redis://localhost:6379',
|
|
};
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
globalSetup: './e2e/global-setup.ts',
|
|
timeout: 30_000,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 1 : 0,
|
|
use: {
|
|
baseURL: 'http://localhost:5173',
|
|
trace: 'retain-on-failure',
|
|
...(process.env.PW_CHANNEL ? { channel: process.env.PW_CHANNEL } : {}),
|
|
},
|
|
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
|
|
webServer: [
|
|
{
|
|
command: 'node ../api/dist/main.js',
|
|
url: 'http://localhost:3000/health',
|
|
env: API_ENV,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 30_000,
|
|
},
|
|
{
|
|
command: 'pnpm dev',
|
|
url: 'http://localhost:5173',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 60_000,
|
|
},
|
|
],
|
|
});
|