[FEAT] 導入 Playwright E2E 測試環境與登入功能測試腳本
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m36s

This commit is contained in:
2026-03-06 15:38:27 +08:00
parent 02e5f5d4ea
commit e11193c2a7
8 changed files with 548 additions and 60 deletions

14
e2e/helpers/auth.ts Normal file
View File

@@ -0,0 +1,14 @@
import { Page } from '@playwright/test';
/**
* 共用登入函式
* 使用測試帳號登入 Star ERP 系統
*/
export async function login(page: Page, username = 'mama', password = 'mama9453') {
await page.goto('/');
await page.fill('#username', username);
await page.fill('#password', password);
await page.getByRole('button', { name: '登入系統' }).click();
// 等待儀表板載入完成
await page.waitForSelector('text=系統概況', { timeout: 10000 });
}