Verifying the rendered pages rather than the build turned up real bugs: - The WP-00 health page still sat at src/app/page.tsx and silently won the route over the new Aperçu screen, so the home page was a database status readout. Moved to /api/sante, where a probe belongs, and wired into the compose healthcheck. - The unassigned row showed a +14 h delta against a contract of zero, reading as an overshoot when it is simply the volume left to staff. It now shows what there is to fill. - Two sidebar entries lit at once: an anchor link matched its own page, and /equipe matched an employee record. Highlighting now resolves to the most specific match, and a test asserts exactly one entry lights per screen. - Section tabs with no built screen pointed at the home page, which reads as a broken tab. They now lead to their first entry's placeholder. Also gives truncated compliance alerts a title attribute, so a narrow cell no longer says there is a problem without saying which. Playwright can reuse a preinstalled browser through PLAYWRIGHT_CHROMIUM_PATH when its revision differs from the bundled one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cr9dkEHwbDgkWPnyGj1Rjv
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
const PORT = Number(process.env.E2E_PORT ?? 3100);
|
|
const baseURL = `http://127.0.0.1:${PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: Boolean(process.env.CI),
|
|
retries: process.env.CI ? 2 : 0,
|
|
// Serial in CI so the single Postgres service is not raced.
|
|
...(process.env.CI ? { workers: 1 } : {}),
|
|
reporter: process.env.CI ? [['github'], ['html', { open: 'never' }]] : 'list',
|
|
|
|
use: {
|
|
baseURL,
|
|
trace: 'on-first-retry',
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
// Certains environnements fournissent déjà un Chromium dont la révision
|
|
// ne correspond pas à celle qu'attend cette version de Playwright.
|
|
// PLAYWRIGHT_CHROMIUM_PATH permet de le réutiliser plutôt que d'en
|
|
// télécharger un second.
|
|
...(process.env.PLAYWRIGHT_CHROMIUM_PATH
|
|
? {
|
|
launchOptions: {
|
|
executablePath: process.env.PLAYWRIGHT_CHROMIUM_PATH,
|
|
},
|
|
}
|
|
: {}),
|
|
},
|
|
},
|
|
],
|
|
|
|
webServer: {
|
|
// Exercise the standalone server, which is what the Docker image runs.
|
|
// `next start` is not compatible with `output: standalone`, and testing a
|
|
// different server than the one deployed defeats the purpose of this suite.
|
|
command: [
|
|
'pnpm build',
|
|
'cp -r .next/static .next/standalone/.next/static',
|
|
'cp -r public .next/standalone/public',
|
|
`node .next/standalone/server.js`,
|
|
].join(' && '),
|
|
url: baseURL,
|
|
env: { PORT: String(PORT), HOSTNAME: '127.0.0.1' },
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 180_000,
|
|
},
|
|
});
|