Files
star-erp/playwright.config.ts
sky121113 e11193c2a7
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m36s
[FEAT] 導入 Playwright E2E 測試環境與登入功能測試腳本
2026-03-06 15:38:27 +08:00

48 lines
1014 B
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E 測試設定檔
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: './e2e',
/* 平行執行測試 */
fullyParallel: true,
/* CI 環境下禁止 test.only */
forbidOnly: !!process.env.CI,
/* CI 環境下失敗重試 2 次 */
retries: process.env.CI ? 2 : 0,
/* CI 環境下單 worker */
workers: process.env.CI ? 1 : undefined,
/* 使用 HTML 報告 */
reporter: 'html',
/* 全域共用設定 */
use: {
/* 本機開發伺服器位址 */
baseURL: 'http://localhost:8081',
/* 失敗時自動截圖 */
screenshot: 'only-on-failure',
/* 失敗時保留錄影 */
video: 'retain-on-failure',
/* 失敗重試時收集 trace */
trace: 'on-first-retry',
},
/* 只使用 Chromium 進行測試(開發階段足夠) */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});