End-to-End Testing

1. Goal

Execute a complete integration test of the system from the frontend interface down to the background processing pipelines, verifying all distinct logic paths to collect testing evidence.

2. Test Scenarios

Scenario 1: Human-in-the-loop Flow (Blurry Invoice / Low Confidence)

  • Simulation steps: Upload a blurry receipt or an invoice missing critical fields like the total amount (totalAmount).

  • System workflow:

    1. The document is uploaded and processed through the pipeline steps.
    2. During the confidence check, the Confidence & Status Lambda detects that the average confidence score is < 90% or missing critical fields.
    3. The Lambda function updates the DynamoDB item status to REVIEW_REQUIRED and sets the review status to PENDING.
    4. A CloudWatch Alarm fires on status changes, publishing an email alert to the Admin via SNS/SES.
    5. The Admin opens the Reviewer Dashboard on the Frontend, examining the review form containing the low-confidence fields.
    6. The Admin corrects the values and clicks Approve. The Frontend sends a PATCH request to the review-update Lambda, changing DynamoDB status to APPROVED and overwriting the corrected result.json in S3.
  • Evidence:

    Review Notification

    Reviewer Dashboard

    Low Confidence Fields

    Review Timeline

Scenario 2: Validation Failure (Invalid File Format)

  • Simulation steps: Upload a plain text .txt file (or a file larger than 10MB).

  • System workflow:

    1. The Frontend checks if the file has the correct format.
    2. If the format is invalid, the Frontend will display an error for the invalid file and prevent it from being uploaded.
  • Evidence:

    Invalid File Format

Scenario 3: View Document List

  • Simulation steps: Navigate to the document list page on the user interface.

  • System workflow:

    1. The Frontend calls the API to retrieve the list of uploaded documents from the backend.
    2. The UI displays the list of documents along with basic information: file name, upload date, and processing status (e.g., APPROVED, REVIEW_REQUIRED, FAILED).
  • Evidence:

    Document List 1

    Document List 2

Scenario 4: View Extraction Details

  • Simulation steps: Click on a successfully processed document in the list.

  • System workflow:

    1. The Frontend calls the API to retrieve the extracted details of the document along with the original file URL.
    2. The UI displays the document details, including the original image/PDF alongside the extracted data fields (Vendor Name, Total Amount, Date, etc.).
  • Evidence:

    Extraction Details 1

    Extraction Details 2

    Extraction Details 3

Scenario 5: Search, Filter & Dashboard Statistics

  • Simulation steps:

    1. Switch between different status tabs (e.g., “Action Required”, “Approved”).
    2. Type a vendor name (e.g., “ForceStore”) into the search bar.
  • System workflow:

    1. The Frontend sends an API query request with the corresponding parameters (status, keyword).
    2. The Backend executes the query on DynamoDB and returns the filtered results.
    3. The UI updates the list and the real-time statistic cards reflecting the total document counts.
  • Evidence:

    Filter Evidence 1

    Filter Evidence 2

    Filter Evidence 3

    Filter Evidence 4

Scenario 6: Export Reports & View Raw Data (Export CSV & View JSON)

  • Simulation steps:

    1. Click the “Export CSV” button on the document list page.
    2. Open the details of a document and click the “JSON” or “Download original” button.
  • System workflow:

    1. The Export CSV feature aggregates the data from the current list and triggers a .csv file download in the browser.
    2. The “JSON” button displays the raw JSON data returned by Textract/AI Proxy that is stored in the system.
  • Evidence:

    Export CSV and JSON 1

    Export CSV and JSON 2

    Export CSV and JSON 3

    Export CSV and JSON 4

    Export CSV and JSON 5

    Export CSV and JSON 6

3. Expected Result

  • The asynchronous processing pipeline and frontend interface behave correctly across all test scenarios.
  • Automated alerting dispatches warnings on failures and review-required triggers.
  • S3 and DynamoDB maintain consistent data mapping.