Files
张翔 6d92024b63 feat: 修复测试套件问题并添加Woodpecker CI配置
- 修复API测试认证问题:创建全局认证设置,更新Playwright配置
- 优化回归测试稳定性:增加超时时间到15秒,修复定位器
- 创建Woodpecker CI工作流:CI、部署和质量门禁配置
- 添加Jest配置和测试脚本
- 移除登录页面的默认账号密码显示(安全问题修复)
2026-03-09 10:26:02 +08:00

51 lines
1.3 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import { getEnvironmentConfig } from './shared/config/environments';
const config = defineConfig({
testDir: './dev-audit',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
timeout: 30000,
reporter: [
['html', { outputFolder: 'test-framework/reports/html', open: 'never' }],
['json', { outputFile: 'test-framework/reports/results.json' }],
['junit', { outputFile: 'test-framework/reports/results.xml' }],
['list']
],
use: {
baseURL: getEnvironmentConfig(process.env.TEST_ENV || 'development').baseURL,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
launchOptions: {
args: ['--disable-dev-shm-usage', '--no-sandbox']
}
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
{
name: 'Mobile Safari',
use: { ...devices['iPhone 12'] },
}
]
});
export default config;