import { defineConfig, devices } from '@playwright/test'; /** * Admin V2 E2E 测试配置 * * 断裂探测冒烟测试 — 验证 Admin V2 页面与 SaaS 后端的连通性 * * 前提条件: * - SaaS Server 运行在 http://localhost:8080 * - Admin V2 dev server 运行在 http://localhost:5173 * - 数据库有种子数据 (super_admin: testadmin/Admin123456) */ export default defineConfig({ testDir: './tests/e2e', timeout: 60000, expect: { timeout: 10000, }, fullyParallel: false, retries: 0, workers: 1, reporter: [ ['list'], ['html', { outputFolder: 'test-results/html-report' }], ], use: { baseURL: 'http://localhost:5173', trace: 'on-first-retry', screenshot: 'only-on-failure', video: 'retain-on-failure', actionTimeout: 10000, navigationTimeout: 30000, }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'], viewport: { width: 1280, height: 720 }, }, }, ], webServer: { command: 'pnpm dev --port 5173', url: 'http://localhost:5173', reuseExistingServer: true, timeout: 30000, }, outputDir: 'test-results/artifacts', });