Files
Train/apps/web/playwright.config.ts
2026-06-16 00:55:20 +08:00

35 lines
840 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig, devices } from '@playwright/test';
/**
* Playwright e2e 配置 — 对应 T-1.5/1.6/1.7/1.8 E2E。
* 自动拉起后端 APIapps/api)与前端 dev server,再跑用例。
*/
export default defineConfig({
testDir: './e2e',
timeout: 30_000,
fullyParallel: false,
reporter: [['list']],
use: {
baseURL: 'http://127.0.0.1:5173',
trace: 'on-first-retry',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
],
webServer: [
{
command: 'node dist/main.js',
cwd: '../api',
url: 'http://127.0.0.1:3001/api/health',
reuseExistingServer: true,
timeout: 30_000,
},
{
command: 'npm run dev -- --host 127.0.0.1',
url: 'http://127.0.0.1:5173',
reuseExistingServer: true,
timeout: 30_000,
},
],
});