Files
photo-live/apps/viewer/playwright.config.ts
T
2026-09-18 09:52:22 +08:00

32 lines
987 B
TypeScript
Raw 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';
// Task 6 起 e2e 打真实后端:webServer 先等 API(8080,仓库根 `pnpm dev:api`
// 构建+启动;已在跑的实例直接复用),再等 viewer dev(5175,/v1 代理 → 8080)。
// compose 基础设施(MySQL/MinIO/Redis)需预先 `docker compose up -d`(计划约定)。
export default defineConfig({
testDir: './e2e',
timeout: 30_000,
fullyParallel: true,
reporter: [['list']],
use: {
baseURL: 'http://127.0.0.1:5175',
trace: 'on-first-retry',
},
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
webServer: [
{
command: 'pnpm dev:api',
cwd: '../..',
url: 'http://127.0.0.1:8080/v1/health',
reuseExistingServer: true,
timeout: 180_000, // 首次含 tsc 全量构建
},
{
command: 'pnpm run dev',
url: 'http://127.0.0.1:5175',
reuseExistingServer: true,
timeout: 60_000,
},
],
});