自動化驗證點數與方案(訂閱/組合包)購買流程,包含模擬支付、真實支付跳轉、點數扣除邏輯與餘額同步。
此技能專注於驗證學生在平台上的資產獲取邏輯,確保無論是購買「點數套餐」還是「訂閱方案/組合包」,金流管道(Stripe/PayPal/模擬)能正確運作、資產準確入帳且權限即時同步。
auto-login 邏輯,完成登入並同步權限。/pricing 並選取點數套餐或訂閱方案。e2e/point_purchase_simulated.spec.ts。在 /pricing/checkout 使用「模擬支付」按鈕。e2e/point_purchase_real.spec.ts。驗證是否成功跳轉至 Stripe 或 PayPal。e2e/pricing_deduction.spec.ts。驗證購買含有「應用程式方案」的套餐時,點數是否正確扣除成本後入帳。/plans 確保購買紀錄已產生且狀態為 PAID。當被要求驗證購買功能時:
npx playwright test e2e/point_purchase_simulated.spec.ts。npx playwright test e2e/pricing_deduction.spec.ts。finalPoints === initialPoints + increase - deduction。NEXT_PUBLIC_BASE_URLTEST_STUDENT_EMAIL / TEST_STUDENT_PASSWORDLOGIN_BYPASS_SECRETe2e/point_purchase_simulated.spec.tse2e/pricing_deduction.spec.tse2e/point_purchase_real.spec.ts# 驗證基礎點數購買
npx playwright test e2e/point_purchase_simulated.spec.ts
# 驗證方案扣點邏輯 (購買特定套餐)
npx playwright test e2e/pricing_deduction.spec.ts
# 驗證真實支付跳轉
npx playwright test e2e/point_purchase_real.spec.ts