Safety net for upcoming refactors: - 26 Playwright smoke tests via @playwright/test 1.50.0 in an official Playwright container (no host Node needed). Covers every Bedside sub-pill, the age→weight estimator, dose calculators (seizure/sepsis/anaphylaxis/ burns/airway), and interactive widgets (lightbox, vent SVG). - `npm run e2e` wrapper runs tests inside mcr.microsoft.com/playwright:v1.50.0-noble on the ped-ai_default Docker network so no host port mapping is needed. - public/e2e-harness.html + public/js/e2e-bootstrap.js load the calculators component without the SPA auth wall (scripts external to satisfy CSP). Server: - server.js now re-reads public/index.html on mtime change instead of caching at boot. Fixes the "edit HTML, restart container" friction. - CSP upgradeInsecureRequests disabled in helmet config; Caddy still enforces HTTPS at the reverse-proxy layer in production.
24 lines
752 B
JavaScript
24 lines
752 B
JavaScript
// Playwright config — runs smoke tests against the already-running PedScribe
|
|
// container (no dev server spin-up). Expects BASE_URL (default
|
|
// http://host.docker.internal:3552 when run via scripts/e2e.sh).
|
|
const { defineConfig, devices } = require('@playwright/test');
|
|
|
|
module.exports = defineConfig({
|
|
testDir: './tests',
|
|
timeout: 30_000,
|
|
expect: { timeout: 5_000 },
|
|
fullyParallel: false,
|
|
retries: 0,
|
|
workers: 1,
|
|
reporter: [['list']],
|
|
use: {
|
|
baseURL: process.env.BASE_URL || 'http://host.docker.internal:3552',
|
|
trace: 'retain-on-failure',
|
|
screenshot: 'only-on-failure',
|
|
actionTimeout: 5_000,
|
|
navigationTimeout: 15_000,
|
|
},
|
|
projects: [
|
|
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
|
|
],
|
|
});
|