π οΈ 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 Datalocally if needed with.envfile.
β 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.tsis configured to useallure-playwrightreporter. - Check
allure-resultsdirectory 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.tsand inspect thereservationData.vendororreservationData.inventoryvalues. - Make sure the values are set to
truefor 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
ReservationDatastructure.
β 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.tssrc/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:
constant.tswith newVENDOR_*orINV_SRC_*value- The master sheet with test case mapping
- Create new test file or edit existing ones to include the vendor/source
- Add related credentials to GitHub secrets