be5d5ede90
refactor: 重构后端查询逻辑和API响应处理 fix: 修复用户角色更新和文件上传问题 test: 添加前端性能测试脚本和E2E测试用例 chore: 更新依赖版本和配置文件 docs: 添加环境检查脚本和测试文档 style: 统一表格标签样式和路由命名 perf: 优化前端页面加载速度和响应时间
42 lines
977 B
TypeScript
42 lines
977 B
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
const isHeadless = process.env.PLAYWRIGHT_HEADLESS === 'true' || process.env.CI === 'true';
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 1,
|
|
workers: process.env.CI ? 2 : 4,
|
|
reporter: [
|
|
['html', { outputFolder: 'playwright-report' }],
|
|
['json', { outputFile: 'test-results/results.json' }],
|
|
['junit', { outputFile: 'test-results/junit.xml' }],
|
|
['list']
|
|
],
|
|
|
|
timeout: 60000,
|
|
expect: {
|
|
timeout: 10000
|
|
},
|
|
|
|
use: {
|
|
baseURL: 'http://localhost:3001',
|
|
trace: 'retain-on-failure',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
actionTimeout: 15000,
|
|
navigationTimeout: 30000,
|
|
headless: isHeadless,
|
|
locale: 'zh-CN',
|
|
timezoneId: 'Asia/Shanghai',
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
});
|