41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/e2e',
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 1 : 0,
|
|
workers: 1,
|
|
reporter: process.env.CI ? 'github' : 'list',
|
|
timeout: 60000,
|
|
expect: { timeout: 10000 },
|
|
// BUG-080 : la suite (~120 tests, workers: 1, ~10-15 s/test sur un poste
|
|
// chargé) ne doit jamais pendre toute la nuit. Au-delà du timeout global,
|
|
// Playwright abandonne avec un échec explicite au lieu de bloquer.
|
|
// Surchargable : E2E_GLOBAL_TIMEOUT_MS.
|
|
globalTimeout: Number(
|
|
process.env.E2E_GLOBAL_TIMEOUT_MS ??
|
|
(process.env.CI ? 30 * 60 * 1000 : 25 * 60 * 1000),
|
|
),
|
|
reportSlowTests: process.env.CI ? null : { max: 5, threshold: 30000 },
|
|
|
|
use: {
|
|
baseURL: process.env.BASE_URL || 'http://localhost:2029',
|
|
trace: 'on-first-retry',
|
|
screenshot: 'only-on-failure',
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: 'chromium-desktop',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
{
|
|
name: 'chromium-mobile',
|
|
use: { ...devices['Pixel 5'] },
|
|
},
|
|
],
|
|
|
|
webServer: process.env.CI ? [] : [],
|
|
});
|