ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: webhook fires on correct deal stage
HubSpot sandbox deal moves to 'Proposal Requested' stage with all required fields populated
Automation platform receives webhook payload; agent execution begins within 5 seconds
Execution log shows trigger received; no timeout or parse error
T02
Happy path: deal properties parsed correctly
Sandbox deal with contact name, company, product line A, deal value $12,000, standard discount tier 2
Structured data object contains: contact_name, company_name, product_line='A', deal_value=12000, discount_pct=10
All five fields present and correctly typed in the agent's resolved data object
T03
Happy path: pricing tier resolved correctly
Product line A, deal value $12,000, tier 2 discount rule stored in automation config
Unit price, discount amount, and net total calculated correctly and match expected values
Calculated net total equals $10,800 (12000 minus 10%); no rounding error
T04
Happy path: PandaDoc document created from template
Resolved data object from T03 injected into PandaDoc sandbox template ID 'proposal-master-v3'
New PandaDoc document created with all template variables populated; document status = 'draft'
PandaDoc API returns document_id; all mapped variables confirmed non-empty in document preview
T05
Happy path: expiry date set correctly
Deal created date = today; expiry rule = 14 days
PandaDoc document expiry_date = today + 14 calendar days
Expiry date in generated document matches expected date; no off-by-one error
T06
Failure: required HubSpot field missing (contact email)
Sandbox deal with contact_email field blank; all other fields populated
Agent halts document generation; flags missing field; does not create PandaDoc document
Execution log records 'validation_failed: contact_email missing'; no PandaDoc document created; alert posted to #automation-qa
T07
Failure: unrecognised product line code
Sandbox deal with product_line = 'ZZZ' (not in pricing config)
Agent halts; logs pricing resolution error; does not proceed to document generation
Log records 'pricing_error: unknown product_line ZZZ'; no document created; deal stage not advanced
T08
Failure: PandaDoc template variable name mismatch
Resolved data object uses field key 'client_name'; template expects 'prospect_name'
Document created but mismatched variable renders as blank; agent detects blank variable and flags error
Agent post-generation validation catches blank variable; logs 'template_variable_mismatch: prospect_name'; document not forwarded to approval step
T09
Failure: PandaDoc API returns 429 rate-limit error
Automated retry triggered after PandaDoc returns HTTP 429
Agent waits 10 seconds and retries up to 3 times before marking the run as failed
Execution log shows three retry attempts with timestamps; final status = 'pandadoc_unavailable'; Slack alert sent to #automation-qa
ID
Scenario
Input
Expected Output
Pass Criteria
T10
Happy path: Slack approval message posted correctly
PandaDoc draft document_id passed to Approval and Delivery Agent; manager Slack user ID configured
Slack message posted to #automation-qa with deal summary, PandaDoc preview link, and two buttons: Approve / Request Changes
Slack API returns 200; message visible in channel with both interactive buttons rendered
T11
Happy path: manager clicks Approve
Slack interactive button payload: action_id='approve', manager user ID matches configured approver
Agent receives approval event; proceeds to Gmail send step; does not loop back
Execution log records 'approval_received: approved'; Gmail send step initiated within 3 seconds
T12
Happy path: Gmail proposal email sent to prospect
Approved PandaDoc document link + prospect email address from deal record
Gmail sends email from configured sender alias with personalised subject, prospect name, company name, and PandaDoc link in body
Gmail API returns message_id; sent message appears in Sent folder of test Gmail alias; all personalisation tokens rendered correctly
T13
Happy path: HubSpot deal updated after send
Gmail send confirmed; deal_id passed to HubSpot update step
HubSpot deal stage updated to 'Proposal Sent'; activity logged with timestamp and PandaDoc document_id stored in custom field 'pandadoc_id'
HubSpot API returns 200 for both the stage update and the activity log; deal record reflects correct values in sandbox CRM
T14
Failure: manager clicks Request Changes
Slack interactive button payload: action_id='request_changes', comment='Please add enterprise SLA section'
Agent posts notification to sales rep in #automation-qa with manager's comment and PandaDoc edit link; Gmail send step does not fire; deal stage not advanced
Execution log records 'approval_received: changes_requested'; rep notification posted; no Gmail send event in log; HubSpot deal stage unchanged