Back to Lost Lead Re-engagement

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

Lost Lead Re-engagement

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

This document defines the structured test and quality assurance programme for the Lost Lead Re-engagement automation. It covers all three test phases, from isolated agent unit tests through integration and edge-case validation to a live end-to-end production run. The FullSpec team executes Phases 1 and 2 entirely in sandbox environments. The process owner joins Phase 3 to review real output and record final sign-off. No phase begins until the previous phase has fully passed.

01Testing approach

Testing is structured as three sequential phases. Each phase must reach a full pass state before the next phase is initiated. This ensures that defects are caught at the lowest level possible and do not propagate into higher-complexity tests where they are harder to isolate. The FullSpec team owns execution for all three phases, with the process owner joining as a required participant in Phase 3 only.

1
Phase 1: Unit Testing
Each agent tested in isolation against controlled inputs
Scope
Each of the three agents (Lead Inactivity Monitor, Sequence Copywriter Agent, Reply Classifier and Router) is tested individually. No cross-agent data flow is exercised in this phase.
Environment
Sandbox only. HubSpot sandbox account, Gmail test alias, OpenAI API with a dedicated test key, Slack test workspace channel.
Credential rule
No production credentials, API keys, or live contact records may be used. All HubSpot contacts are synthetic test records prefixed with [TEST].
Pass condition
All test cases T01 through T12 return the expected output with zero critical failures. Amber warnings must be documented and triaged before Phase 2 begins.
Who runs it
FullSpec team. Process owner is not required in Phase 1.
2
Phase 2: Integration and Edge-Case Testing
Agent handoffs and boundary conditions validated end to end in sandbox
Scope
Cross-agent data handoffs, tool integrations between agents, and a separate edge-case suite covering duplicates, missing data, unavailable tools, and human timeout scenarios.
Environment
Sandbox only. All tools connected in the sandbox pipeline. Real OAuth flows used against sandbox credentials to validate token handling.
Credential rule
Sandbox credentials only. Production HubSpot, Gmail, OpenAI, and Slack credentials remain unused. OAuth tokens are scoped to sandbox app registrations.
Pass condition
All integration test cases T13 through T19 pass and all edge-case cases E01 through E06 produce the correct fallback or error behaviour. No unhandled exceptions.
Who runs it
FullSpec team. Process owner is not required in Phase 2.
3
Phase 3: End-to-End Production Test
Live credentials, real pipeline contacts, full sequence traced and verified
Scope
One full production run using a small batch of real but internally designated test contacts. Every workflow step from inactivity detection through to Slack alert or Closed Lost update is traced and verified.
Environment
Production. Live HubSpot account, live Gmail sending account, live OpenAI API key, live Slack workspace. All activity is real and logged to the production CRM.
Credential rule
Production credentials active. All test contacts must be internally owned addresses or explicitly consented placeholders. Test records must be voided or deleted after Phase 3 concludes.
Pass condition
All production test cases T20 through T24 pass, including the process owner review case (T24). The process owner records approval in the FullSpec confirmation screen.
Who runs it
FullSpec team executes T20 through T23. The process owner is a required participant for T24 and must review outputs before final go-live is confirmed.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only: All unit tests in Phase 1 must be executed using synthetic HubSpot contacts, a Gmail test alias, a sandboxed OpenAI API key, and a Slack test channel. No production credentials, live contact data, or real rep inboxes may be used at any point during this phase. Any test that inadvertently touches a production credential must be halted immediately and reported to the FullSpec team lead.

Agent 1: Lead Inactivity Monitor

ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: contact qualifies as inactive
HubSpot sandbox contact with last_activity_date = 22 days ago, lifecycle_stage = Opportunity
Contact is flagged; workflow run queued with full contact context payload
Contact appears in the queued run list within 60 seconds of the 7:00 AM trigger. Context payload contains contact ID, last notes, and deal stage.
T02
Contact below threshold (19 days inactive)
HubSpot sandbox contact with last_activity_date = 19 days ago, lifecycle_stage = Opportunity
Contact is not queued; no workflow run initiated
No run is created for this contact. Monitor log confirms contact was evaluated and skipped.
T03
Contact is Closed Won: should be excluded
HubSpot sandbox contact with last_activity_date = 30 days ago, lifecycle_stage = Closed Won
Contact is excluded from the queue
No run is created. Exclusion filter logic is confirmed in monitor execution log.
T04
Contact is Closed Lost: should be excluded
HubSpot sandbox contact with last_activity_date = 25 days ago, lifecycle_stage = Closed Lost
Contact is excluded from the queue
No run is created. Exclusion filter confirmed in log.
T05
HubSpot API returns no qualifying contacts
All sandbox contacts are either within threshold or already closed
Monitor completes with empty queue; no error thrown
Monitor run completes cleanly. Google Sheets audit log records a zero-contact scan entry with the run timestamp.
T06
HubSpot API timeout during scan
Simulated 30-second timeout on HubSpot contacts API call
Monitor halts gracefully; error is logged; no partial queue is created
Error entry written to Google Sheets audit log. No contacts queued. Monitor does not crash the orchestration layer.

Agent 2: Sequence Copywriter Agent

ID
Scenario
Input
Expected Output
Pass Criteria
T07
Happy path: touch 1 email drafted and sent
Contact context payload: name, last notes, deal stage, touch_number = 1
Personalised email drafted via OpenAI, sent via Gmail, activity logged in HubSpot, next follow-up date set
Email arrives in test Gmail inbox within 2 minutes. HubSpot activity log shows the sent email entry. Next touch date property is populated.
T08
Touch 2 email: angle differs from touch 1
Same contact, touch_number = 2, no reply recorded
Email draft uses a different angle and length compared to T07 output
OpenAI output for touch 2 does not duplicate the subject line or opening paragraph from touch 1. FullSpec reviewer confirms the messaging angle is distinct.
T09
Touch 3 email: final touch drafted
Same contact, touch_number = 3, no reply to touches 1 or 2
Third email drafted with a closing or last-chance angle; sent and logged
Email sent and logged correctly. touch_number property in HubSpot updated to 3.
T10
OpenAI API returns an error during drafting
Simulated 500 error from OpenAI API mid-draft
Agent retries once after 30 seconds; if retry fails, run is paused and error is written to Google Sheets log
No email is sent. Error entry appears in audit log with contact ID, timestamp, and error code. Run status is set to paused, not failed.
T11
Contact context payload is missing last interaction notes
Payload where last_interaction_notes field is null
Agent uses available context (name, deal stage) to draft a generic but still personalised email; does not error
Email is drafted and sent without throwing an exception. Output does not contain unfilled template placeholders.
T12
Gmail send fails: daily sending limit reached
Simulated Gmail 429 rate-limit response on send attempt
Send is queued for retry at the next available window; HubSpot activity is not logged until send is confirmed
No premature HubSpot activity entry. Retry queue entry is created. Email is successfully sent on retry. HubSpot log is written only after confirmed send.
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

Agent 3: Reply Classifier and Router

ID
Scenario
Input
Expected Output
Pass Criteria
T13
Happy path: warm reply detected and classified
Gmail reply thread matching a tracked re-engagement message; reply body = 'Yes, let us catch up next week'
Reply scored as Interested; Slack alert sent to assigned rep with lead name, reply summary, and HubSpot link
Slack message arrives in the correct rep channel within 90 seconds of reply receipt. HubSpot contact record shows a reply-received activity entry.
T14
Unsubscribe reply: sequence suppressed
Gmail reply body = 'Please remove me from your list'
Reply scored as Unsubscribe; sequence is halted; HubSpot contact suppression flag set; no further emails sent
No additional emails are queued for this contact. HubSpot contact property re_engagement_suppressed = true. No Slack alert is sent.
T15
Out-of-office auto-reply detected
Gmail reply with auto-reply headers and body indicating absence
Reply classified as Out of Office; sequence is paused; next touch date extended by 5 business days
Sequence is not terminated. HubSpot next_touch_date is updated to 5 business days forward. No Slack alert triggered.
T16
No reply after touch 3: lead closed
Sequence completion event with touch_number = 3 and no reply recorded
HubSpot lifecycle stage updated to Closed Lost; re-engagement sequence status set to Complete
HubSpot contact shows Closed Lost lifecycle stage. Sequence status property = Complete. No further workflow runs triggered.
T17
Slack API unavailable when warm reply is received
Warm reply detected; Slack API returns 503 on alert send attempt
Slack send is retried twice; if both retries fail, a fallback email alert is sent to the rep's Gmail and the error is logged
Fallback email arrives in rep's test Gmail inbox. Error logged in Google Sheets with timestamp and contact ID. HubSpot activity entry is still written.

03Phase 2 — integration and edge case tests

Integration tests validate that data passes correctly between agents and that each tool connection behaves as expected when the full sandbox pipeline is active. IDs continue from the Phase 1 sequence.

ID
Scenario
Handoff Under Test
Expected Behaviour
Pass Criteria
T18
Lead Inactivity Monitor queues a contact; Sequence Copywriter Agent receives the payload
Monitor to Copywriter handoff via orchestration layer
Contact context payload from HubSpot is received by the Copywriter Agent intact: all required fields present, no nulls in required positions
Copywriter Agent logs receipt of payload. All fields (contact_id, name, last_notes, deal_stage, touch_number) are populated correctly. Agent proceeds to draft without manual intervention.
T19
Copywriter Agent sends email; Reply Classifier picks up the reply thread
Gmail send from Copywriter to reply monitoring by Classifier
Reply Classifier identifies the inbound reply as belonging to the correct tracked thread and correctly associates it with the originating contact_id
Classifier correctly maps the reply to the contact. No orphaned reply events. Classification fires within 120 seconds of reply arrival in the sandbox Gmail inbox.
T20
Full three-agent pipeline run from trigger to HubSpot close
End-to-end sandbox pipeline with no reply simulated
Monitor queues contact, Copywriter sends all three touches at correct intervals, Classifier detects no reply after touch 3, HubSpot updated to Closed Lost
All three emails are sent and logged. HubSpot shows three activity entries. Lifecycle stage = Closed Lost after sequence completion. Google Sheets audit log has a complete run record.
T21
Full three-agent pipeline run ending with a warm reply and Slack alert
End-to-end sandbox pipeline with warm reply after touch 2
Monitor queues contact, Copywriter sends touch 1 and touch 2, Classifier receives warm reply, Slack alert fires, sequence halts after alert
Slack test channel receives the alert with the correct lead name and HubSpot sandbox link. No touch 3 email is sent. HubSpot contact shows reply-received activity.
T22
Google Sheets audit log receives entries for every triggered run
Orchestration layer to Google Sheets write step
Each queued contact run writes a row to the audit log with: contact_id, run_start_timestamp, touch_number, send_status, reply_status
After a batch of five sandbox contacts is processed, Google Sheets contains exactly five rows with all five required columns populated. No missing or duplicate rows.

Edge-case tests address boundary conditions, data anomalies, and failure scenarios that are outside the happy path but realistic in production.

ID
Scenario
Condition
Expected Behaviour
Pass Criteria
E01
Duplicate contact: same lead queued twice in one daily scan
Two identical contact_id values appear in the Monitor's output queue
Deduplication logic removes the second entry; only one workflow run is initiated per contact_id per day
Exactly one run is created for the contact. Google Sheets audit log shows a duplicate-detected entry for the second occurrence.
E02
Missing required field: contact has no assigned rep in HubSpot
Contact record has owner_id = null
Copywriter Agent pauses the run and writes an error entry to Google Sheets; no email is sent until the contact has an assigned owner
No email is sent. Audit log entry shows status = paused, reason = no_assigned_owner. The contact is not marked Closed Lost prematurely.
E03
Unavailable tool: OpenAI API is down for longer than the retry window
OpenAI API returns errors for more than 10 minutes
After two retries at 5-minute intervals, the run is suspended and a system alert is written to the Google Sheets error tab; the contact is re-queued for the next daily scan
Contact is not permanently skipped. Error tab entry is present. Contact re-appears in the next simulated daily scan queue.
E04
Lead replies after the sequence has been marked Complete
Gmail reply arrives after HubSpot lifecycle = Closed Lost and sequence_status = Complete
Classifier detects the reply, classifies it, and if warm, sends a Slack alert to the rep with a note that the sequence had already closed
Slack alert arrives in the test channel. Alert message contains the text indicating the lead was previously closed. No new sequence run is initiated automatically.
E05
Contact sends multiple replies in quick succession (reply flooding)
Three Gmail replies from the same contact arrive within 2 minutes of each other
Classifier processes the first reply and suppresses duplicate classification events for the same thread within a 10-minute window
Only one Slack alert is sent. Only one HubSpot activity entry is written. Suppression window is confirmed in the execution log.
E06
Human timeout: rep does not respond to a warm Slack alert within 24 hours
Slack alert sent at T+0; no rep action recorded in HubSpot within 24 hours
A follow-up Slack reminder is sent to the rep at T+24 hours; HubSpot contact is flagged with a pending_rep_action property
Second Slack message arrives in the test channel at the correct time. HubSpot contact property pending_rep_action = true. No automated email is sent to the lead during this window.
Test and QA PlanPage 3 of 4
FS-DOC-06Quality

04Phase 3 — end-to-end production test

Important before running Phase 3: Use only internal team email addresses or explicitly designated test contacts as recipients. Do not use real prospect or customer contacts under any circumstances. All emails sent during Phase 3 will arrive in real inboxes from the live Gmail sending account. Any HubSpot contact records created or modified during Phase 3 must be reviewed and either voided or corrected immediately after the test concludes. The FullSpec team will confirm which contacts were touched during the run and provide a clean-up checklist before the process owner approves go-live.

Phase 3 uses live production credentials and the real automation pipeline. The goal is to confirm that the full sequence behaves correctly in the production environment, that email deliverability is clean, that HubSpot records are updated accurately, and that Slack alerts reach the correct rep channel. The process owner is required to review the outputs of this phase before final approval is recorded.

ID
Scenario
Test Action
Expected Result
Pass Criteria
T23
Production trigger: inactivity scan detects a designated test contact
A designated internal contact in the live HubSpot account is set to last_activity_date = 22 days ago with lifecycle_stage = Opportunity. The daily scan runs at 7:00 AM.
Contact is detected by the Lead Inactivity Monitor, queued, and a workflow run is initiated with the full contact context payload
Run is visible in the orchestration layer's execution log within 5 minutes of the 7:00 AM trigger. Google Sheets production audit log contains the correct contact_id entry.
T24
Production email send: touch 1 email arrives and is logged
Workflow run from T23 proceeds through the Sequence Copywriter Agent
Personalised touch 1 email is sent to the internal test address from the assigned rep's live Gmail account; HubSpot activity entry is created; next touch date is set
Email arrives in the internal test inbox. Subject line and body are personalised and contain no unfilled placeholders. HubSpot shows the email activity entry under the correct contact record. Next touch date property is populated.
T25
Production warm reply: Slack alert fires to the correct rep channel
A reply is sent from the internal test address to the re-engagement email from T24. Reply body = 'Happy to reconnect, let us find a time'
Reply Classifier scores the reply as Interested; a Slack alert is sent to the live assigned rep's Slack channel with the lead name, reply summary, and HubSpot link
Slack alert arrives in the production rep channel within 90 seconds. Alert contains the correct contact name and a valid HubSpot deep link. HubSpot contact shows a reply-received activity entry.
T26
Error log verification: no unhandled exceptions in the production run
Review the orchestration layer execution log and Google Sheets error tab after the T23 through T25 run completes
No unhandled exceptions, no failed steps without a logged reason, no missing audit entries
Google Sheets audit log has complete entries for all steps: queued, drafted, sent, reply-received, and Slack-alerted. The error tab is empty for this run.
T27
Process owner review and approval: final production test case
The process owner reviews the email content from T24, the Slack alert from T25, the HubSpot activity log entries, and the Google Sheets audit record for this test run
Process owner confirms: email tone and content meet brand standards; Slack alert is clear and actionable; HubSpot records are accurate; the automation behaves as specified in the runbook
Process owner records approval in the FullSpec confirmation screen. Approval is timestamped and stored against this process record in the FullSpec system. No separate sign-off document is required. Go-live is authorised only after this case is marked as passed.
After T27 is passed and approval is recorded, the FullSpec team will void or correct all test contact records in the production HubSpot account, confirm that no unintended emails remain queued, and issue the final go-live confirmation to the process owner. Contact support@gofullspec.com with any questions about the Phase 3 clean-up process.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Lost Lead Re-engagement.

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