End-to-End Testing

After completing all deployment steps, perform the following smoke tests to verify the entire system is working correctly.


Smoke Test Checklist

#TestExpected Result
1Access Frontend URL (Amplify)Login page renders correctly
2Register a new accountReceive OTP email; account created successfully
3Log in with credentialsAccess Dashboard
4Upload an invoice image/PDFStatus changes from ProcessingDraft
5View invoice detailsKey fields (Tax ID, Date, Amount) are filled correctly
6Check RiskLevelRisk warning badge appears (if applicable)

Step-by-Step Verification

1. Frontend Access

  • Open the Amplify app URL in a browser.
  • The login form should appear. No console errors.

2. Register & Login

  • Click Register, fill in your email and password.
  • Check your email for the OTP/verification code.
  • Complete registration and log in.

3. Invoice Upload

  • From the Dashboard, click Upload Invoice.
  • Select a sample invoice PDF or image.
  • The invoice should appear in the list with status Processing.
  • After ~30–90 seconds, status should change to Draft with extracted data pre-filled.

4. Invoice Details

  • Click on the invoice to open the detail view.
  • Verify that the following fields are populated:
    • Tax ID (Mã số thuế)
    • Invoice date
    • Total amount
    • Seller/Buyer names

5. Merge Invoice

  • From the Draft invoice, click Merge / Confirm.
  • Verify the invoice status changes to Confirmed or Merged.

Backend Health Check

You can also verify the backend directly via CloudFront:

curl https://<CLOUDFRONT_DOMAIN>/api/health
# Expected: {"status":"Healthy"}

And the OCR internal health check (via ECS Exec or test from Backend):

curl http://<ALB_OCR_DNS>/api/v1/health
# Expected: {"status":"ok"}

Troubleshooting Common Issues

IssueLikely CauseSolution
Invoice stuck in ProcessingOCR ECS tasks not runningCheck ECS service → Tasks; check CloudWatch logs
502 Bad Gateway from CloudFrontBackend EB environment unhealthyCheck EB environment health page
Login failsCognito configuration mismatchVerify COGNITO_CLIENT_ID and COGNITO_CLIENT_SECRET in SSM
Invoice data empty after OCRModel path issue or missing env varsCheck /ecs/smartinvoice-ocr-task logs in CloudWatch