- 从 HMS 基座复制 apps/web/ (React + Ant Design + Vite + TypeScript) - 管理端自动代理 API 到 localhost:3000 (vite.config.ts) - 更新 scripts/dev.sh 支持三端启动: backend/admin/app - 登录验证通过, 用户管理/角色权限/审计日志等页面正常 - 添加 .gitignore 排除 node_modules/dist
33 lines
778 B
TypeScript
33 lines
778 B
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
testMatch: ['smoke/**/*.spec.ts', 'flows/**/*.spec.ts'],
|
|
timeout: 60_000,
|
|
retries: 1,
|
|
fullyParallel: false,
|
|
workers: 1,
|
|
forbidOnly: !!process.env.CI,
|
|
reporter: [['html', { open: 'never' }], ['list']],
|
|
use: {
|
|
baseURL: process.env.E2E_BASE_URL || 'http://localhost:5174',
|
|
headless: true,
|
|
screenshot: 'only-on-failure',
|
|
trace: 'on-first-retry',
|
|
video: 'retain-on-failure',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
globalSetup: './e2e/check-readiness',
|
|
webServer: {
|
|
command: 'pnpm dev',
|
|
port: 5174,
|
|
reuseExistingServer: true,
|
|
timeout: 30_000,
|
|
},
|
|
});
|