import { defineConfig, devices } from '@playwright/test' /** * Live full-stack e2e: real Go API + user-h5 + admin-h5. * Prerequisites: `npm run deps:up` and API on :8080 (or started via webServer). */ export default defineConfig({ testDir: './tests', fullyParallel: false, workers: 1, timeout: 180_000, expect: { timeout: 20_000 }, forbidOnly: !!process.env.CI, retries: 0, use: { trace: 'retain-on-failure', screenshot: 'only-on-failure', video: 'retain-on-failure', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'], ...(process.env.PW_CHANNEL ? { channel: process.env.PW_CHANNEL } : {}), }, }, ], webServer: [ { command: 'npm run dev -w @yuxingu/user-h5 -- --host 127.0.0.1 --port 5173', url: 'http://127.0.0.1:5173/psy/', reuseExistingServer: true, timeout: 120_000, }, { command: 'npm run dev -w @yuxingu/admin-h5 -- --host 127.0.0.1 --port 5174', url: 'http://127.0.0.1:5174/', reuseExistingServer: true, timeout: 120_000, }, ], })