import base from './playwright.config'; import path from 'node:path'; /* Default to the freshly built app so a bare `npx playwright test -c` targets the * current sources; frozen candidates stay available through the env override. */ const candidate = process.env.WBV2_PRODUCTION_CANDIDATE ?? path.resolve(import.meta.dirname, 'dist'); const port = Number(process.env.WEB_TEST_PORT ?? 5310); const jsonOutput = process.env.PLAYWRIGHT_JSON_OUTPUT_FILE; export default { ...base, testMatch: ['mesh-decimate-*-production.spec.ts'], timeout: 420_000, ...(jsonOutput ? { reporter: [...(Array.isArray(base.reporter) ? base.reporter : []), ['json', { outputFile: jsonOutput }] as const] } : {}), use: { ...base.use, baseURL: `http://127.0.0.1:${port}`, viewport: { width: 1440, height: 900 }, headless: process.env.WEB_TEST_HEADLESS === '1' ? true : base.use?.headless }, webServer: { command: `BLENDER_WEB_HTTP_PORT=${port} node ../tools/web/deployment-http-server.mjs '${candidate}'`, url: `http://127.0.0.1:${port}`, reuseExistingServer: false, timeout: 30_000 }, };