[FEAT] 導入 Playwright E2E 測試環境與登入功能測試腳本
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m36s
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m36s
This commit is contained in:
47
playwright.config.ts
Normal file
47
playwright.config.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
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'] },
|
||||
},
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user