Troubleshooting
Common issues and solutions when working with Test Packages.
Package Not Found
Symptom
Error: Package not found: ./packages/checkout-tests
Causes and Solutions
Wrong Path
Check the path in your configuration:
{
"test_types": {
"e2e": {
"default": {
"test_packages": [
"./packages/checkout-tests" // Relative to config file
]
}
}
}
}
Verify the directory exists:
ls -la packages/checkout-tests/
Missing qit-test.json
Every package must have a manifest:
ls packages/checkout-tests/qit-test.json
Case Sensitivity
Linux is case-sensitive:
# Wrong
"./packages/Checkout-Tests"
# Correct
"./packages/checkout-tests"
Validation Errors
Missing Required Fields
Symptom
Validation error: Package 'checkout-tests' missing required field 'namespace'
Solution
Add missing fields to qit-test.json:
{
"package": "mycompany/checkout-tests",
"package_type": "test",
"test_type": "e2e"
}
The package field must include the namespace: namespace/name format.
Invalid Schema
Symptom
Validation error: test.results required for test packages
Solution
Test packages (with run phase) must have results:
{
"test": {
"phases": {
"run": ["npm test"]
},
"results": {
"ctrf-json": "./test-results/ctrf.json",
"blob-dir": "./test-results/artifacts"
}
}
}
Secret Validation Failures
Missing Secrets
Symptom
Missing required secrets:
- STRIPE_TEST_KEY (required by: payment-tests)
- WEBHOOK_SECRET (required by: webhook-tests)
Solution
Set environment variables:
export STRIPE_TEST_KEY="sk_test_..."
export WEBHOOK_SECRET="whsec_..."
Or use .env file:
# .env
STRIPE_TEST_KEY=sk_test_...
WEBHOOK_SECRET=whsec_...
# Load before running
source .env
qit run:e2e woocommerce
Secret Not Available in Test
Symptom
TypeError: Cannot read property 'STRIPE_KEY' of undefined
Solution
- Declare in manifest:
{
"requires": {
"secrets": ["STRIPE_KEY"]
}
}
- Access correctly:
const key = process.env.STRIPE_KEY; // Correct
const key = STRIPE_KEY; // Wrong
Results Not Found
CTRF File Missing
Symptom
Error: Results not found: ./test-results/ctrf.json