Files
Focolari-Voting-System/frontend/playwright.config.ts
alfy 855d2b3160 feat: Sistema controllo accessi Focolari completo con test E2E
🎯 Funzionalità Implementate:
- Frontend React/TypeScript/Tailwind ottimizzato per tablet
- Backend mock FastAPI con API complete
- Hook RFID multi-pattern (US: ;? / IT: ò_)
- Flusso validatore → partecipante → conferma ingresso
- Carosello benvenuto multilingua (10 lingue, animazione smooth)
- Gestione sessione con invalidazione su server restart
- Pagina debug RFID accessibile da /debug

🧪 Test Implementati:
- 56 unit test (Vitest) - hook RFID, API, componenti
- 14 test E2E (Playwright) - flussi completi con browser reale
- Test sicurezza: verifica blocco backend per utenti non ammessi

📋 Comandi Disponibili:
- ./dev.sh install     → Setup dipendenze
- ./dev.sh dev         → Sviluppo (hot reload)
- ./dev.sh server      → Produzione locale
- ./dev.sh test        → Unit test
- ./dev.sh test:e2e    → Test E2E headless
- ./dev.sh test:e2e:headed → Test E2E con browser visibile
- ./dev.sh test:e2e:ui → Playwright UI per debug

📝 Documentazione:
- README.md con guida completa
- API_SPECIFICATION.md per backend reale
- TEST_CHECKLIST.md per test manuali
- Piani sviluppo in ai-prompts/

 Stato: MVP completo, in attesa di feedback e richieste future
2026-01-24 18:29:54 +01:00

63 lines
1.5 KiB
TypeScript

/**
* Focolari Voting System - Playwright E2E Test Configuration
*/
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
fullyParallel: false, // I test devono girare in sequenza (stato condiviso)
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: 'html',
// Timeout più lunghi per debug visivo
timeout: 60000,
expect: {
timeout: 10000,
},
use: {
// URL base del server
baseURL: 'http://localhost:8000',
// Rallenta le azioni per vedere cosa succede
launchOptions: {
slowMo: 300, // 300ms tra ogni azione
},
// Trace per debug
trace: 'on-first-retry',
// Screenshot su fallimento
screenshot: 'only-on-failure',
// Video su fallimento
video: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
// Tablet Android (landscape)
{
name: 'tablet',
use: {
...devices['Galaxy Tab S4'],
viewport: { width: 1280, height: 800 },
},
},
],
// Server da avviare prima dei test
webServer: {
command: 'cd .. && ./dev.sh server -d backend-mock/data/users_test.json',
url: 'http://localhost:8000',
reuseExistingServer: !process.env.CI,
timeout: 30000,
},
});