E2E Tests
The E2E test suite runs against real AWS staging infrastructure to verify that deploys work end-to-end — from CLI to live URL.
Staging Infrastructure
A separate, cost-optimized staging environment mirrors production:
| Resource | Staging Difference |
|---|---|
| S3 Bucket | Separate bucket (*.staging.{domain}) |
| CloudFront | Separate distribution |
| ECS Cluster | Single-AZ (cost optimization) |
| ALB | Separate load balancer |
| ECR | Separate repository |
| Lambda@Edge | Separate function |
Test Suite
Static Deploy E2E
- Creates a minimal HTML fixture
- Deploys via CLI to staging
- Verifies the live URL responds with correct content
- Tests SPA fallback routing
- Retry logic with exponential backoff (up to 60s for DNS propagation)
SSR Deploy E2E
- Creates a minimal Next.js fixture with
getServerSideProps - Deploys via CLI to staging
- Verifies server-rendered content (not just static HTML)
- ECS stabilization timeout: 120 seconds
Auth E2E
- Invalid API key returns exit code 2
- Valid API key succeeds
- Login flow stores credentials correctly
App Lifecycle E2E
Create app → Deploy → Verify live → Delete → Verify 404After deletion, verifies no orphaned AWS resources remain (no dangling Route 53 records, no leftover S3 prefixes).
Running Tests
# Required environment variablesexport E2E_API_KEY=hqd_test_xxxxxexport AWS_PROFILE=stagingexport E2E_DOMAIN=staging.indigo-hq.com
# Run the suitenpm run test:e2eThe suite runs on Vitest (vitest.e2e.config.ts): test files run one at a time (fileParallelism: false) with a 120-second timeout per test. npm run test:e2e:report writes JUnit output for CI.
The SSR suite exercises the legacy Docker/ECS container path, which is dormant for new apps (see SSR Deploys).