Back to Contract Generation & E-sign

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

Contract Generation & E-sign

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

This document defines the complete test and quality assurance plan for the Contract Generation and E-sign automation. It is written for the FullSpec build team and covers every test case that must pass before the automation goes live in production. Tests are organised across three sequential phases: unit tests for individual agents, integration and edge-case tests for agent handoffs and failure modes, and a final end-to-end run in the production environment. The process owner joins Phase 3 to review results and confirm sign-off. No phase begins until the previous phase has fully passed.

01Testing approach

All testing follows three phases in strict sequence. No phase begins until every test case in the previous phase reaches a passing state and is logged in the FullSpec test tracker. Phase 1 isolates each agent. Phase 2 tests the joints between agents and exercises edge cases. Phase 3 runs a complete production trace with live credentials and confirms the process owner is satisfied with outputs before go-live is authorised.

1
Phase 1: Unit Testing
Each agent tested in isolation against sandbox data
Scope
Contract Assembly Agent, Signature Tracking and Follow-up Agent, and Post-Signature CRM and Notification Agent — each tested independently with mocked inputs and outputs.
Environment
Sandbox only. HubSpot sandbox account, Google Drive test folder, DocuSign developer sandbox, Gmail test address, Slack test workspace.
Credential rule
No production credentials may be used in Phase 1. All API keys, OAuth tokens, and webhook endpoints must reference sandbox or developer-tier accounts.
Pass condition
All cases T01 through T12 return the expected output with no unhandled errors. Each failure-mode case must trigger the defined error response, not a silent failure.
Who runs it
FullSpec team only. Process owner is not required in Phase 1.
2
Phase 2: Integration and Edge-Case Testing
Agent handoffs and failure scenarios tested end to end in sandbox
Scope
Agent-to-agent handoffs across the full automated flow, plus edge cases including duplicate deals, missing required fields, unavailable external tools, and human approval timeout in Slack.
Environment
Sandbox only. All five integrated tools (HubSpot, Google Drive, DocuSign, Gmail, Slack) must be connected simultaneously in the sandbox workspace.
Credential rule
Sandbox credentials only. OAuth scopes must match the production scope list to ensure no permission gaps are discovered at Phase 3.
Pass condition
All cases T13 through T19 pass and all edge cases E01 through E06 resolve according to the defined fallback behaviour. No case may leave the workflow in a silent hung state.
Who runs it
FullSpec team only. Process owner may observe but is not required.
3
Phase 3: End-to-End Production Test
Live credentials, real deal records, process owner review required
Scope
A full production run from HubSpot Closed Won trigger through to signed PDF attached to the deal record and Slack notification delivered, using a designated internal test deal.
Environment
Production. Live HubSpot account, production Google Drive, production DocuSign account, live Gmail, live Slack workspace. Test deal record must be voided and deleted after the run.
Credential rule
Production credentials active. Confirm all OAuth tokens have been rotated from sandbox values. DocuSign production API key must be distinct from the sandbox key.
Pass condition
All cases T20 through T23 pass, including process owner review (T23). Process owner sign-off is recorded in the FullSpec confirmation log, not as a separate document.
Who runs it
FullSpec team runs the automation. Process owner joins to review outputs and provide approval at case T23.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only during Phase 1. Do not connect production HubSpot, DocuSign, Google Drive, Gmail, or Slack accounts at any point during unit testing. Use the dedicated FullSpec sandbox workspace. All test deal records created in Phase 1 must use fictional company names and non-real email addresses.

Contract Assembly Agent — estimated build time: 10 hours, complexity: Moderate. Tests T01 through T05 cover this agent.

ID
Scenario
Input
Expected output
Pass criteria
T01
Happy path: standard deal, single template match
HubSpot sandbox deal with deal_type='Standard', contact name, address, price, payment_terms all populated
Correct Google Drive template selected; all merge fields populated in the output document; document stored in the designated output folder
Output document contains zero unfilled placeholders; file appears in Google Drive output folder within 30 seconds of trigger
T02
Template selection: deal type requires regional template variant
HubSpot sandbox deal with deal_type='Enterprise', region='EU'
EU-specific template selected over the default template; all fields merged correctly
Template filename in Google Drive matches the EU variant; merge fields all resolved
T03
Missing required field: pricing absent from deal
HubSpot sandbox deal with amount field blank
Workflow halts; error event logged; Slack alert posted to the internal errors channel with the deal ID and missing field name
No output document generated; error log entry present; Slack message received within 60 seconds
T04
Missing required field: customer contact email absent
HubSpot sandbox deal with associated contact having no email address
Workflow halts at assembly stage; error posted to Slack errors channel; no DocuSign envelope created
Automation does not proceed past assembly; error log entry contains deal ID and 'contact_email missing'
T05
No matching template found for deal type
HubSpot sandbox deal with deal_type='Pilot' (unmapped type not in template library)
Workflow pauses; Slack notification sent to sales ops channel requesting manual template selection; deal ID included
No document generated; Slack message references deal ID and states 'no template matched'

Signature Tracking and Follow-up Agent — estimated build time: 9 hours, complexity: Moderate. Tests T06 through T09 cover this agent.

ID
Scenario
Input
Expected output
Pass criteria
T06
Happy path: envelope sent, customer opens and signs within 48 hours
DocuSign sandbox envelope in 'sent' status; envelope_id linked to deal; customer opens within simulated 24-hour window
No follow-up email triggered; DocuSign completion webhook received; status passed to Post-Signature Agent
Gmail sends zero follow-up messages; completion event forwarded correctly within 10 seconds of webhook receipt
T07
Follow-up at 48 hours: envelope unopened
DocuSign sandbox envelope in 'sent' status; no open event after simulated 48-hour elapsed marker
First follow-up email sent via Gmail to the customer contact on the deal; email uses the pre-approved 48-hour template
Gmail sandbox outbox shows exactly one email sent; subject line matches '48-hour reminder' template; sent timestamp is within 5 minutes of the 48-hour mark
T08
Follow-up at 96 hours: opened but unsigned
DocuSign sandbox envelope showing 'delivered' (opened) status; no signed event after simulated 96-hour marker
Second follow-up email sent via Gmail using the 96-hour template; first follow-up must have already been sent
Exactly two Gmail messages in outbox (48h and 96h); second email body references the contract and includes the DocuSign signing URL
T09
DocuSign API unavailable during status poll
DocuSign sandbox endpoint returns HTTP 503 for two consecutive polling attempts
Automation retries after a 5-minute backoff; after three failed retries, error is logged and Slack alert posted; envelope is not voided
Retry logic fires; Slack error alert received after third failure; envelope status unchanged in DocuSign sandbox

Post-Signature CRM and Notification Agent — estimated build time: 9 hours, complexity: Moderate. Tests T10 through T12 cover this agent.

ID
Scenario
Input
Expected output
Pass criteria
T10
Happy path: envelope completed, PDF attached to deal, Slack notified
DocuSign sandbox envelope status set to 'completed'; signed PDF downloadable via API; HubSpot sandbox deal ID present in metadata
Signed PDF attached to the correct HubSpot sandbox deal record; contract_status property set to 'Signed'; Slack test workspace receives completion message tagging the rep
HubSpot deal attachment count increases by one; attachment filename includes the deal ID; contract_status field = 'Signed'; Slack message arrives within 30 seconds
T11
HubSpot API rejects attachment (deal record locked or permission error)
DocuSign sandbox completion event fires; HubSpot API returns 403 on attachment attempt
Error logged; Slack error channel notified with deal ID and error code; PDF stored in fallback Google Drive folder pending manual attach
Slack error message includes deal ID and '403 attachment failed'; fallback Drive folder contains the signed PDF
T12
Duplicate completion webhook received for same envelope ID
DocuSign sends two identical 'completed' webhook events for the same envelope_id within 60 seconds
Idempotency check prevents a second PDF attachment and a second Slack message; only one attachment and one notification are created
HubSpot sandbox deal has exactly one attachment after both webhooks processed; Slack shows exactly one completion message
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Phase 2 tests the full handoff chain between agents and validates that failure modes at the boundaries between tools are handled gracefully. All tests remain in the sandbox environment. IDs continue from T13. Edge cases use the E01 series.

Integration test cases: agent handoffs

ID
Scenario
Input
Expected output
Pass criteria
T13
Full handoff: Contract Assembly Agent to Slack manager review gate
HubSpot sandbox deal moves to Closed Won; all required fields populated; standard deal type
Contract Assembly Agent produces draft document in Google Drive; Slack message posted in review channel with Drive preview link and approve/reject buttons within 2 minutes
Google Drive output folder contains the draft; Slack review message arrives with both action buttons rendered; no errors in run log
T14
Manager approves in Slack: handoff to DocuSign envelope creation
Slack approve button clicked by test user in sandbox Slack workspace
DocuSign sandbox envelope created from the approved document; envelope status moves to 'sent'; Signature Tracking Agent becomes active
DocuSign sandbox shows a new envelope in 'sent' state; envelope recipient email matches the HubSpot contact email; Signature Tracking Agent polling begins
T15
Manager rejects in Slack: flow loops back to assembly
Slack reject button clicked; rejection reason text entered in the Slack modal
Automation does not create a DocuSign envelope; rejection reason logged against the deal; Slack message posted to rep notifying of rejection and next action
DocuSign sandbox shows no new envelope; rejection note visible in run log; rep receives Slack notification within 60 seconds
T16
Full handoff: Signature Tracking Agent to Post-Signature Agent on envelope completion
DocuSign sandbox envelope moves to 'completed' status via API simulation
Signature Tracking Agent receives completion event and passes envelope_id and deal_id to Post-Signature Agent; Post-Signature Agent attaches PDF and posts Slack notification
Post-Signature Agent run log shows receipt of completion event; HubSpot sandbox deal has signed PDF attached; Slack completion message sent to the correct channels
T17
Slack review gate: manager does not respond within 24 hours
Slack review message sent; no button click recorded after simulated 24-hour window
Escalation message posted to the sales ops channel tagging the process owner; original review message marked as timed out in run log
Escalation Slack message arrives in ops channel; run log shows 'approval_timeout' event; no DocuSign envelope created
T18
Two deals close simultaneously: parallel runs do not cross-contaminate
Two HubSpot sandbox deals both transition to Closed Won within 30 seconds; different deal types requiring different templates
Each deal produces a separate correctly merged contract; each routes to the correct template; no field data from Deal A appears in Deal B's document
Two distinct Google Drive output files; each file's merged data matches only its originating deal record; no shared fields or envelope IDs
T19
Google Drive output folder permission check
Automation attempts to write merged document to the designated Google Drive output folder
File write succeeds; document is accessible to the service account used by the automation and to the sales manager's Google account
File appears in Drive within 30 seconds; file sharing settings show the service account as editor and the sales manager email as viewer

Edge-case test cases

ID
Scenario
Input
Expected output
Pass criteria
E01
Duplicate HubSpot trigger: deal stage toggled to Closed Won twice within 5 minutes
HubSpot sandbox deal stage set to Closed Won, then briefly moved back to Negotiation, then returned to Closed Won
Idempotency check detects an in-progress run for the same deal ID; second trigger is suppressed; no duplicate contract generated
Only one Google Drive document exists for the deal after both trigger events; run log shows 'duplicate trigger suppressed'
E02
Missing deal field discovered after assembly begins: scope/product line absent
HubSpot deal has all fields except the product_line field, which determines the template body clause
Assembly agent halts mid-run; Slack error posted to ops channel identifying the missing field; no partial document written to Drive
Google Drive output folder contains no partial file; Slack error message names 'product_line' as the missing field within 60 seconds
E03
Gmail API rate limit hit during follow-up send
Gmail API returns HTTP 429 when the automation attempts to send the 48-hour reminder
Automation retries after exponential backoff (1 min, 2 min, 4 min); if three retries fail, Slack error posted and email queued for manual send
Retry log shows three attempts with correct backoff intervals; if all fail, Slack alert includes the recipient address and the email draft body
E04
DocuSign envelope voided by the customer before signing
DocuSign sandbox envelope status changes to 'voided' via API simulation
Signature Tracking Agent detects the voided status; Slack notification sent to rep and sales ops channel; automation halts without attaching any document to HubSpot; deal status not updated to 'Signed'
HubSpot deal has no attachment from this run; deal contract_status property remains unchanged; Slack message states 'envelope voided' with deal and envelope IDs
E05
Slack unavailable when completion notification should be sent
Slack API returns HTTP 503 at the moment the Post-Signature Agent attempts to post the completion message
PDF still attached to HubSpot deal successfully; Slack message retried up to three times with 2-minute backoff; if all retries fail, error logged and flagged for manual follow-up
HubSpot deal attachment is present regardless of Slack availability; retry log shows up to three attempts; error log entry created on final failure
E06
Human approval timeout with no escalation contact configured
Slack manager approval gate times out at 24 hours; no escalation email or Slack user is configured in the workflow settings
Automation logs a configuration warning; posts a generic escalation message to the sales channel tagging the deal owner; does not silently halt
Sales channel receives escalation message within 5 minutes of timeout; run log contains 'escalation_contact_not_configured' warning; deal is not left in a silent hung state
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 as the DocuSign envelope recipient (for example, a shared inbox controlled by your team). Do not send a live DocuSign envelope to a real customer contact. After the test run is confirmed as passing, void the DocuSign test envelope, delete the test deal record from HubSpot, remove the test document from Google Drive, and archive the Slack notification messages. The FullSpec team will confirm each of these cleanup steps is complete before go-live is authorised.

Phase 3 uses live production credentials across all five integrated tools. The test deal must be created with clearly fictional data (for example, company name 'FullSpec QA Test Co', deal value $1) so it cannot be confused with a real commercial record. The FullSpec team runs the automation and the process owner observes and reviews each output in real time before confirming approval.

ID
Scenario
Input
Expected output
Pass criteria
T20
Full production run: trigger to contract draft in Slack
Production HubSpot deal 'FullSpec QA Test Co' moved to Closed Won; all required deal fields populated; deal_type set to 'Standard'
Contract Assembly Agent selects the correct production template from Google Drive, merges all deal fields, and posts the draft preview link to the production Slack review channel within 3 minutes of trigger
Production Google Drive output folder contains the merged draft; Slack review channel shows the message with approve/reject buttons; all merge fields in the document are populated with the test deal values; no unfilled placeholders present
T21
Manager approves in production Slack: DocuSign envelope sent to internal test address
Process owner or designated approver clicks Approve in the production Slack channel
DocuSign production envelope created and dispatched to the internal test inbox address; envelope status shows 'sent' in the DocuSign production dashboard
DocuSign production dashboard shows a new envelope addressed to the internal test email; envelope contains the correct signature and date fields; Signature Tracking Agent begins polling; no errors in run log
T22
Internal test inbox signs envelope: Post-Signature Agent attaches PDF and notifies Slack
Test team member signs the DocuSign envelope from the internal test inbox
Post-Signature Agent receives the 'completed' webhook from DocuSign; signed PDF attached to the HubSpot test deal record; contract_status property updated to 'Signed'; Slack completion notification posted to sales, finance, and delivery channels
HubSpot production test deal shows one new attachment (signed PDF); contract_status field = 'Signed'; Slack messages appear in all three configured channels within 60 seconds of signing; PDF file size is greater than zero and the document is readable
T23
Process owner review and approval: final sign-off
Process owner reviews the outputs from T20, T21, and T22: the merged document, the DocuSign audit trail, the HubSpot deal record, and the Slack notifications
Process owner confirms all outputs are correct and complete; approval recorded in the FullSpec confirmation log with a timestamp, the process owner's name, and the test deal ID; go-live is authorised
FullSpec confirmation log entry exists for this test run, containing the process owner name, approval timestamp, deal ID, and a checklist confirming document accuracy, CRM sync, and Slack delivery. No separate signoff document is required.
After T23 passes and the FullSpec confirmation log is updated, the FullSpec team will void the test DocuSign envelope, archive the test HubSpot deal, remove the test document from the Google Drive output folder, and confirm cleanup in writing to the process owner at support@gofullspec.com before the production automation is switched to live for real deals.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Contract Generation & E-sign.

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