6d92024b63
- 修复API测试认证问题:创建全局认证设置,更新Playwright配置 - 优化回归测试稳定性:增加超时时间到15秒,修复定位器 - 创建Woodpecker CI工作流:CI、部署和质量门禁配置 - 添加Jest配置和测试脚本 - 移除登录页面的默认账号密码显示(安全问题修复)
51 lines
1.3 KiB
TypeScript
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;
|