- apps/api: FastAPI backend with Dockerfile - apps/web: Next.js frontend with Dockerfile - apps/sensor: Signal collection agent - packages: shared packages Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
/**
|
|
* Playwright E2E 測試配置
|
|
* =======================
|
|
* Phase VI: 截圖 + 錄影自動產出
|
|
*/
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: [
|
|
['html', { outputFolder: 'test-results/html-report' }],
|
|
['list'],
|
|
],
|
|
|
|
use: {
|
|
// Base URL for navigation
|
|
baseURL: 'http://localhost:3000',
|
|
|
|
// 截圖與錄影 - 統帥強制要求
|
|
screenshot: 'on',
|
|
video: 'on',
|
|
trace: 'on-first-retry',
|
|
|
|
// Viewport
|
|
viewport: { width: 1920, height: 1080 },
|
|
|
|
// Timeouts
|
|
actionTimeout: 10000,
|
|
navigationTimeout: 30000,
|
|
},
|
|
|
|
// Output directory for screenshots and videos
|
|
outputDir: 'test-results',
|
|
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
|
|
// Web server configuration - start Next.js dev server
|
|
webServer: {
|
|
command: 'pnpm dev',
|
|
url: 'http://localhost:3000',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120000,
|
|
},
|
|
})
|