Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

πŸ› οΈ Troubleshooting & FAQs β€” Vendor API Automation Testing

This section covers common issues, debugging tips, and frequently asked questions related to our vendor reservation automation tests using Playwright, GitHub Actions, and dynamic test configurations.

πŸ” COMMON ISSUES & FIXES

❗ 1. Test file not found or Cannot find module

Problem: You've specified a test file in the scenarios input (e.g., tc-009.spec.ts) but GitHub Actions returns a file-not-found error. Solution:

  • Ensure the file exists in src/tests/ directory.
  • Check for typos or casing issues (e.g., TC-009 β‰  tc-009).
  • If renamed or moved, update your test ID and master sheet accordingly.

❗ 2. Missing environment variable or undefined secret

Problem: Tests fail due to missing BASE_URL, HMAC keys, or other environment-specific values. Solution:

  • Confirm the secret or variable exists in GitHub Settings > Secrets and Variables for the correct environment (ballbot, etc.).
  • Double-check spelling and casing (e.g., HMAC_API_KEY_VENDOR_OPENRICE).
  • Run Generate Master Data locally if needed with .env file.

❗ 3. Allure report not generated

Problem: The test runs, but the Allure report is missing or broken. Solution:

  • Ensure that each shard generates results in the allure-results/ directory.
  • Make sure playwright.config.ts is configured to use allure-playwright reporter.
  • Check allure-results directory size in GitHub artifacts.

❗ 4. Tests unexpectedly skipped for some vendors/inventory

Problem: You expect a test to run for certain vendors or inventory sources but it’s skipped. Solution:

  • Open the relevant tc-xxx.spec.ts and inspect the reservationData.vendor or reservationData.inventory values.
  • Make sure the values are set to true for vendors/inventory you want to include.

❗ 5. Cannot read property of undefined on getCustomerByType

Problem: Test fails during customer creation. Solution:

  • Make sure you passed a valid string to getCustomerByType() (e.g., "random", "default").
  • Validate that the helper function returns a valid object conforming to the ReservationData structure.

❓ FREQUENTLY ASKED QUESTIONS (FAQs)

❓ Can I run a single test file?

Yes, use the scenarios input in the GitHub Actions workflow and specify the filename:

tc-001.spec.ts


❓ How do I run only TableCheck or Sevenroom tests?

Edit the .spec.ts file and toggle the inventory flags:

inventory: {
  [INV_SRC_TABLECHECK]: true,
  [INV_SRC_SEVENROOM]: false,
  ...
}


❓ Where are test results stored? Test results are:

  • Stored as artifacts in GitHub Actions under the name zipped-allure-report-[timestamp].
  • Uploaded to Cloudflare R2 at:
https://allure.hh-ballbot.my.id/api/hh-server/ballbot/<run_number>


❓ Why are some tests sharded?

We split tests into 4 shards to reduce total execution time and improve performance:

npx playwright test --shard 1/4
npx playwright test --shard 2/4
...


❓ How do I verify the test data before execution?

Use the βœ… Log restaurant Data JSON for verification step in GitHub Actions. You can manually inspect:

  • src/data/restaurant.ts
  • src/data/restaurantData.json

❓ Can I run this test suite locally?

Yes:

npm install
npm run generate-master-data
npx playwright test src/tests/tc-001.spec.ts


Make sure your .env has all necessary environment variables and secrets.

❓ What if I want to add a new vendor or source?

Update:

  1. constant.ts with new VENDOR_* or INV_SRC_* value
  2. The master sheet with test case mapping
  3. Create new test file or edit existing ones to include the vendor/source
  4. Add related credentials to GitHub secrets