Back to Document Management & Filing

Test and QA Plan

How the build is validated before go-live: three sequential test phases, edge cases, and production verification.

4 pagesPDF · Quality
FS-DOC-06Quality

Test and QA Plan

Document Management and Filing

[YourCompany.com] · Operations Department · Prepared by FullSpec · [Today's Date]

This document defines the complete testing programme for the Document Management and Filing automation, covering the Document Classification Agent and the Filing and Routing Agent. It is written for the FullSpec build team and is structured across three sequential phases: unit testing in sandbox, integration and edge-case testing in sandbox, and end-to-end validation in production. No phase begins until the previous phase fully passes. The process owner joins Phase 3 to review results and record final approval.

01Testing approach

Testing runs in three phases in sequence. No phase begins until every test case in the previous phase has a confirmed pass status. Phase 1 validates each agent in isolation using sandbox credentials and sample documents. Phase 2 validates agent handoffs and stress-tests edge cases that are likely to appear in live operation. Phase 3 runs a full end-to-end sequence in the production environment with real credentials, real folders, and real Notion and Slack targets, after which the process owner confirms acceptance.

1
Phase 1: Unit Testing
Each agent tested in isolation before handoff logic is introduced
Scope
Document Classification Agent and Filing and Routing Agent tested independently. No live agent-to-agent calls.
Environment
Sandbox only. No production credentials, folders, or Notion databases are touched.
Credential rule
All sandbox credentials must be stored in the test credential vault. Production tokens must not be present in the Phase 1 environment.
Pass condition
All test cases T01 through T10 return the expected output with zero critical failures. Amber warnings are documented and triaged before Phase 2 begins.
Who runs it
FullSpec team only. Process owner is not required for Phase 1.
2
Phase 2: Integration and Edge Case Testing
Agent handoffs, tool connections, and failure-mode resilience
Scope
Full agent-to-agent handoff chain, all tool API connections (Gmail, DocuSign, Google Drive, Notion, Slack), and a structured set of edge cases covering duplicates, missing data, unavailable tools, and human-timeout scenarios.
Environment
Sandbox environment with sandbox API credentials for all five tools. A dedicated test Drive folder tree, a test Notion database, and a private test Slack channel are used throughout.
Credential rule
Sandbox OAuth tokens for Gmail and Drive, a DocuSign developer account, a Notion integration token scoped to the test workspace, and a Slack bot token scoped to the test channel only.
Pass condition
All integration cases T11 through T18 pass. All edge cases E01 through E06 produce the correct fallback behaviour (Slack alert to operations coordinator, no silent drop, no misfiling). Zero unhandled exceptions.
Who runs it
FullSpec team only. Results are shared with the process owner as a summary report before Phase 3 is scheduled.
3
Phase 3: End-to-End Production Test
Full live run with production credentials and process owner sign-off
Scope
One complete production run per major document type (invoice, contract, HR form, compliance certificate) plus error-log verification and final process-owner approval.
Environment
Production. Live Gmail inbox, live DocuSign account, live Google Drive folder structure, live Notion document register, live Slack workspace.
Credential rule
Production OAuth tokens and API keys are used. All production credentials must be rotated to the FullSpec credential manager before Phase 3 begins. No sandbox tokens remain active.
Pass condition
Test cases T19 through T23 all pass. Process owner confirms acceptance. FullSpec records approval in the project confirmation log. No separate signoff block is required.
Who runs it
FullSpec team executes T19 through T22. Process owner participates in T23 (review and approval).
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only. Do not connect any production Gmail account, production DocuSign envelope, production Drive folder, production Notion workspace, or production Slack channel during Phase 1. All test documents must be sample files stored in the FullSpec test asset library. No real client or staff data should be used.

Document Classification Agent — build estimated at 10 hours, complexity: Moderate.

ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: supplier invoice via Gmail
Sandbox Gmail message with a single PDF attachment labelled 'INV-2025-0042.pdf', body text referencing supplier name 'Acme Supplies'
Metadata object: { document_type: 'Invoice', party_name: 'Acme Supplies', document_date: '2025-06-15' }
All three metadata fields populated; confidence score above threshold; no exception flag raised
T02
Happy path: signed contract via DocuSign
DocuSign sandbox webhook payload for a completed envelope containing a PDF contract between two named parties
Metadata object: { document_type: 'Contract', party_name: '[Party Name from envelope]', document_date: '[Completion date]' }
Document type returned as 'Contract'; party name matches envelope recipient; date matches completion timestamp
T03
Happy path: HR form via Gmail
Sandbox Gmail message with a DOCX attachment titled 'LeaveRequest_JessHuang.docx'
Metadata object: { document_type: 'HR Form', party_name: 'Jess Huang', document_date: '[Email received date]' }
document_type is 'HR Form'; party_name extracted from filename and/or body text; no exception raised
T04
Happy path: compliance certificate via Gmail
Sandbox Gmail message with a PDF attachment referencing an ISO certification and a certificate date in the body
Metadata object: { document_type: 'Compliance Certificate', party_name: '[Issuing body name]', document_date: '[Certificate date]' }
All three fields correctly extracted; confidence above threshold; output passed to Filing and Routing Agent stub
T05
Failure mode: unreadable or password-protected PDF
Sandbox Gmail attachment that is a password-protected PDF with no accessible text layer
Agent sets confidence below threshold; triggers exception flag; does not produce a metadata object
Exception flag raised; Slack alert payload generated; no metadata object emitted; no silent failure
T06
Failure mode: email with no attachment
Sandbox Gmail message with no file attachment and body text that does not reference a document
Agent detects no attachment; workflow exits gracefully with a log entry; no classification attempted
No metadata object produced; no exception Slack alert raised (not an error condition); execution log records 'no attachment detected'
T07
Failure mode: ambiguous document type
Sandbox PDF that contains both invoice line items and contract clauses with no clear header
Agent confidence score falls below threshold; exception flag triggered
Exception flag raised; document attached to Slack alert payload; reason string populated with 'ambiguous document type'
T08
Failure mode: missing party name
Sandbox PDF invoice with all party name fields blank or redacted
Agent extracts document_type and document_date but cannot populate party_name; confidence drops below threshold
Exception flag raised; reason string reads 'party name not identified'; document routed to manual review path
T09
Failure mode: DocuSign webhook payload malformed
Simulated DocuSign webhook POST with a missing 'envelopeId' field
Agent rejects the payload; logs a structured error; does not attempt classification
Error logged with payload dump; no classification attempted; no exception Slack alert sent (infrastructure error, not a document exception)
T10
Happy path: multi-page contract PDF with clear header
Sandbox 12-page PDF contract with a clear title page naming both parties and a contract date
Metadata object: { document_type: 'Contract', party_name: '[Client name from title page]', document_date: '[Date from title page]' }
Correct extraction from title page only; remaining pages do not cause confusion; confidence above threshold

Filing and Routing Agent — build estimated at 12 hours, complexity: Moderate.

ID
Scenario
Input
Expected Output
Pass Criteria
T11
Happy path: invoice filed to correct Drive folder
Metadata object from T01 stub: { document_type: 'Invoice', party_name: 'Acme Supplies', document_date: '2025-06-15' }
File renamed to 'AcmeSupplies_Invoice_2025-06-15.pdf'; uploaded to sandbox Drive path /Invoices/2025/; Notion row created; Slack confirmation sent to test channel
File appears in correct sandbox Drive folder; filename matches naming convention exactly; Notion row contains all five required fields; Slack message received in test channel within 30 seconds
T12
Happy path: contract filed and logged
Metadata object: { document_type: 'Contract', party_name: 'Beta Corp', document_date: '2025-06-10' }
File renamed to 'BetaCorp_Contract_2025-06-10.pdf'; filed to /Contracts/2025/; Notion row created with direct Drive link; Slack message sent
Naming convention correct; Drive path correct; Notion row includes file name, type, date, folder path, and Drive link; Slack message includes Drive link
T13
Happy path: HR form filed with correct subfolder routing
Metadata object: { document_type: 'HR Form', party_name: 'Jess Huang', document_date: '2025-06-12' }
File renamed to 'JessHuang_HRForm_2025-06-12.docx'; filed to /HR/Forms/2025/; Notion and Slack steps complete
Correct subfolder used for HR; filename uses DOCX extension not PDF; all downstream steps execute
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Integration tests validate the full agent handoff chain and confirm that each tool API connection behaves correctly under normal conditions. IDs continue from the Phase 1 sequence.

ID
Scenario
Input
Expected Output
Pass Criteria
T14
Full chain: Gmail trigger through to Slack confirmation
Real sandbox Gmail message with a clean supplier invoice PDF attached
Classification Agent extracts metadata; Filing Agent applies naming, uploads to Drive, creates Notion row, posts Slack message; total elapsed time under 60 seconds
All four tool actions complete; no manual intervention; elapsed time under 60 seconds; correct outputs in all four tools
T15
Full chain: DocuSign completion through to Slack confirmation
DocuSign sandbox envelope marked completed; webhook fires to automation platform
Classification Agent reads envelope PDF; Filing Agent files to /Contracts/; Notion and Slack complete
Webhook received and parsed correctly; classification runs within 15 seconds of webhook receipt; filing completes without error
T16
Notion log entry field completeness check
Metadata object for an invoice: { document_type: 'Invoice', party_name: 'Delta Ltd', document_date: '2025-06-20' }
Notion row with fields: File Name, Document Type, Date, Folder Path, Drive Link, Logged At timestamp
All six Notion fields populated; Drive Link is a valid clickable URL to the sandbox Drive file; Logged At is within 5 seconds of upload timestamp
T17
Slack notification content and format check
Completed filing run for a contract document
Slack message to test channel containing: document name, document type, Drive folder path, direct Drive link, and a confirmation line
Message appears in test channel; all five required fields present; Drive link resolves to the correct sandbox file; no raw JSON or template errors visible
T18
Exception path: low-confidence classification triggers correct Slack alert
Sandbox PDF with ambiguous content that causes Classification Agent to score below confidence threshold
Filing Agent is not invoked; exception Slack alert posted to test channel with file attached and reason string
Filing Agent receives no metadata object; exception Slack alert arrives in test channel within 30 seconds; file attachment present in alert; reason string is human-readable

Edge case tests confirm that the automation handles unusual or degraded inputs without silent failures, data loss, or misfiling. Each case must produce the defined fallback behaviour.

ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate document: file already exists in Drive folder
Metadata object produces the same filename as a file already present in the target Drive folder
Agent detects conflict; appends '_v2' suffix to filename; uploads without overwriting the original; Notion row created with version note
Original file unmodified in Drive; new file present with '_v2' suffix; Notion row flags duplicate; Slack message notes version conflict
E02
Missing document date in metadata
Classification Agent returns a metadata object where document_date is null
Filing Agent uses the email received date or DocuSign completion date as a fallback; filename uses fallback date; proceeds without triggering exception alert
Filename includes a valid date (fallback source); Notion row populated with fallback date and a note indicating the source; no exception alert raised
E03
Google Drive API unavailable at upload time
Drive API returns a 503 error on the upload call
Automation platform retries up to three times with exponential backoff; if all retries fail, Slack alert sent to operations coordinator with file attached and error code
Three retry attempts logged; after final failure, Slack alert received with error code '503' and file attached; no data lost; Notion row not created (prevents orphaned log entry)
E04
Notion API rate limit exceeded
Notion API returns a 429 Too Many Requests response during the log-entry step
Automation platform queues the Notion write and retries after the Retry-After header interval; Drive upload and Slack notification complete normally
Drive file correctly filed before retry; Slack notification sent; Notion row created after successful retry; no duplicate rows created
E05
Large attachment exceeding 10 MB
Gmail message with a 14 MB multi-page PDF attached
Classification Agent reads the first pages sufficient to extract metadata; Filing Agent uploads via resumable upload to Drive; full flow completes
No timeout or truncation error; file fully present in Drive; filesize recorded in Notion row; elapsed time under 120 seconds
E06
Human-review timeout: coordinator does not respond to exception alert within 24 hours
Exception Slack alert sent for an unclassified document; no human action taken within 24 hours
Automation platform sends a follow-up Slack reminder to the operations coordinator at the 24-hour mark; document remains unactioned in a holding state
Reminder message sent at 24 hours; original alert message thread updated with reminder reference; document not discarded or auto-filed; holding state visible in Notion exception log
Test and QA PlanPage 3 of 4
FS-DOC-06Quality

04Phase 3 — end-to-end production test

Important before running Phase 3: Use an internal test email address (not a monitored client inbox) to send all test documents. Use a DocuSign test envelope directed to an internal recipient only. All test records created in Notion and Google Drive during Phase 3 must be voided or deleted after approval is confirmed. Do not use any real client documents, real supplier invoices, or live staff personal information as test inputs. Confirm with the process owner that a quarantine folder exists in Drive before Phase 3 begins.
ID
Scenario
Input
Expected Output
Pass Criteria
T19
Production run: supplier invoice end-to-end
Internal test email to production Gmail inbox with a sample invoice PDF (no real supplier data); sender address is an internal @[YourCompany.com] address
Classification Agent extracts correct metadata; Filing Agent renames file using production naming convention; file appears in production Drive /Invoices/2025/ folder; Notion row created in live document register; Slack confirmation posted to production document owner channel
File present in correct production Drive folder within 60 seconds of email receipt; filename matches convention exactly; Notion row verified by FullSpec team; Slack message received and verified by FullSpec team; no manual action taken
T20
Production run: signed contract via DocuSign end-to-end
Internal DocuSign test envelope completed between two internal test accounts
Classification Agent classifies as 'Contract'; Filing Agent files to production /Contracts/2025/ folder; Notion and Slack steps complete
DocuSign webhook received in production environment; full chain completes within 60 seconds of envelope completion; all four tool actions verified in production
T21
Production run: HR form end-to-end
Internal test email with a sample HR leave-request form PDF addressed to the monitored inbox
Correct metadata extracted; file routed to production /HR/Forms/2025/ folder; Notion logged; Slack confirmation sent to HR Slack channel
Correct subfolder routing confirmed in production Drive; Notion row present with all required fields; Slack message in correct channel
T22
Error log verification: confirm all exceptions and retries are captured
Review the automation platform execution log after T19 through T21 have completed
Execution log shows one successful run per test case; no unhandled exceptions; retry events (if any) are logged with timestamps and error codes; all log entries are human-readable
FullSpec team reviews log output; confirms no silent failures; confirms all retry events documented; log exported and attached to project confirmation record
T23
Process owner review and approval
Process owner reviews the filed test documents in production Drive, the Notion log entries, and the Slack notifications generated during T19 through T21
Process owner confirms: correct folder routing, correct file naming, correct Notion log content, correct Slack message format, and acceptable end-to-end elapsed time. Process owner records approval verbally or in writing to the FullSpec team.
Process owner confirms all outputs are correct. FullSpec team records approval in the FullSpec project confirmation log with the process owner's name, date, and approval status. No separate signoff block is required. Test and QA Plan is marked complete.
After T23 is recorded as approved, the FullSpec team will delete all test records from production Drive, remove test Notion rows, and confirm deletion to the process owner by Slack message. The production environment is then considered clean and ready for live operation. Contact support@gofullspec.com for any queries arising from Phase 3 results.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Document Management & Filing.

Launch Plan
Operations · Owner
View
ROI and Business Case
Finance · Owner
View
Process Runbook / SOP
Operations · Owner
View
Developer Handover Pack
Technical · Developer
View
Integration and API Spec
Technical · Developer
View