import { defineConfig } from '@playwright/test'; const port = Number(process.env.PLAYWRIGHT_PORT || 3011); const baseURL = `http://127.0.0.1:${port}`; export default defineConfig({ testDir: './e2e', testMatch: '**/*.e2e.ts', testIgnore: 'dist-smoke.e2e.ts', outputDir: 'test-results', timeout: 30_000, expect: { timeout: 8_000 }, fullyParallel: false, workers: process.env.CI ? 1 : 3, forbidOnly: Boolean(process.env.CI), retries: process.env.CI ? 1 : 0, reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list', use: { baseURL, locale: 'zh-CN', timezoneId: 'Asia/Shanghai', screenshot: 'only-on-failure', trace: 'retain-on-failure', }, webServer: { command: `npm run dev:linux -- --host 127.0.0.1 --port ${port}`, url: baseURL, reuseExistingServer: process.env.PLAYWRIGHT_REUSE_EXISTING_SERVER === 'true', timeout: 120_000, env: { VITE_BACKEND_TARGET: 'http://127.0.0.1:9', }, }, projects: [ { name: 'chromium-1366', use: { browserName: 'chromium', viewport: { width: 1366, height: 768 } } }, { name: 'chromium-1440', use: { browserName: 'chromium', viewport: { width: 1440, height: 900 } } }, { name: 'chromium-1920', use: { browserName: 'chromium', viewport: { width: 1920, height: 1080 } } }, ], });