Files
novalon-manage-system/uat-tests/playwright.config.ts
T
张翔 4ec1a3f4dd feat: 更新UAT测试配置和修复数据库连接问题
refactor(测试): 重构用户数据加载逻辑以支持数组格式
fix(数据库): 修正数据库连接配置和凭证
test: 添加新的导航和用户管理测试场景
docs: 生成UAT测试报告和最终报告
ci: 更新Woodpecker CI配置和测试命令
build: 添加application-test.yml配置文件
chore: 清理旧的测试场景文件
2026-03-25 15:32:49 +08:00

43 lines
1.3 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
dotenv.config();
export default defineConfig({
testDir: './scenarios',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 4 : 8,
reporter: [
['html', { outputFolder: 'test-results/html-report' }],
['json', { outputFile: 'test-results/results.json' }],
['junit', { outputFile: 'test-results/junit.xml' }],
['list']
],
use: {
baseURL: process.env.TEST_BASE_URL || 'http://localhost:3001',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
headless: process.env.HEADLESS_BROWSER === 'true',
actionTimeout: parseInt(process.env.TEST_TIMEOUT || '30000'),
navigationTimeout: parseInt(process.env.TEST_TIMEOUT || '30000'),
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
outputDir: 'test-results/artifacts',
});