Integration tests confirm that data flows correctly between agents and across all six tools. IDs continue the T sequence from Phase 1. Edge-case tests are numbered separately in the E series and cover boundary conditions, malformed data, tool unavailability, and human-review timeout behaviour.
ID
Scenario
Input
Expected Output
Pass Criteria
T16
End-to-end agent handoff: conversion to Sheets to HubSpot
Valid Tapfiliate webhook for AFF042, sale_value=$400.00, tier=standard (10%). Conversion Validation Agent processes and passes output to downstream writes.
Google Sheets log updated with commission=$40.00. HubSpot deal created or updated for AFF042 with sale_value=$400.00 and commission=$40.00 in the same automation run.
Sheets row and HubSpot deal both reflect identical values. No data mismatch between the two records. Run completes without manual intervention.
T17
Payout cycle: Sheets aggregation to Xero bill creation
Payout cycle trigger fires. Google Sheets log contains 4 records for AFF017: $150.00, $75.00, $200.00, $50.00 (total $475.00).
Xero draft bill created for AFF017 at $475.00. Bill reference includes affiliate ID and payout period.
Single Xero bill for AFF017 at $475.00. Bill reference field populated. No individual line-item bills created in error.
T18
Xero approval triggers Gmail confirmation and HubSpot update
Xero sandbox bill for AFF017 ($475.00) status changed to approved.
Gmail confirmation sent to test address with amount $475.00. HubSpot deal for AFF017 updated with payout_status=paid.
Gmail test inbox receives email with $475.00. HubSpot deal field payout_status = paid. Both events recorded in the same run log entry.
T19
Reporting Agent reads live Sheets data after payout cycle
Monday schedule fires after T17 and T18 have been run. Google Sheets contains updated records including AFF017 at $475.00.
Slack digest reflects updated totals including AFF017 as top performer.
Slack message total commission and top performer values match the current state of the Sheets log. No stale data from a previous run.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate conversion submitted twice within the same polling window
Two identical Tapfiliate payloads: conversion_id=CVT010, affiliate_id=AFF042, submitted 45 seconds apart
Only one record written to Google Sheets. Second payload identified as duplicate and suppressed.
Google Sheets log contains exactly one row for CVT010. Duplicate suppression log entry present. No double commission raised.
E02
Conversion payload with missing sale_value field
Tapfiliate payload: conversion_id=CVT011, affiliate_id=AFF055, sale_value=null, status=confirmed
Validation fails. No record written. Anomaly flag = missing_sale_value. Record held in review queue.
No Sheets row for CVT011. Flag reason = missing_sale_value. Review queue entry present with full payload preserved for manual resolution.
E03
Sale value of zero submitted
Tapfiliate payload: conversion_id=CVT012, affiliate_id=AFF042, sale_value=$0.00, status=confirmed
Zero-value conversion flagged as anomaly. No commission calculated. Record held for review.
No commission record written. Flag reason = zero_sale_value. Review queue entry present.
E04
Tapfiliate API unavailable during scheduled poll
Automation platform attempts scheduled poll; Tapfiliate returns 503 for all 3 retry attempts
Retries exhausted. Error logged with timestamp. Slack admin alert sent. Next scheduled poll attempted at the next configured interval.
Run log shows 3 failed attempts with timestamps. Slack admin channel receives alert. No partial or phantom records created in Sheets.
E05
Xero API unavailable at payout cycle close
Payout cycle fires normally. Xero returns 503 on all bill creation attempts.
Bills queued internally. Error logged. Slack admin alert sent with list of affected affiliate IDs and amounts. Bills created on next successful retry.
Run log shows queued bills and retry schedule. Admin alert lists affiliate IDs correctly. No bills created in error during the failure window.
E06
Gmail send failure: SMTP authentication error
Xero bill approved. Gmail API returns 401 authentication error on send attempt.
Email send fails. Error logged. Retry not attempted (auth failure is not transient). Alert raised to admin. Affiliate not notified erroneously.
No email delivered to test address. Admin alert received. Run log records 401 error and the affected affiliate ID. No duplicate send occurs on credential restoration.
E07
Human review timeout: flagged conversion not actioned within 48 hours
Anomaly-flagged record (CVT011 from E02) placed in review queue. Simulated 48-hour inactivity with no human action taken.
Escalation alert sent to process owner via Slack or email at the 48-hour mark. Record remains in queue; automation does not auto-approve or auto-reject.
Escalation message sent at exactly the 48-hour mark (or within a 5-minute tolerance). Record status in review queue unchanged. No commission written without human approval.
E08
Slack API rate limit hit during digest post
Reporting Agent attempts to post the weekly digest. Slack API returns 429 rate-limit error.
Agent respects the Retry-After header, waits the specified duration, and retries. Digest posted successfully on retry.
Slack test workspace shows digest posted. Run log records the initial 429 and the successful retry with timestamp. Retry-After interval honoured within 5 seconds.