Back to Lead Capture & Routing

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

Lead Capture and Routing

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

This document is the authoritative quality assurance reference for the Lead Capture and Routing automation build. It defines every test case the FullSpec team will execute across three sequential phases before the automation is cleared for production. The process owner joins Phase 3 to confirm that the live end-to-end run meets acceptance criteria. No phase begins until the previous phase achieves a full pass. All test IDs in this document are sequential and traceable back to the agent or integration step under test.

01Testing approach

Testing is structured across three phases in sequence. No phase begins until the previous phase fully passes. Phase 1 isolates each agent in a sandbox environment to verify individual logic. Phase 2 tests the handoffs between agents and the behaviour of the system when data is malformed, duplicated, or missing. Phase 3 runs a single traced end-to-end flow in the production environment with real credentials, observed jointly by the FullSpec team and the process owner.

1
Phase 1 — Unit Testing
Each agent tested in isolation against defined inputs and outputs
Scope
Lead Scoring and Enrichment Agent; Lead Routing and Notification Agent — each tested independently with mock payloads
Environment
Sandbox only — HubSpot sandbox account, Typeform test mode, Slack test workspace, Gmail test alias, Google Sheets staging sheet
Credential rule
No production credentials may be used at any point during Phase 1. All API keys and OAuth tokens must reference sandbox or test accounts exclusively
Pass condition
All test cases T01 through T12 return the expected output with zero unhandled errors
Who runs it
FullSpec team only
2
Phase 2 — Integration and Edge Case Testing
Agent handoffs, tool integrations, and failure scenarios validated
Scope
End-to-end agent handoff from Lead Scoring and Enrichment Agent to Lead Routing and Notification Agent; all five tool integrations; edge cases including duplicates, missing fields, and tool unavailability
Environment
Sandbox only — same sandbox accounts as Phase 1; no production data introduced
Credential rule
Sandbox credentials only. Production OAuth tokens and API keys remain locked until Phase 3 is explicitly authorised by the FullSpec lead
Pass condition
All integration test cases T13 through T19 pass; all edge case tests E01 through E07 return the correct fallback or error-handling behaviour
Who runs it
FullSpec team only
3
Phase 3 — End-to-End Production Test
Live credentials, real tools, process owner sign-off required
Scope
One complete production run tracing a real lead submission through every automated step: deduplication, scoring, CRM write, routing, Slack notification, Gmail acknowledgement, and Google Sheets log append
Environment
Production — live HubSpot account, live Slack workspace, live Gmail account, live Google Sheets log, live Typeform form
Credential rule
Production credentials active. The test lead must use a designated internal test email address. The resulting HubSpot contact, task, and Sheets row must be voided or deleted immediately after the test is confirmed as passed
Pass condition
All production test cases T20 through T23 pass; process owner confirms the outcome and approval is recorded in the FullSpec confirmation log (case T23)
Who runs it
FullSpec team executes; process owner observes and approves at T23
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

All Phase 1 tests must be executed using sandbox credentials only. Do not connect production HubSpot, live Gmail, live Slack, or the live Google Sheets log during this phase. Any accidental write to a production system during Phase 1 must be reported to the FullSpec lead immediately so the record can be identified and removed.

Lead Scoring and Enrichment Agent — unit test cases (T01 to T07)

ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: new Typeform submission, no existing HubSpot contact, high-score lead
Typeform webhook payload: name, company (50+ employees), email (not in HubSpot), source=typeform, interest=Enterprise plan
Deduplicated record confirmed as new; numeric score >= 80; tag = Hot; enriched record passed to routing agent
Score value >= 80, tag field = 'Hot', no duplicate contact created in sandbox HubSpot, output payload well-formed
T02
Happy path: Gmail inbound alias lead, mid-score
Parsed inbound email payload: name, company (10 employees), email (not in HubSpot), source=gmail-alias, interest=Standard plan
New record created; score between 40 and 79; tag = Warm
Score in range 40-79, tag = 'Warm', source field = 'gmail-alias', no error thrown
T03
Happy path: webhook lead, low score
Ad platform webhook payload: name only, no company size data, email (not in HubSpot), source=ad-webhook, interest=unspecified
New record created; score < 40; tag = Low Priority; human review flag set to true
Score < 40, tag = 'Low Priority', human_review_required = true, record passed to routing agent with flag
T04
Duplicate detection: existing HubSpot contact matched by email
Typeform payload with email matching an existing sandbox HubSpot contact
Agent identifies duplicate; updates existing record with new form data; does not create second contact; log entry notes merge
No new contact created; existing contact updated; merge_event = true in output payload; no error thrown
T05
Duplicate detection: existing HubSpot contact matched by phone only (email differs)
Inbound payload with new email but matching phone number to existing sandbox contact
Agent flags potential duplicate; creates new contact but attaches a duplicate-warning note to both records
New contact created with duplicate_warning = true; note appended to both records; no silent data loss
T06
Failure mode: Typeform webhook payload missing required email field
Typeform webhook payload with email field null or absent
Agent halts enrichment; writes error to automation platform error log; does not create a partial HubSpot contact; alert raised
No contact written to HubSpot; error log entry contains field_missing='email' and timestamp; downstream agents not triggered
T07
Failure mode: HubSpot sandbox API returns 429 rate-limit response during deduplication lookup
Valid Typeform payload submitted while HubSpot sandbox API is throttled (simulated via mock 429 response)
Agent retries with exponential back-off (3 attempts, 2s/4s/8s intervals); if all retries fail, lead is written to a holding queue and an alert is fired
Retry attempts logged; after third failure, holding_queue_entry = true; no silent drop; alert observable in platform error log

Lead Routing and Notification Agent — unit test cases (T08 to T12)

ID
Scenario
Input
Expected Output
Pass Criteria
T08
Happy path: Hot lead routed to correct territory rep with lowest current workload
Scored record: tag=Hot, territory=West, available reps: Rep A (3 open tasks), Rep B (7 open tasks)
Contact assigned to Rep A in HubSpot; follow-up task created with due date = today + 1 business hour; Slack message sent to Rep A
HubSpot contact owner = Rep A; task due_date correct; Slack message delivered to Rep A's sandbox channel; message includes score, source, and HubSpot link
T09
Happy path: Warm lead routed with 24-hour follow-up task
Scored record: tag=Warm, territory=East, rep available
Contact assigned to correct East rep; task due = today + 24 hours; Slack alert sent
Task due date = now + 24h (within 1 minute tolerance); Slack message tone matches Warm priority template
T10
Low Priority lead: human review flag triggers routing hold
Scored record: tag=Low Priority, human_review_required=true
Contact NOT auto-assigned; record placed in Low Priority review queue; Slack message sent to Sales Coordinator channel (not a rep channel) requesting review
No rep assigned in HubSpot; review_queue = true on record; Slack notification delivered to coordinator channel, not rep channel
T11
Gmail acknowledgement email sent within 2 minutes of trigger
Hot lead record passed to routing agent at timestamp T; agent completes routing
Personalised Gmail acknowledgement sent to prospect email address; email timestamp <= T + 120 seconds
Email received in sandbox test inbox; timestamp delta <= 120 seconds; subject line and first name personalisation fields populated correctly
T12
Failure mode: no eligible rep available in territory (all reps at capacity cap)
Hot lead, territory=North, all North reps at or above maximum task threshold
Agent escalates: assigns to Sales Manager as fallback owner; Slack alert sent to manager channel flagging capacity issue; task created with escalation note
HubSpot owner = Sales Manager; escalation_flag = true; Slack message delivered to manager channel; no lead silently dropped
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Integration test cases validate the full handoff from the Lead Scoring and Enrichment Agent to the Lead Routing and Notification Agent, and the correct behaviour of each connected tool. IDs continue from Phase 1.

ID
Scenario
Input
Expected Output
Pass Criteria
T13
Agent handoff: enriched scored record is correctly received by routing agent
Lead Scoring and Enrichment Agent output payload (Hot, score=85, all fields populated)
Routing agent receives complete payload; no field truncation; routing logic executes without manual intervention
All fields present in routing agent input; no null values for required fields; routing executes within 5 seconds of handoff
T14
Typeform to HubSpot field mapping: all form fields written to correct HubSpot properties
Typeform submission with all standard fields: first name, last name, email, company, phone, interest, message
HubSpot sandbox contact created with all fields correctly mapped; no field written to wrong property; source = typeform
HubSpot API response confirms all 7 properties written; field-by-field comparison against Typeform payload shows zero mismatches
T15
Slack notification delivery: message format and content validated
Routed Hot lead record with score=85, source=typeform, rep=Rep A, HubSpot contact ID present
Slack message delivered to Rep A's sandbox channel; contains prospect name, score badge, source label, key form answers, and HubSpot contact URL
Message appears in sandbox Slack channel within 10 seconds; all five required content elements present; HubSpot link resolves correctly in sandbox
T16
Gmail acknowledgement delivery: personalisation and timing validated
Prospect email address, first name, and lead submission timestamp
Acknowledgement email sent to sandbox test inbox within 2 minutes; first name substitution correct; no template placeholder visible in final email
Email received within 120 seconds; {{first_name}} fully substituted; no merge tag artefacts; from address matches configured Gmail alias
T17
Google Sheets log: row appended with correct columns
Completed lead record post-routing: timestamp, name, email, score, tag, assigned rep, source
New row appended to sandbox Google Sheets log with all 7 columns populated in correct column order
Row count in sandbox sheet increments by 1; all 7 cells populated; timestamp format matches sheet header specification (YYYY-MM-DD HH:MM:SS)
T18
Full handoff chain: Typeform submission flows through both agents to all five tools without manual intervention
Single Typeform webhook payload triggering the full automated flow in sandbox
HubSpot contact created and assigned; task created; Slack message sent; Gmail acknowledgement sent; Sheets row appended; all within 3 minutes of trigger
All five tool writes confirmed; total elapsed time from webhook receipt to Sheets append <= 180 seconds; zero unhandled errors in platform log
T19
Slack API unavailable during notification step (simulated 503 response)
Routed lead record reaching Slack notification step while Slack sandbox returns 503
Automation platform retries Slack delivery (3 attempts); on persistent failure, fallback email notification sent to rep's Gmail; error logged
Retry attempts visible in error log; fallback email delivered to rep sandbox inbox; lead NOT lost; error entry contains slack_unavailable=true and timestamp

Edge case test cases — duplicates, missing data, unavailable tools, and human timeout scenarios.

ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate lead submitted twice within 60 seconds from same email address
Two identical Typeform webhooks fired 45 seconds apart with the same email address
First submission creates the HubSpot contact; second submission detected as duplicate and merged or discarded; no second contact or second routing event created
Exactly one HubSpot contact exists for the email; exactly one Slack notification sent; Google Sheets log shows one row, not two
E02
Lead submitted with missing company name (required for scoring rubric)
Typeform payload with company field blank or null
Agent applies partial scoring using available fields; score calculated with company_size defaulting to minimum bracket; tag assigned; record proceeds with company=unknown logged
Score calculated without error; company field in HubSpot set to 'Unknown'; scoring_partial=true flag in output payload; no crash
E03
Lead submitted with invalid email format (no @ symbol)
Webhook payload with email='notanemail'
Agent validation rejects record before HubSpot write; error logged with validation_failure='email_format'; record written to manual review queue; no malformed contact created in HubSpot
HubSpot contact NOT created; manual review queue entry present; error log contains validation_failure field; no downstream steps triggered
E04
HubSpot API unavailable during contact write step
Valid enriched lead record reaching HubSpot write step while HubSpot returns 503
Automation platform retries 3 times with back-off; on persistent failure, full lead payload stored in automation platform retry queue; alert sent to FullSpec monitoring channel
Lead payload preserved in retry queue; no data lost; alert observable in monitoring channel; retry resumes automatically when HubSpot API recovers
E05
High-volume burst: 15 leads submitted within 2 minutes (simulating an ad campaign spike)
15 concurrent Typeform webhook payloads fired within a 120-second window
All 15 leads processed without collision; each receives a unique HubSpot contact (or correct duplicate merge); 15 Slack notifications queued and delivered; 15 Sheets rows appended; no leads lost or silently skipped
HubSpot contact count = 15 (minus any genuine duplicates); Sheets row count = 15; Slack message count = 15; zero error log entries for processing failures
E06
Low Priority lead placed in human review queue but Sales Coordinator takes no action for 4 hours
Low Priority record written to review queue at T=0; no human action taken by T+4h
Automation platform sends a reminder Slack message to the Sales Coordinator channel at T+4h; if no action by T+8h, a second escalation is sent to the Sales Manager
First reminder delivered at T+4h (within 5 minutes tolerance); escalation delivered at T+8h if still unactioned; no lead permanently abandoned
E07
Lead source webhook delivers an unrecognised payload schema (field names do not match expected mapping)
Webhook POST body with non-standard field names (e.g., 'full_name' instead of 'firstname'/'lastname', 'business' instead of 'company')
Agent attempts schema normalisation using fallback field-mapping rules; if normalisation succeeds, record proceeds with a normalisation_applied=true flag; if normalisation fails, record is held for manual field review with original payload preserved
No silent data loss; either normalised record proceeds correctly OR raw payload held in review queue; normalisation_applied or manual_review flag set; error log entry describes the schema mismatch
Test and QA PlanPage 3 of 4
FS-DOC-06Quality

04Phase 3 — end-to-end production test

Important before running Phase 3: use a designated internal test email address (for example, qa-test@[YourCompany.com]) as the lead submitter. Do not use a real prospect's email address. After the test is confirmed as passed, the FullSpec team must immediately void or delete the HubSpot contact, cancel the follow-up task, remove the Slack notification from the channel history where possible, and delete the Google Sheets row created by the test run. Confirm deletion in the FullSpec test log before Phase 3 is closed.
ID
Scenario
Steps Traced
Expected Production Output
Pass Criteria
T20
Full production run: Hot lead submitted via live Typeform form traced end to end
Typeform submission fired from qa-test address with all fields populated; score expected >= 80; territory configured for a named rep
HubSpot contact created in live account with all fields mapped correctly; lead scored Hot; contact assigned to correct rep; follow-up task created with 1-business-hour due date; Slack message delivered to rep in live workspace; Gmail acknowledgement sent to qa-test inbox within 2 minutes; Google Sheets live log row appended
All seven downstream actions confirmed in live tools within 3 minutes of form submission; zero errors in production platform log; every field in HubSpot contact matches Typeform input exactly
T21
Production error-log verification: confirm no unhandled exceptions during T20 run
Automation platform production error log reviewed immediately after T20 completes
Error log shows zero unhandled exceptions, zero retries triggered, and zero records written to holding or retry queues during the T20 run
Log entry count for T20 run window = 0 errors; if any retry was triggered it must have resolved within the 3-minute window and been logged as resolved
T22
Production data integrity check: HubSpot contact, task, and Sheets row match expected values field by field
HubSpot contact record created in T20; follow-up task on that contact; Google Sheets row appended in T20
HubSpot contact properties: all 7 mapped fields correct, lifecycle stage = Lead, owner = correct rep, lead_score property = value from scoring agent, source = typeform. Task: due date correct, assigned to same rep, title matches priority tier template. Sheets row: all 7 columns populated, timestamp within 3 minutes of submission
Field-by-field comparison document completed and signed off in FullSpec test log; zero field mismatches across HubSpot contact, task, and Sheets row
T23
Process owner review and approval: process owner confirms end-to-end output meets acceptance criteria
Process owner (Sales Manager) reviews the outputs of T20 through T22 in live tools: HubSpot contact, Slack message, Gmail acknowledgement in qa-test inbox, Sheets log row
Process owner confirms that the lead data is accurate, the routing decision is correct, the Slack message contains all required context, the Gmail acknowledgement reads correctly, and the Google Sheets entry is complete. Process owner approval is recorded in the FullSpec confirmation log. No separate signoff block is required.
FullSpec confirmation log updated with process owner name, approval timestamp, and explicit statement that all acceptance criteria are met. Phase 3 is closed. Test lead record voided in all connected production systems immediately after log entry is saved.
Once T23 is logged as approved in the FullSpec confirmation system, Phase 3 is formally closed and the automation is cleared for live operation. Any defect identified during Phase 3 that cannot be resolved within the test session causes Phase 3 to be restarted in full after the fix is deployed. Contact the FullSpec team at support@gofullspec.com for any test environment issues or to schedule the Phase 3 session.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Lead Capture & Routing.

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