import { defineConfig, devices } from '@playwright/test'; // 在线流程 Modeler live e2e 专用配置(T4.2)。 // // 复用主会话已在跑的 vite dev(5173,vite.config 默认 proxy /api → http://localhost:8093), // 后端指向当前 live 的 8093 网关 + 8089 flowable-service + 真库 eip4(含 T3.1/T3.2/T4.1 全部新代码)。 // 与 fivering 配置(自起 vite 5174 → 8094)隔离:本配置 reuseExistingServer 复用 5173,不新起端口。 // // 依赖(跑前须在线,spec 头注释有 curl 自检): // - 8093 网关/后端(curl -s -o /dev/null -w '%{http_code}' localhost:8093/v3/api-docs → 200) // - 8089 flowable-service(经 8093 转发;start/trace 走它) // - 5173 vite dev(curl localhost:5173 → 200;apiJson 直连 8093,与 UI 经 5173 代理同一后端) // 跑法:npx playwright test -c playwright.process-modeler.config.ts export default defineConfig({ testDir: './e2e', testMatch: /process-modeler\.spec\.ts/, fullyParallel: false, workers: 1, timeout: 180_000, reporter: [['list']], use: { baseURL: 'http://localhost:5173', trace: 'off', screenshot: 'only-on-failure', }, projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], webServer: { // reuseExistingServer:true → 5173 已在跑(主会话 npm run dev)则复用、不新起; // 未跑时按 dev 同口径(VITE_BACKEND_TARGET=8093)拉起。 command: 'NODE_OPTIONS=--max-http-header-size=65536 VITE_BACKEND_TARGET=http://localhost:8093 npx vite --port 5173 --strictPort', url: 'http://localhost:5173', reuseExistingServer: true, timeout: 120_000, }, });