Back to Upsell & Cross-sell Triggers

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

Upsell and Cross-sell Triggers

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

This document defines the structured test and quality assurance programme for the Upsell and Cross-sell Triggers automation. It is written for the FullSpec build team and covers every test case from isolated unit checks through to a live production run. Testing proceeds in three sequential phases: no phase begins until the previous phase fully passes. The process owner joins Phase 3 to confirm end-to-end behaviour before the automation is considered production-ready.

01Testing approach

All testing follows three phases in sequence. No phase begins until the previous phase has fully passed, meaning every test case in that phase carries a confirmed pass status. Phase 1 isolates individual agent and tool behaviour in a sandbox environment. Phase 2 tests the handoffs between agents and system integrations, and exercises edge cases that could occur in real traffic. Phase 3 runs the complete flow end to end in production using a controlled test record.

1
Phase 1 — Unit Testing
Isolated agent and tool behaviour in sandbox
Scope
Each agent and each tool connector tested in isolation: Segment trigger parsing, HubSpot data fetch, Offer Selection Agent scoring logic, Outreach Drafting Agent email composition, Gmail send, HubSpot activity logging, Slack notification, Google Sheets append.
Environment
Sandbox only. No production data, no production API keys, no live customer records.
Credential rule
All sandbox credentials only. Production tokens must not be present in the environment during Phase 1. Sandbox credentials are stored in the build environment secret store under the prefix SANDBOX_.
Pass condition
All cases T01 through T14 return the expected output with no error state. Zero failures permitted before Phase 2 begins.
Who runs it
FullSpec team only. No process owner involvement required at this stage.
2
Phase 2 — Integration and Edge Case Testing
Agent handoffs, system integrations, and exception scenarios
Scope
Full agent-to-agent handoffs, data passing between Segment, HubSpot, Gmail, Slack, and Google Sheets, plus edge cases covering duplicates, missing fields, unavailable tools, and human review timeout.
Environment
Sandbox for integration tests. Edge case tests may use a staging environment with anonymised production-shaped data where available.
Credential rule
Sandbox credentials for all integration tests. If staging environment credentials are used for edge cases, they must be scoped read-only on HubSpot and have no Gmail send permission.
Pass condition
All cases T15 through T22 pass and all edge cases E01 through E06 resolve to the documented fallback state with no unhandled exceptions.
Who runs it
FullSpec team only. Results are documented and shared with the process owner prior to Phase 3.
3
Phase 3 — End-to-End Production Test
Full live run on production with process owner review
Scope
One complete production run traced from Segment trigger through to Google Sheets append. Includes the high-value routing branch, error log review, and final process owner sign-off.
Environment
Production. Real API credentials, real tool connections. Test record must use an internal email address and be voided immediately after the run.
Credential rule
Production credentials are used. All credentials must be stored in the production secret store only. The test Gmail recipient must be an internal address at [YourCompany.com].
Pass condition
All cases T23 through T26 pass. The process owner completes the final review case (T26) and confirmation is recorded in the FullSpec platform.
Who runs it
FullSpec team runs T23 through T25. The process owner participates in T26 to confirm output quality and approve the automation for full rollout.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only. Do not use production API keys, production HubSpot contact IDs, real customer email addresses, or live Gmail send credentials during Phase 1. Every tool connection must point to its designated sandbox or test instance. Confirm SANDBOX_ prefix on all secret store entries before running any case.

Segment trigger and HubSpot data fetch (pre-agent pipeline)

ID
Scenario
Input
Expected output
Pass criteria
T01
Valid qualifying event received from Segment
Segment track event: upsell_trigger_fired, properties: { customer_id: 'cust_sandbox_001', event_type: 'spend_threshold', value: 5000 }
Workflow execution begins; customer_id extracted and passed downstream
Execution log shows trigger received; customer_id present in payload; no error thrown
T02
Segment event with missing customer_id
Segment track event: upsell_trigger_fired, properties: { event_type: 'spend_threshold', value: 5000 } (no customer_id)
Workflow halts; error logged: MISSING_CUSTOMER_ID; no downstream steps fire
Execution halts at trigger parse step; error code MISSING_CUSTOMER_ID present in log
T03
Successful HubSpot account data fetch
customer_id: 'cust_sandbox_001' mapped to sandbox HubSpot contact ID hs_sandbox_4421
CRM record returned: account_owner, spend_tier, open_deals, last_activity_date
All four fields present in returned payload; HTTP 200 from HubSpot Contacts API
T04
HubSpot contact not found
customer_id maps to a HubSpot ID that does not exist in sandbox
Error state: HUBSPOT_CONTACT_NOT_FOUND; workflow halts; no agents fire
Error code present in log; downstream agents confirm no execution
T05
HubSpot API returns 429 rate limit response
Sandbox HubSpot mock returns HTTP 429 on first call, HTTP 200 on retry
Orchestration layer retries after 10-second backoff; second call succeeds; data fetched
Retry logic fires once; successful fetch on second attempt; total latency under 30 seconds

Offer Selection Agent (complexity: Moderate, estimated build time: 8 hours)

ID
Scenario
Input
Expected output
Pass criteria
T06
Standard account, clear spend-tier match
spend_tier: 'mid', product_usage_signal: 'feature_ceiling_reached', account_segment: 'SMB', catalogue: Google Sheets sandbox tab loaded
Ranked offer recommendation returned: { offer_name: 'Pro Plan Upgrade', rationale: 'Customer has reached feature ceiling on current tier' }
offer_name and rationale fields present; offer exists in catalogue; response latency under 5 seconds
T07
Multiple offers equally scored, tie-break applied
spend_tier: 'mid', two offers with identical score in catalogue
Agent selects the offer with higher margin_priority flag; rationale references tie-break rule
Single offer returned; rationale string contains 'margin priority'; no error thrown
T08
No eligible offer found for account profile
spend_tier: 'low', product_usage_signal: 'inactive', no catalogue row matches all criteria
Agent returns no_offer_available flag; workflow routes to suppression state; no email drafted
no_offer_available flag present in output; Outreach Drafting Agent execution log shows no trigger
T09
Google Sheets catalogue unavailable during scoring
Sandbox Sheets connector returns a connectivity error mid-execution
Error logged: CATALOGUE_FETCH_FAILED; workflow halts; alert queued for FullSpec team
Error code present; no partial recommendation passed downstream; alert entry recorded

Outreach Drafting Agent (complexity: Moderate, estimated build time: 8 hours)

ID
Scenario
Input
Expected output
Pass criteria
T10
Standard account, full personalisation fields available
offer_name: 'Pro Plan Upgrade', account_owner: 'Rachel Kim', customer_name: 'Acme Corp', last_purchase_date: '2024-03-01'
Draft email: subject line contains offer name; body references customer name and last purchase date; tone matches brand guidelines
All three personalisation tokens populated; no placeholder text visible; draft passes character limit check (under 400 words)
T11
High-value account routing flag set
account_tier: 'enterprise', high_value_flag: true, offer drafted
Draft queued to rep review queue; auto-send NOT triggered; Slack alert sent to account owner
Gmail send API not called; draft visible in review queue; Slack message delivered to sandbox channel
T12
Standard account, auto-send path
account_tier: 'standard', high_value_flag: false, draft complete
Email sent via Gmail sandbox; HubSpot activity log entry created; Slack notification posted
Gmail sandbox delivery confirmed; HubSpot activity record created with correct offer and timestamp; Slack message posted
T13
customer_name field missing from CRM record
customer_name: null, all other fields present
Draft uses account_domain as fallback salutation; email generated without error; flag logged: PERSONALISATION_FALLBACK
Email draft does not contain 'null' or empty salutation; PERSONALISATION_FALLBACK flag in log
T14
Gmail sandbox send fails with HTTP 503
Outreach Drafting Agent attempts send; Gmail sandbox mock returns HTTP 503
Error logged: GMAIL_SEND_FAILED; email held in retry queue; Slack alert sent to account owner noting send failure
Email not marked sent; retry queue entry created; Slack alert delivered; no duplicate draft created
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Integration tests verify that data passes correctly across the full agent handoff chain and that each connected tool receives and processes the expected payload. All IDs continue the T sequence from Phase 1.

ID
Scenario
Input
Expected output
Pass criteria
T15
Segment to HubSpot to Offer Selection Agent full handoff
Valid Segment event fires; HubSpot fetch succeeds; payload passed to Offer Selection Agent
Offer Selection Agent receives complete payload including spend_tier, product_usage_signal, and account_segment
Agent execution log shows all three fields present on receipt; no data loss between steps
T16
Offer Selection Agent to Outreach Drafting Agent handoff
Offer Selection Agent returns { offer_name: 'Pro Plan Upgrade', rationale: '...' }
Outreach Drafting Agent receives offer_name and rationale and uses both in draft
Both fields referenced in generated draft; no null tokens; agent execution sequence confirmed in log
T17
Auto-send path: Outreach Drafting Agent through to Google Sheets append
Standard account, high_value_flag: false, full draft generated
Gmail send confirmed; HubSpot activity logged; Slack posted; Google Sheets row appended with customer, offer, date, account_owner
All four downstream actions confirmed in execution log; Google Sheets row present and correctly formatted
T18
High-value routing path: draft queued, rep approves, send fires
high_value_flag: true, rep approves draft in review queue within session
Gmail send fires after rep approval; HubSpot log created post-approval; Slack alert references approval event
Gmail send timestamp is after approval event timestamp; HubSpot log references rep approval; no premature send
T19
HubSpot activity log entry format validation
Auto-send path completed for sandbox customer record
HubSpot activity record contains: activity_type: 'upsell_outreach', offer_name, trigger_event_type, send_timestamp (ISO 8601)
All four fields present; timestamp format valid; activity type matches defined enum in HubSpot property schema
T20
Slack notification content and delivery
Send completed for sandbox account owned by 'Rachel Kim' in sandbox Slack workspace
Slack message delivered to correct channel; message contains offer_name and HubSpot record URL
Message received in sandbox channel; offer_name matches sent offer; URL resolves to correct HubSpot sandbox record
T21
Google Sheets append: correct column mapping
Completed run for sandbox customer 'Acme Corp', offer 'Pro Plan Upgrade', account_owner 'Rachel Kim'
New row in tracking sheet: Column A = customer name, Column B = offer, Column C = send date (YYYY-MM-DD), Column D = account owner
Row present; all four columns populated correctly; no row appended to wrong sheet tab
T22
End-to-end latency benchmark
Valid Segment event fired at T+0 in sandbox
Gmail send or review queue entry created within 90 seconds of trigger
Execution log timestamps show total elapsed time under 90 seconds from trigger receipt to send or queue entry

Edge case tests cover failure modes, data anomalies, and timeout scenarios that could occur under real traffic conditions.

ID
Scenario
Input
Expected output
Pass criteria
E01
Duplicate Segment event for the same customer within 24 hours
Two identical upsell_trigger_fired events for cust_sandbox_001 fired 10 minutes apart
Second event detected as duplicate; suppressed; no second email drafted or sent; deduplication log entry created
Only one execution proceeds; dedup log shows suppression of second event; single HubSpot activity entry
E02
HubSpot record exists but account is marked churned or closed
HubSpot contact fetched; lifecycle_stage: 'churned'
Workflow halts after CRM fetch; no offer selected; no email sent; suppression logged
Execution stops at eligibility check; suppression record created; no downstream agents fire
E03
Offer catalogue in Google Sheets is empty or unreachable
Offer Selection Agent attempts to read Google Sheets; sheet returns 0 rows or HTTP 503
Agent returns CATALOGUE_UNAVAILABLE; workflow halts; FullSpec team alerted via internal error channel
No offer passed downstream; error logged with timestamp; alert delivered
E04
Outreach Drafting Agent produces draft exceeding 400 words
Agent generates a draft of 520 words due to verbose account context
Draft is automatically truncated to 400 words with an ellipsis appended; flag logged: DRAFT_TRUNCATED
Sent draft is 400 words or fewer; DRAFT_TRUNCATED flag present; no content after ellipsis is sent
E05
Slack API unavailable when notification is attempted
Slack API returns HTTP 503 at notification step
Notification failure logged; workflow does not halt; email send and HubSpot log complete as normal; retry attempted after 5 minutes
Gmail send and HubSpot log confirmed despite Slack failure; retry log entry present; no workflow halt
E06
High-value account in review queue not actioned within 48 hours
Draft queued for rep review; no action taken for 48 hours
Escalation Slack alert sent to sales manager; draft remains in queue; no auto-send triggered; timeout logged
Escalation message delivered to manager channel at T+48h; draft not sent; timeout entry in execution log
Test and QA PlanPage 3 of 4
FS-DOC-06Quality

04Phase 3 — end-to-end production test

Important before running Phase 3: The Gmail recipient for all test cases must be an internal address at [YourCompany.com]. Do not use a real customer email address at any point. The HubSpot contact record created for this test must be flagged as TEST_RECORD and deleted or voided by the FullSpec team immediately after T26 is complete. The Google Sheets row appended during this test must also be deleted before the sheet is used for live reporting. Confirm with the process owner that a named internal test address is available and that the HubSpot sandbox-to-production credential swap has been reviewed before proceeding.
Production credentials are now active. Confirm that all SANDBOX_ prefixed secrets have been replaced or scoped out before executing any case in this phase. The FullSpec team is responsible for credential verification prior to T23.
ID
Scenario
Input
Expected output
Pass criteria
T23
Full production run: standard account, auto-send path
Live Segment event fired for internal test contact (spend_threshold crossed); HubSpot production record for test contact pre-created with spend_tier: 'mid', high_value_flag: false
Offer selected from live catalogue; personalised email drafted and sent to internal test address; HubSpot activity logged; Slack notification posted to sales channel; Google Sheets row appended
Email received at internal test address within 90 seconds of Segment event; HubSpot activity record present with correct offer and ISO 8601 timestamp; Slack message in sales channel; Google Sheets row matches expected format across all four columns
T24
Full production run: high-value account, rep review path
Live Segment event fired for internal test contact with high_value_flag: true
Draft queued in rep review queue; auto-send not triggered; Slack alert sent to account owner noting review required; HubSpot activity record created with status: 'pending_review'
No email delivered to internal address at time of queue entry; review queue item visible; Slack alert delivered; HubSpot status field set to 'pending_review'
T25
Error log verification across full production run
Review execution logs from T23 and T24 in the production logging environment
All steps present in log with status, timestamp, and duration; no unhandled exceptions; retry events (if any) correctly attributed; SANDBOX_ credentials absent from log entries
Log contains an entry for every named workflow step; no error status on any step; no sandbox credential string appears in any log field
T26
Process owner review and approval
Process owner reviews: email received at internal test address from T23, HubSpot activity log entry, Slack notification, Google Sheets row, and rep review queue entry from T24
Process owner confirms: email tone and personalisation are correct, offer name is accurate, HubSpot log is complete, Slack message is clear and actionable, Google Sheets row is correctly formatted. Process owner approves the automation for full rollout. Approval is recorded in the FullSpec platform confirmation log.
Process owner confirms all five outputs meet expected quality. Approval recorded in FullSpec confirmation log. No separate sign-off block required. Automation cleared for full rollout.
Once T26 is confirmed, the FullSpec team will void the test HubSpot record, remove the Google Sheets test row, and archive this QA plan with the confirmation timestamp. The automation is then eligible for the pilot rollout defined in the Launch Plan. Contact support@gofullspec.com with the confirmation reference if any issue arises during the voiding step.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Upsell & Cross-sell Triggers.

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