FS-DOC-06Quality
Test and QA Plan
Referral Programme Management
[YourCompany.com] · Sales Department · Prepared by FullSpec · [Today's Date]
This document defines the structured test and quality assurance programme for the Referral Programme Management automation. It is written for the FullSpec team executing the build and is organised into three sequential phases: unit testing of individual agents, integration and edge-case testing across agent handoffs, and an end-to-end production run with the process owner. No phase begins until the previous phase has fully passed. The process owner joins Phase 3 only. All sandbox and production credentials must be handled according to the rules specified in each phase.
01Testing approach
Testing is executed across three phases in sequence. No phase begins until all test cases in the previous phase have reached a Pass status. Phase 1 isolates each agent and verifies its individual logic against controlled inputs. Phase 2 verifies the handoffs between agents and stress-tests the system against realistic edge cases including duplicates, missing data, and tool unavailability. Phase 3 runs a full traced execution in the production environment and concludes with formal process owner review and approval.
1Phase 1: Unit Testing
Each agent tested in isolation against sandbox credentials
Scope
Individual agent logic: Referral Intake Agent, Referral Communications Agent, Reward Processing Agent
Environment
Sandbox only. No production systems are touched in Phase 1.
Credential rule
Use sandbox API keys for Typeform, HubSpot, Google Sheets, Gmail, Slack, and Xero. Production credentials must not be loaded in this phase.
Pass condition
All test cases T01 through T15 return the expected output with no unhandled errors.
Who runs it
FullSpec team only.
2Phase 2: Integration and Edge Case Testing
Agent handoffs and failure scenarios verified in sandbox
Scope
Cross-agent handoffs, deal-stage triggers, and edge cases including duplicates, missing fields, tool outages, and human timeout scenarios
Environment
Sandbox only. Simulated tool failures are triggered by temporarily disabling sandbox API tokens.
Credential rule
Sandbox credentials remain active. No production tokens are introduced. Xero sandbox must have at least one test contact pre-configured matching a referrer record.
Pass condition
All integration test cases T16 through T22 pass, and all edge-case tests E01 through E06 return the correct exception handling behaviour.
Who runs it
FullSpec team only.
3Phase 3: End-to-End Production Test
Full traced run in production; process owner joins for sign-off
Scope
Complete workflow from Typeform submission through to Xero draft bill and reward notification email, using a real but voided test referral record
Environment
Production. Live API credentials for all six tools must be loaded and confirmed active before this phase begins.
Credential rule
Production credentials are used. The test referrer email must be an internal address owned by [YourCompany.com]. The test Xero bill and HubSpot deal must be voided or deleted after the run is confirmed complete.
Pass condition
All production test cases T23 through T26 pass, including T26 process owner review and approval, which is recorded in the FullSpec confirmation log.
Who runs it
FullSpec team executes; process owner joins to observe and approve at T26.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality
02Phase 1 — unit test cases
Sandbox credentials only. Before running any Phase 1 test, confirm that all six tool connections (Typeform, HubSpot, Google Sheets, Gmail, Slack, Xero) are pointed at sandbox or test environments. Do not load production API keys at this stage. Any test that writes a record must target a dedicated sandbox workspace or sheet tab named 'QA-TEST' to avoid polluting real data.
Referral Intake Agent — handles Typeform submission receipt, HubSpot duplicate check, contact and deal creation, reward tier assignment, and Google Sheets row logging.
ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: new referral, no duplicate
Valid Typeform submission: referrer email, referred contact email (not in HubSpot), name, phone
New HubSpot contact created; deal created with referrer custom field populated; reward tier applied; Google Sheets row appended with status 'Open'
All four records confirmed present with correct field values within 30 seconds of trigger
T02
Reward tier assignment: Tier 1 condition met
Typeform submission where referrer is tagged as Tier 1 in programme config
HubSpot deal custom field 'Reward Tier' = Tier 1; Google Sheets column 'Reward Amount' = Tier 1 value as configured
Tier 1 value matches config exactly; no default tier fallback applied
T03
Reward tier assignment: Tier 2 condition met
Typeform submission where referrer qualifies for Tier 2
HubSpot deal 'Reward Tier' = Tier 2; Google Sheets reward amount = Tier 2 value
Tier 2 value matches config; Tier 1 logic not applied
T04
Duplicate contact detected in HubSpot
Typeform submission where referred contact email already exists as an open HubSpot contact
No new contact or deal created; Slack message posted to sales manager channel flagging duplicate for review; Google Sheets row not appended
Duplicate flag visible in Slack within 60 seconds; no orphan records in HubSpot or Sheets
T05
Typeform payload missing referred contact email
Submission received with referrer email present but referred contact email field blank
Workflow pauses at intake; error logged in automation platform execution log; Slack alert posted to FullSpec monitoring channel
No partial records created; error log entry contains field name 'referred_contact_email' and submission ID
T06
HubSpot API returns 500 error during contact search
Valid Typeform payload; HubSpot sandbox API temporarily disabled to simulate outage
Workflow retries up to three times with 60-second back-off; after third failure, error logged and Slack alert fired to FullSpec monitoring channel
Retry count = 3 confirmed in execution log; no record created; alert received within 5 minutes of first failure
T07
Google Sheets append fails: sheet not found
Valid submission; HubSpot records created successfully; Google Sheets target tab name incorrect in config
HubSpot records remain; Sheets step fails with descriptive error in log; alert fired; no data loss in HubSpot
Error message references correct config key; HubSpot deal intact; Sheets row absent
Referral Communications Agent — handles acknowledgement email to referrer, Slack lead alert to sales rep, and reward notification email on deal closure.
ID
Scenario
Input
Expected Output
Pass Criteria
T08
Happy path: acknowledgement email sent on new deal creation
HubSpot deal created event; referrer email address present in deal custom field
Personalised Gmail email sent to referrer within 60 seconds of deal creation event; subject line contains referred contact name
Email received in sandbox Gmail inbox; referrer name and referred contact name correctly substituted in template body
T09
Happy path: Slack lead alert posted to sales rep channel
HubSpot deal created event; deal owner field maps to a configured Slack user ID
Formatted Slack message posted to rep's channel containing referrer name, referred contact name, and link to HubSpot deal
Slack message present in correct sandbox channel within 60 seconds; HubSpot deal URL resolves correctly
T10
Happy path: reward notification email sent on Closed Won
HubSpot deal stage changed to Closed Won; referrer email and reward tier present in deal fields
Personalised reward notification email sent via Gmail stating reward amount, expected payment date, and referrer name
Email received; reward amount matches tier configuration; no template placeholders left unfilled
T11
Referrer email address missing from HubSpot deal at acknowledgement step
HubSpot deal created event; referrer email custom field blank
Gmail send step skipped; error logged with deal ID and field name; Slack alert to FullSpec monitoring channel
No email send attempt; log entry contains deal ID and 'referrer_email' field reference
T12
Gmail API rate limit exceeded during bulk acknowledgement
Simulate 15 simultaneous deal-created events to trigger Gmail sandbox rate cap
Workflow queues outgoing emails; sends with exponential back-off; all 15 emails eventually delivered; no duplicates
All 15 sandbox inboxes receive exactly one email each; no 429 errors surface as unhandled failures in execution log
T13
Slack workspace token invalid at alert step
Valid deal created event; Slack sandbox token manually revoked to simulate expiry
Slack step fails; error logged with token reference; alert fired to FullSpec monitoring channel via fallback (email); Gmail acknowledgement still sends
Gmail acknowledgement confirmed delivered; Slack error captured in log; fallback alert received
Reward Processing Agent — monitors HubSpot deal stage changes, syncs Google Sheets register, and creates the Xero draft bill on Closed Won.
ID
Scenario
Input
Expected Output
Pass Criteria
T14
Happy path: deal stage change synced to Google Sheets
HubSpot deal stage changed from 'Proposal Sent' to 'Contract Signed'; deal tagged with referral source
Matching Google Sheets row updated: 'Deal Stage' column reflects 'Contract Signed'; 'Last Updated' timestamp updated
Sheets row updated within 30 seconds; no new row appended; existing row ID matches HubSpot deal ID
T15
Happy path: Xero draft bill created on Closed Won
HubSpot deal reaches Closed Won; referrer Xero contact ID present in deal field; reward tier mapped
Draft bill created in Xero sandbox: correct contact, correct reward amount per tier, due date 30 days from deal close date, status 'DRAFT'
Xero sandbox bill visible with status DRAFT; amount matches tier config; contact name matches referrer; finance team not notified until they log in to review
Test and QA PlanPage 2 of 4
FS-DOC-06Quality
03Phase 2 — integration and edge case tests
Phase 2 verifies that data flows correctly between agents at every handoff point and that the system responds predictably when inputs are malformed, tools are unavailable, or business-rule exceptions occur. Integration test IDs continue from T16. Edge-case tests use the E01 series.
ID
Scenario
Input
Expected Output
Pass Criteria
T16
Full handoff: Intake Agent to Communications Agent
Valid Typeform submission processed by Intake Agent; HubSpot deal and Sheets row confirmed created
Communications Agent fires acknowledgement email and Slack alert triggered by the same deal creation event without manual intervention
Email and Slack alert received within 90 seconds of Typeform submission; no manual step required between agents
T17
Full handoff: HubSpot Closed Won event to Communications Agent and Reward Processing Agent simultaneously
HubSpot deal stage set to Closed Won with referral source tag
Reward Processing Agent creates Xero draft bill; Communications Agent sends reward notification email; both complete without race condition or duplication
Exactly one Xero draft bill and exactly one reward email per deal ID; no duplicate bills or emails; both complete within 120 seconds
T18
Deal stage change event for a deal without referral source tag
HubSpot deal stage changed; deal does not have referral source custom field populated
Reward Processing Agent ignores the event; no Sheets update; no Xero bill created; no error logged
Execution log confirms conditional branch evaluated and skipped; zero records written
T19
Multiple stage changes in rapid succession for the same deal
HubSpot deal moves through three stage changes within 10 seconds (simulate rep correcting a mistake)
Google Sheets row reflects only the final stage; no duplicate rows; Xero bill created only if final stage is Closed Won
Sheets shows single updated row with final stage; Xero bill count for that deal ID = 1 if Closed Won, 0 otherwise
T20
Reward Processing Agent triggers but Xero contact not found for referrer
Closed Won event; referrer has no matching contact in Xero sandbox
Xero bill creation step fails gracefully; error logged with referrer HubSpot contact ID; Slack alert sent to finance channel; reward notification email still sent via Communications Agent
Reward email confirmed sent; Xero bill absent; Slack alert in finance channel contains referrer name and HubSpot deal link
T21
Google Sheets API quota exceeded mid-sync
Simulate 100 rapid stage change events to exhaust Sheets write quota in sandbox
Workflow queues remaining writes; processes with back-off; all rows eventually updated; no data loss
Final Sheets state matches HubSpot deal stages for all 100 records; no rows skipped permanently; execution log shows quota retry entries
T22
Reward tier config value missing for referrer tier at Xero bill creation
Closed Won event; referrer tier set to a value not present in the reward tier configuration map
Xero bill creation blocked; error logged with tier value received; Slack alert to sales manager and finance channel; no bill with zero or incorrect amount created
No Xero bill written; alert received by both channels; log entry includes the unrecognised tier value string
Edge case tests cover inputs and conditions outside normal operation that must be handled without data corruption or silent failure.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate referrer submits the same referred contact twice within 24 hours
Two Typeform submissions from same referrer email with identical referred contact email, 4 hours apart
First submission processed normally; second submission detected as duplicate on HubSpot contact search; Slack flag sent to sales manager; no second deal or Sheets row created
HubSpot deal count for referred contact email = 1; Slack duplicate flag present; second Sheets row absent
E02
Typeform submission with all optional fields blank
Submission containing only required fields: referrer email, referred contact email, referred contact first name
Intake Agent creates contact and deal using available fields; optional fields left blank in HubSpot; Sheets row appended with available data; no error thrown
HubSpot contact and deal created; no workflow failure; blank optional fields do not prevent record creation
E03
Typeform webhook delivers malformed JSON payload
Automation platform receives a webhook event where the payload is truncated or invalid JSON
Intake Agent parsing step fails at JSON decode; error logged with raw payload snippet (truncated for security); Slack alert to FullSpec monitoring channel; no partial records created
Zero records written to HubSpot or Sheets; error log entry contains 'payload_parse_error' and submission timestamp
E04
Xero API unavailable for more than 10 minutes during Closed Won event
Closed Won event fires; Xero sandbox returns 503 for all requests for 12 minutes
Reward Processing Agent retries Xero call every 3 minutes up to 5 attempts; after 5 failures, logs error and sends Slack alert to finance channel with deal ID and reward amount for manual bill creation
Exactly 5 retry attempts in execution log; Slack alert received with deal ID and reward tier amount; no bill created; Communications Agent reward email still sent
E05
Sales manager does not action the duplicate Slack flag within 48 hours
Duplicate flag posted to Slack; no response or acknowledgement from sales manager within 48 hours
Automation sends a follow-up Slack reminder to the sales manager channel at the 48-hour mark; no automatic record creation; reminder contains original referral details and submission timestamp
Follow-up Slack message confirmed in channel at 48-hour mark; original duplicate status unchanged; no new HubSpot or Sheets records created
E06
Referred contact email contains invalid format
Typeform submission where the referred contact email field contains a string that does not match standard email format (e.g. 'not-an-email')
Intake Agent validation step rejects the record before HubSpot lookup; error logged with field value; Slack alert to FullSpec monitoring channel; referrer receives a reply email asking them to resubmit with a valid contact email
No HubSpot or Sheets records created; Slack alert received; referrer sandbox inbox contains resubmission request email
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 email address owned by [YourCompany.com] as the referrer address for all production test runs. Do not use a real referrer's email. After the test run is confirmed complete and passing, the FullSpec team must void or delete the test Xero bill, delete or archive the test HubSpot deal and contact, and remove the test row from the Google Sheets register. These cleanup steps must be logged in the FullSpec confirmation record before the process owner approval test case (T26) is executed.
Phase 3 executes a single traced end-to-end run through the production environment using all live credentials. Every step is observed and recorded by the FullSpec team. The process owner joins at T26 to review the full execution trace and record their approval in the FullSpec confirmation log. No separate sign-off block is used; the approval is the final test case.
ID
Scenario
Input
Expected Output
Pass Criteria
T23
Full production run: submission to Sheets log
Live Typeform submission from internal test address; referred contact email not previously in HubSpot production
HubSpot contact and deal created in production with correct referrer custom fields and reward tier; Google Sheets production register receives new row with status 'Open'; acknowledgement email received at internal test address; Slack alert posted to designated sales rep channel
All four outputs confirmed within 120 seconds of Typeform submit; field values match submission data exactly; no sandbox records created
T24
Production deal stage progression and Sheets sync
FullSpec team manually advances the test HubSpot deal through two intermediate stages
Google Sheets register row updates to reflect each stage change in real time; 'Last Updated' timestamp changes on each transition; no duplicate rows created
Both stage updates reflected in Sheets within 30 seconds each; row count for test deal ID remains 1
T25
Production Closed Won: Xero bill and reward notification
FullSpec team sets test deal to Closed Won in production HubSpot
Xero draft bill created in production with correct referrer contact, correct reward amount per tier, due date 30 days out, status DRAFT; reward notification email received at internal test address with correct amount and referrer name; no payment initiated
Xero bill confirmed DRAFT status; amount matches tier config; reward email received within 90 seconds of stage change; finance contact has not been prompted to pay (bill is draft only)
T25b
Error log verification across full production run
Review automation platform execution log for the full T23 to T25 run
Zero unhandled errors in execution log; all steps show 'Success' status; any retries (if triggered by transient API latency) are logged and resolved without manual intervention
Execution log reviewed and confirmed clean by FullSpec team; log exported and attached to the FullSpec confirmation record
T26
Process owner review and approval
Process owner reviews the full Phase 3 execution trace, checks the acknowledgement email, Slack alert, Sheets row, and Xero draft bill against the expected outputs defined in this plan
Process owner confirms all outputs are correct, all cleanup steps have been completed (Xero bill voided, HubSpot test deal deleted, Sheets row removed), and formally approves the automation as ready for live operation; approval recorded in the FullSpec confirmation log
FullSpec confirmation log entry created with process owner name, date, and approval status. No separate sign-off block is required. This test case is the formal approval record.
After T26 approval is recorded, the FullSpec team will notify the process owner at [Your name] ([Rep email]) via email to support@gofullspec.com confirming the automation is cleared for live operation. The SOP and runbook will be shared at the same time for the operations owner's reference.
Test and QA PlanPage 4 of 4