library-picturebook-activity/lesingle-creation-frontend/playwright.config.ts

42 lines
914 B
TypeScript
Raw Permalink Normal View History

import { defineConfig, devices } from '@playwright/test'
/**
* Playwright E2E
* AI
*/
export default defineConfig({
testDir: './e2e',
/* 测试超时 */
timeout: 30_000,
expect: {
timeout: 10_000,
},
/* 并行执行 */
fullyParallel: true,
/* CI 环境重试 */
retries: process.env.CI ? 2 : 0,
/* 报告 */
reporter: [['html', { open: 'never' }], ['list']],
/* 全局配置 */
use: {
baseURL: process.env.FRONTEND_URL || 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
actionTimeout: 10_000,
},
/* 浏览器项目 */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
/* 本地开发服务器 */
webServer: {
command: 'npm run dev',
port: 3000,
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
})