Files
Focolari-Voting-System/frontend/playwright.config.ts

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 (frontend servito su /badge)
baseURL: 'http://localhost:8000/badge',
// 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,
},
});