Back to Contractor & Freelancer Management

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

Contractor and Freelancer Management Automation

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

This document defines the complete quality assurance process for the Contractor and Freelancer Management automation, covering both the Contractor Onboarding Agent and the Invoice Processing Agent. It is structured across three sequential phases: unit testing, integration and edge case testing, and end-to-end production validation. The FullSpec team owns all execution through Phase 2 and runs Phase 3 jointly with your process owner. No phase begins until every test case in the preceding phase has a confirmed pass status. All test IDs are sequential across phases so every result can be traced back to a single reference in the FullSpec confirmation record.

01Testing approach

Testing runs in three phases in sequence. No phase begins until the previous phase fully passes. Phase 1 validates each agent in isolation using sandbox credentials. Phase 2 validates the handoffs between agents and introduces edge cases including missing data, duplicate records, and tool unavailability. Phase 3 is a live production run traced end to end, completed jointly with your process owner before go-live is confirmed.

1
Phase 1: Unit Testing
Each agent tested in isolation against sandbox environments
Scope
Individual agent logic: trigger detection, field mapping, API calls, decision branches, and output records for the Contractor Onboarding Agent and the Invoice Processing Agent independently.
Environment
Sandbox only. No production HubSpot contacts, DocuSign envelopes, Xero bills, or Gusto payee records are created during Phase 1.
Credential rule
All API credentials must be sandbox or test-mode tokens. Production OAuth tokens are not loaded into the automation platform during this phase.
Pass condition
All test cases T01 through T14 return the expected output with no unhandled errors. Any failure blocks progression to Phase 2.
Who runs it
FullSpec team only. Process owner is not required during Phase 1.
2
Phase 2: Integration and Edge Case Testing
Agent handoffs, cross-tool data flow, and failure scenarios
Scope
End-to-end data flow between agents, tool handoffs (HubSpot to DocuSign, DocuSign to Google Drive, invoice to Slack to Xero to Gusto), and all defined edge cases including duplicates, missing fields, and unavailable tools.
Environment
Sandbox for all destructive or write operations. Read operations against staging data in HubSpot and Xero where sandbox records are insufficient.
Credential rule
Sandbox credentials only. Gusto test-mode and Xero demo company must be confirmed active before this phase begins.
Pass condition
All integration test cases T15 through T22 and all edge case tests E01 through E08 pass. Exception routing cases must produce the correct Slack alert and halt further automation steps without data corruption.
Who runs it
FullSpec team only. Results are shared with the process owner before Phase 3 is scheduled.
3
Phase 3: End-to-End Production Test
Live production run with real credentials, process owner present
Scope
A full production trace using a designated internal test contractor record and a test invoice. Every system write is verified and then voided or deleted after the run. Error logs are reviewed in full.
Environment
Production. Real HubSpot, DocuSign, Google Drive, Slack, Xero, and Gusto accounts. Internal test data only, no real contractor is onboarded during this run.
Credential rule
Production OAuth tokens and API keys active. Confirm that all scopes granted in Phase 1 and 2 are reflected in the production credential set before starting.
Pass condition
All production test cases T23 through T27 pass, including the final process owner review and approval case (T27). Approval is recorded in the FullSpec confirmation document.
Who runs it
FullSpec team executes; process owner (HR Manager or Finance Administrator) is present and reviews outputs at each checkpoint. Process owner sign-off is captured as test case T27.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only. Do not load production API tokens, OAuth grants, or live DocuSign template IDs into the automation platform during Phase 1. All HubSpot contacts, DocuSign envelopes, Google Drive files, and Gusto payee records created in this phase must be in test or sandbox mode and will not affect live data.

Contractor Onboarding Agent: unit test cases

ID
Scenario
Input
Expected output
Pass criteria
T01
Happy path: new contractor form submission triggers record creation
HubSpot form submission with name, role, rate, and start date populated
New HubSpot contact created with contractor tag; all fields correctly mapped
Contact record exists in HubSpot sandbox with no missing required fields within 30 seconds of trigger
T02
DocuSign agreement dispatched on record creation
HubSpot contact record with contractor tag and valid email address
DocuSign envelope sent to contractor email using the correct role-matched template; envelope status set to Sent
DocuSign sandbox confirms envelope created and delivered; template ID matches the role specified in the record
T03
Document collection email sent after DocuSign dispatch
Confirmed HubSpot contractor record with email address
Structured document checklist email sent to contractor with Google Drive upload link included
Email delivery confirmed in sandbox send log; upload link resolves to the correct Drive folder path
T04
Automated reminder triggered when documents not received within 3 business days
Contractor record with no Drive files attached after 72-hour window
Follow-up reminder sent to contractor; Slack alert posted to HR channel identifying the contractor by name and outstanding items
Reminder email sent at correct interval; Slack message appears in designated HR channel with contractor name and checklist items listed
T05
Gusto payee created after DocuSign completion and Drive filing confirmed
DocuSign status webhook: envelope completed; Google Drive folder contains all required documents
Contractor created as payee in Gusto sandbox with correct bank details and rate from HubSpot record
Gusto sandbox shows new contractor vendor record; rate and bank field values match HubSpot source data exactly
T06
Trigger fires but HubSpot contact already exists (duplicate)
Form submission with email address matching an existing HubSpot contact
Automation detects duplicate, halts record creation, posts Slack alert to HR channel flagging the duplicate email
No second HubSpot contact created; Slack alert received with duplicate email identified; workflow terminates cleanly
T07
DocuSign dispatch fails: invalid or bounced contractor email
HubSpot record with malformed email address (e.g. no domain suffix)
DocuSign returns delivery failure; automation logs error, updates HubSpot contact with status 'DocuSign Failed', posts alert to HR Slack channel
HubSpot contact status updated; Slack alert fired; no retry loop initiated; error logged with timestamp
T08
Google Drive upload link used but file lands in wrong folder due to missing contractor ID
Drive upload event where contractor ID metadata is absent from file
Automation detects missing ID, moves file to a quarantine folder named 'Unmatched Documents', and alerts HR via Slack
File appears in quarantine folder within 60 seconds; Slack message includes file name and upload timestamp

Invoice Processing Agent: unit test cases

ID
Scenario
Input
Expected output
Pass criteria
T09
Happy path: invoice received, amount matches agreed rate
Invoice email received with PDF attachment; contractor exists in HubSpot with agreed rate on record
Invoice parsed; amount validated against HubSpot rate field; Slack approval request sent to designated manager
Slack message delivered to correct manager channel with invoice amount, contractor name, and approve/query buttons rendered
T10
Manager approves invoice via Slack; Xero bill created and payment scheduled
Slack approval interaction payload confirming approval
Xero bill created in sandbox with correct amount, category, and PDF attachment; payment scheduled for next run; contractor confirmation email sent
Xero sandbox bill record exists with correct fields; payment date populated; confirmation email logged in send log
T11
HubSpot approval decision logged after Slack interaction
Slack approval payload linked to HubSpot contractor record
HubSpot activity log updated with approval timestamp, approver name, and invoice reference
HubSpot activity feed shows approval event within 60 seconds of Slack interaction
T12
Invoice amount does not match agreed rate in HubSpot
Invoice PDF with amount 15% higher than HubSpot rate field value
Automation halts Slack approval routing; flags invoice as mismatched; posts alert to Finance Slack channel with variance amount; no bill created in Xero
No Xero bill created; Finance Slack alert received with contractor name, invoice amount, agreed rate, and variance clearly stated
T13
Invoice received for contractor not found in HubSpot
Invoice email with sender email address not matching any HubSpot contact
Automation logs unmatched invoice, saves PDF to a holding folder in Google Drive, and alerts Finance via Slack
Invoice PDF in holding folder; Slack alert identifies sender email and confirms no HubSpot match found; no downstream steps triggered
T14
Xero bill creation fails: API timeout or authentication error
Valid approved invoice; Xero sandbox returns 503 or 401 response
Automation retries twice with 90-second intervals; on third failure logs error with response code, alerts Finance Slack channel, and halts payment scheduling
Error log contains response code and timestamp for each attempt; Finance Slack alert received after third failure; no partial bill record in Xero
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Integration tests validate that data flows correctly across tool boundaries and that the handoff between the Contractor Onboarding Agent and the Invoice Processing Agent produces a consistent record state in HubSpot throughout. All IDs continue the T sequence from Phase 1.

ID
Scenario
Tools involved
Expected output
Pass criteria
T15
Full onboarding handoff: HubSpot record created, DocuSign sent, Drive folder created, Gusto payee added in one uninterrupted sequence
HubSpot, DocuSign, Google Drive, Gusto
All four systems reflect consistent contractor data with matching name, role, rate, and start date; no field drift between systems
Field values in all four sandbox systems are identical to the trigger payload values; no data transformation errors in logs
T16
DocuSign completion webhook triggers Gusto payee creation without manual intervention
DocuSign, HubSpot, Gusto
On envelope status change to Completed, Gusto payee record is created automatically within 2 minutes; HubSpot contact status updated to 'Agreement Signed'
Gusto sandbox payee created within 2-minute window; HubSpot status field updated; no manual step required
T17
Invoice Processing Agent reads rate from HubSpot record created by Onboarding Agent
HubSpot, Invoice Processing Agent
Agent correctly retrieves agreed rate from HubSpot contact record and uses it for invoice matching without requiring manual rate entry
Rate used in matching logic matches the value stored in HubSpot; no hardcoded fallback value used
T18
Slack approval triggers Xero and Gusto simultaneously without race condition
Slack, Xero, Gusto
On approval, Xero bill created and Gusto payment trigger fired in the correct order; Gusto does not fire before Xero bill reference is available
Xero bill ID is present in the Gusto payment payload; no Gusto call made before Xero confirms bill creation
T19
HR Slack alert for missing documents includes correct contractor name and outstanding document list
HubSpot, Google Drive, Slack
Slack message body pulls contractor name from HubSpot and outstanding document list by comparing Drive folder contents against required checklist
Slack message contains correct name and lists only the documents genuinely absent from the Drive folder; no false positives
T20
Contractor completes DocuSign before document collection email is sent: ordering conflict
DocuSign, HubSpot, Google Drive
System detects that DocuSign is already complete at the point of document email dispatch; sends document email regardless (DocuSign is separate from compliance documents); no duplicate emails sent
Document collection email sent exactly once; no duplicate; DocuSign status in HubSpot not reset
T21
Slack approval message sent but manager does not respond within 48 hours
Slack, HubSpot
Escalation reminder sent to manager after 48-hour timeout; HubSpot invoice record updated with 'Pending Approval' status; Finance team alerted via Slack
Escalation message sent at 48-hour mark; HubSpot status field updated; Finance Slack alert received with invoice details and manager name
T22
Second invoice submitted by same contractor while first invoice approval is still pending
HubSpot, Slack, Xero
Second invoice queued in HubSpot; Slack notification to Finance noting a second invoice is pending while first is unresolved; no Xero bill created for second invoice until first is resolved
HubSpot shows two invoice records with distinct statuses; second Xero bill not created; Finance Slack alert received with both invoice references

Edge case tests cover scenarios where data is malformed, tools are temporarily unavailable, a contractor submits a duplicate record, or a human step times out. These tests use IDs in the E series.

ID
Scenario
Input condition
Expected behaviour
Pass criteria
E01
Duplicate contractor: same email submitted via form twice within 10 minutes
Two form submissions with identical email address
Second trigger detected as duplicate; second HubSpot record creation blocked; HR Slack alert identifies duplicate with timestamp of both submissions
Only one HubSpot contact created; Slack alert received; second submission logged with duplicate flag in automation error log
E02
Missing required field: contractor rate not included in trigger payload
Form submission or HubSpot record with rate field blank or null
Automation halts at rate validation step; HR Slack alert requests rate be entered manually before workflow resumes; no DocuSign sent
DocuSign not dispatched; HubSpot contact status set to 'Pending Rate Entry'; Slack alert received with contractor name and missing field identified
E03
Google Drive API unavailable at time of document folder creation
Drive API returns 503 at folder creation step
Automation retries three times with 2-minute intervals; on third failure posts alert to HR Slack channel with error details; document upload step queued for manual retry
Three retry attempts logged with timestamps; HR Slack alert received after final failure; no partial folder created in Drive
E04
DocuSign template not found: template ID in HubSpot record does not match any active DocuSign template
HubSpot record with role value that maps to a deleted or draft DocuSign template
Automation catches template not found error; logs error with template ID; alerts HR Slack channel to assign the correct template before retrying
No envelope created; HR Slack alert received with the unresolvable template ID; HubSpot contact status set to 'DocuSign Template Error'
E05
Invoice PDF unreadable: file corrupted or zero-byte attachment
Invoice email with zero-byte PDF attachment
Automation detects unreadable file; saves original email to holding folder; alerts Finance via Slack to request a replacement invoice from the contractor
No invoice data extracted; Finance Slack alert received with sender details; original email reference logged; no Xero bill attempted
E06
Gusto API returns authentication error during payee creation
Gusto access token expired at time of payee creation step
Automation attempts token refresh; if refresh fails, logs error and alerts Finance Slack channel; Gusto payee creation queued for retry after manual token renewal
Token refresh attempt logged; Finance Slack alert received with error type; no partial Gusto record created; retry queue updated
E07
Human timeout: HR reviewer does not act on a flagged missing document within 5 business days
HR Slack alert for missing document with no action taken for 5 business days
Escalation alert sent to Operations Lead (Priya Menon) via Slack; HubSpot contractor record updated with escalation timestamp; contractor start date flag added
Escalation Slack message sent to correct channel at 5-business-day mark; HubSpot record shows escalation flag; original HR alert remains open
E08
Slack workspace temporarily unavailable during approval routing
Slack API returns 503 at approval message dispatch step
Automation retries Slack delivery twice at 5-minute intervals; on second failure sends approval request via email to the manager's address stored in HubSpot; logs Slack failure with timestamp
Email approval request sent to correct manager address after Slack retry failures; Slack failure logged; invoice record in HubSpot updated with 'Approval Via Email' status
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 (e.g. test-contractor@[YourCompany.com]) for the contractor record and a test invoice amount that is clearly identifiable (e.g. $1.00). Every record written to production systems during this phase (HubSpot contact, DocuSign envelope, Google Drive file, Gusto payee, Xero bill) must be voided, deleted, or archived immediately after the test run is confirmed as passed. Do not use a real contractor's details or a real invoice in this run. Confirm with your Xero and Gusto administrators that the test bill and payee can be removed before scheduling this phase.

Phase 3 runs the complete automation in production from trigger to payment confirmation. The FullSpec team executes each step and the process owner (HR Manager or Finance Administrator) reviews outputs at each checkpoint. All test case IDs continue the T sequence from Phase 2.

ID
Scenario
Steps covered
Expected output
Pass criteria
T23
Full production onboarding run: test contractor form submission to DocuSign dispatch
Trigger detection, HubSpot contact creation, DocuSign envelope dispatch, document collection email send
HubSpot contact created with all fields; DocuSign envelope delivered to test email address; document collection email received with correct Drive upload link
Process owner confirms receipt of DocuSign envelope and document email at test address; HubSpot contact visible in production CRM with correct field values; all within 3 minutes of form submission
T24
Document reminder and Slack alert fired after simulated 3-business-day window
Reminder timer logic, Slack HR channel alert, Drive folder status check
Reminder email sent to test address; Slack HR channel receives alert naming the test contractor and listing outstanding documents
Reminder email received at test address; Slack message visible in HR channel with correct contractor name; Drive folder confirmed empty at time of alert
T25
DocuSign completion simulated: Gusto payee created and HubSpot status updated
DocuSign webhook delivery, HubSpot status update, Gusto payee creation
Gusto production account shows new contractor payee with test details; HubSpot contact status updated to 'Agreement Signed'; payee immediately archived after confirmation
Gusto payee record confirmed by Finance Administrator; HubSpot status field updated; payee voided in Gusto within 10 minutes of confirmation
T26
Test invoice submitted, matched, approved via Slack, Xero bill created and voided
Invoice receipt, rate matching, Slack approval routing, Xero bill creation, payment scheduling, contractor confirmation email
Slack approval request delivered to designated manager; on approval Xero bill created for $1.00 with correct category and attachment; confirmation email sent to test address; Xero bill voided immediately after confirmation
Manager confirms Slack approval message received with correct details; Finance Administrator confirms Xero bill created; confirmation email received at test address; Xero bill voided and deletion confirmed in Xero audit log
T27
Error log review and process owner approval: final sign-off
Full automation error log review, process owner checkpoint review of all Phase 3 outputs
FullSpec team presents error log confirming zero unhandled exceptions across T23 through T26; process owner reviews all system outputs and confirms the automation is ready for go-live
Process owner (HR Manager or Finance Administrator) confirms in writing via the FullSpec confirmation document that all Phase 3 outputs are correct and the automation is approved for live use. This confirmation is the go-live gate. No separate signature block is required.
Once T27 is confirmed and the FullSpec go-live approval is recorded, the FullSpec team will remove all test records from production systems, activate live monitoring, and hand over the process runbook and exception handling guide to your HR and Finance team. Contact the FullSpec team at support@gofullspec.com for any question arising before or after go-live.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Contractor & Freelancer Management.

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