9cbc80742a
refactor: 优化导航和路由逻辑 fix: 修复移动端样式问题 perf: 优化字体加载和性能 test: 添加安全性和可访问性测试 style: 调整按钮和表单样式 chore: 更新依赖版本 ci: 添加安全头配置 build: 优化构建配置 docs: 更新常量信息
70 lines
1.6 KiB
TypeScript
70 lines
1.6 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
import { getEnvironment } from './src/config/environments';
|
|
|
|
const env = getEnvironment();
|
|
|
|
export default defineConfig({
|
|
testDir: './src/tests',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: env.retries,
|
|
workers: process.env.CI ? 4 : undefined,
|
|
reporter: [
|
|
['html', { open: 'never' }],
|
|
['json', { outputFile: 'test-results/results.json' }],
|
|
['junit', { outputFile: 'test-results/junit.xml' }],
|
|
['line'],
|
|
['list'],
|
|
['allure-playwright', {
|
|
outputFolder: 'allure-results',
|
|
detail: true,
|
|
suiteTitle: false,
|
|
}],
|
|
],
|
|
timeout: env.timeout,
|
|
expect: {
|
|
timeout: 30000
|
|
},
|
|
use: {
|
|
baseURL: env.baseURL,
|
|
trace: env.trace,
|
|
screenshot: env.screenshot,
|
|
video: env.video,
|
|
headless: env.headless,
|
|
viewport: { width: 1280, height: 720 },
|
|
actionTimeout: 30000,
|
|
navigationTimeout: 60000,
|
|
launchOptions: {
|
|
slowMo: env.slowMo,
|
|
},
|
|
},
|
|
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'] },
|
|
},
|
|
],
|
|
webServer: env.name === 'development' ? {
|
|
command: 'cd .. && npm run dev',
|
|
url: 'http://localhost:3000',
|
|
timeout: 120000,
|
|
reuseExistingServer: !process.env.CI,
|
|
} : undefined,
|
|
});
|