import { defineConfig, devices } from '@playwright/test'; // ──────────────────────────────────────────────────────────────────────────── // 通知管理「组件真实性」强断言 e2e 专属配置 // // 与默认 playwright.config.ts 的区别(关键): // - baseURL 指向【已在跑】的 5173 dev server(eip4-web),不自拉 webServer。 // - 不配置 webServer ⇒ 不重启任何服务(任务硬约束:环境都在跑,勿重启)。 // - screenshot:'on' ⇒ 每条用例都留证(artifacts/notice-reality/)。 // - 仅匹配 notice-reality.spec.ts,避免误跑其他 spec。 // // 运行:npx playwright test --config=playwright.notice-reality.config.ts // 前置:localhost:5173(前端 dev)+ localhost:8093(后端 dev/eip4dev)+ psql:5433。 // ──────────────────────────────────────────────────────────────────────────── export default defineConfig({ testDir: './e2e', testMatch: /notice-reality\.spec\.ts/, fullyParallel: false, workers: 1, timeout: 90_000, reporter: [['list']], outputDir: './e2e/artifacts/notice-reality/_pw-output', use: { baseURL: 'http://localhost:5173', trace: 'retain-on-failure', screenshot: 'on', video: 'off', }, projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], // 注意:故意不配置 webServer —— 复用已在跑的 5173,不重启。 });