วิธีรัน Test
คำสั่งอ้างอิงจาก ccr-test-suite/README.md
Setup
cd ccr-test-suite
npm install
npx playwright install chromium firefox webkit
cp .env.example .env
ตั้งค่า .env
BASE_URL=https://admin-dev.chiccarrent.com
TEST_USERNAME=your-email@example.com
TEST_PASSWORD=your-password
Run
npm test
npm run test:chromium
npx playwright test tests/booking/
npx playwright test -g "TC-BOOKING-004"
npm run test:report
Troubleshooting เบื้องต้น
| อาการ | แนวทางตรวจ |
|---|---|
| Login fail | ตรวจ .env, user permission, Auth0/session |
| Table assert fail | ตรวจ network/API response และ skeleton loading |
| Test ผ่าน local แต่ fail CI | ตรวจ worker count, test data conflict, timezone |
| Browser ไม่พร้อม | รัน npx playwright install ใหม่ |