Back to Affiliate Programme Management

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

Affiliate Programme Management

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

This document defines the full testing and quality assurance programme for the Affiliate Programme Management automation. It is written for the FullSpec build team and covers every test case required to validate the Conversion Validation Agent, the Payout and Communications Agent, and the Reporting Agent before production go-live. Testing runs in three sequential phases: unit testing in sandbox, integration and edge-case testing in sandbox, and end-to-end validation in the production environment. The process owner joins Phase 3 to confirm outputs and provide final sign-off. No phase may begin until the previous phase has fully passed.

01Testing approach

Testing runs in three phases in sequence. No phase begins until the previous phase fully passes. Each phase targets a distinct layer of the automation, from individual agent logic through to a live production run traced end to end. The FullSpec team executes all three phases; the process owner is brought in specifically during Phase 3 to review real outputs and provide formal approval.

1
Phase 1: Unit Testing
Validate each agent in isolation
Scope
Each agent tested independently: Conversion Validation Agent, Payout and Communications Agent, Reporting Agent. Logic, calculations, and tool writes verified in isolation.
Environment
Sandbox only. All tool connections use sandbox or test credentials. No production data is read or written.
Credential rule
Sandbox API keys for Tapfiliate test environment, HubSpot sandbox portal, Xero demo company, Gmail test account, Google Sheets test workbook, and Slack test workspace. Production credentials must not be loaded.
Pass condition
All test cases T01 through T12 return the expected output and meet the stated pass criteria. Zero failures permitted before Phase 2 begins.
Who runs it
FullSpec team only.
2
Phase 2: Integration and Edge-Case Testing
Validate agent handoffs and boundary conditions
Scope
Multi-agent handoff sequences, data propagation across Tapfiliate, Google Sheets, HubSpot, Xero, Gmail, and Slack. Separate edge-case battery covering duplicates, missing data, tool unavailability, and human-review timeout scenarios.
Environment
Sandbox only. Same credential set as Phase 1. No production data touched.
Credential rule
Sandbox credentials remain active. Do not swap in production keys mid-phase even if a sandbox service is unavailable. Pause and resolve the sandbox issue first.
Pass condition
All integration test cases T13 through T19 and all edge-case tests E01 through E08 pass. Any failure halts Phase 3 until root cause is resolved and the affected case re-run from the start.
Who runs it
FullSpec team only.
3
Phase 3: End-to-End Production Test
Full live run with process owner sign-off
Scope
One complete production run: a real conversion event traced through all agents, all tool writes, and all outbound communications. Error-log audit and process owner review included.
Environment
Production. Live credentials, live tool instances. Test affiliate contact and test Xero bill used; both voided after the run.
Credential rule
Production API keys loaded. Confirm with the process owner that a safe test affiliate record exists before firing any event. Remove or void all artefacts created during this phase immediately after sign-off.
Pass condition
All end-to-end test cases T20 through T24 pass, including the process owner review case (T24). FullSpec records the owner's approval in the confirmation log. No separate signoff block is required.
Who runs it
FullSpec team executes T20 through T23. Process owner participates in and approves T24.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only for all Phase 1 tests. Do not connect or reference production API keys, production Xero company data, live affiliate records, or real Gmail recipients at any point during this phase. Use the designated test workbook in Google Sheets and the Slack test workspace throughout.

Conversion Validation Agent — estimated build time: 16 hours, complexity: Moderate.

ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: valid conversion, standard tier
Tapfiliate webhook payload: conversion_id=CVT001, affiliate_id=AFF042, sale_value=$250.00, status=confirmed, tier=standard (10%)
Commission record written to Google Sheets: affiliate_id=AFF042, sale_value=$250.00, commission=$25.00, status=pending_payout. No anomaly flag raised.
Google Sheets row created with correct values. commission_amount field equals sale_value multiplied by 0.10. status field = pending_payout. No flag field set.
T02
Happy path: valid conversion, premium tier
Tapfiliate webhook payload: conversion_id=CVT002, affiliate_id=AFF017, sale_value=$500.00, status=confirmed, tier=premium (15%)
Commission record written: commission=$75.00, tier=premium. No anomaly flag.
commission_amount = $75.00. Tier label recorded correctly. No flag field set.
T03
Duplicate conversion detected
Tapfiliate payload: conversion_id=CVT001 (same ID as T01), affiliate_id=AFF042, sale_value=$250.00
Duplicate detected. No new row written to Google Sheets. Anomaly flag raised and routed to manual review queue.
Google Sheets row count unchanged from T01 state. Flag field = duplicate. Alert visible in review queue.
T04
Refunded conversion
Tapfiliate payload: conversion_id=CVT003, affiliate_id=AFF055, sale_value=$180.00, status=refunded
Conversion rejected. No commission record written. Anomaly flag raised with reason=refunded.
No Google Sheets row created. Flag field = refunded. Status not set to pending_payout.
T05
Missing affiliate ID
Tapfiliate payload: conversion_id=CVT004, affiliate_id=null, sale_value=$90.00, status=confirmed
Validation fails. No record written. Anomaly flag raised with reason=missing_affiliate_id.
No Google Sheets row created. Flag field = missing_affiliate_id. Error logged in platform run log.
T06
Unrecognised commission tier
Tapfiliate payload: conversion_id=CVT005, affiliate_id=AFF099, sale_value=$320.00, status=confirmed, tier=vip (no rule configured)
Commission calculation fails. Anomaly flag raised with reason=unknown_tier. No record written pending review.
No Google Sheets row created. Flag field = unknown_tier. Error logged. Record held in review queue for manual commission assignment.
T07
Google Sheets write failure (simulated)
Valid conversion payload as T01 but Google Sheets API returns 503 on write attempt
Retry logic fires (up to 3 attempts at 30-second intervals). If all retries fail, error logged and alert raised. No data lost.
Run log shows 3 retry attempts. Error entry present. No partial row written to Sheets. Retry alert visible.

Payout and Communications Agent — estimated build time: 22 hours, complexity: Complex.

ID
Scenario
Input
Expected Output
Pass Criteria
T08
Happy path: monthly payout cycle fires
Scheduled trigger at payout cycle close. Google Sheets log contains 3 validated pending_payout records for AFF042 ($25.00), AFF017 ($75.00), AFF055 ($0.00 refunded, excluded).
Two Xero bills created: one for AFF042 at $25.00, one for AFF017 at $75.00. Both marked awaiting finance approval.
Xero sandbox shows 2 draft bills with correct affiliate reference and amount. Refunded record excluded. No bill raised for AFF055.
T09
Happy path: Gmail payment confirmation sent
Xero bill for AFF042 status changes to approved in sandbox.
Personalised Gmail confirmation email sent to test affiliate address with correct payout amount ($25.00) and reference.
Email received at test Gmail account. Subject line contains affiliate name or ID. Body contains payout amount $25.00. No hardcoded placeholder text visible.
T10
New affiliate approved: onboarding sequence triggered
New affiliate approval event from Tapfiliate: affiliate_id=AFF101, email=test-affiliate@sandbox.test, name=Test Partner
HubSpot deal record created for AFF101. Welcome email sequence initiated via Gmail with tracking link placeholder resolved.
HubSpot sandbox shows new deal linked to AFF101 contact. Gmail test inbox receives welcome email with correct name and programme details. No placeholder tokens visible in email body.
T11
Xero bill creation fails (simulated API error)
Valid payout cycle trigger. Xero sandbox API returns 429 rate-limit error on bill creation.
Retry logic fires (up to 3 attempts with exponential backoff). If all retries fail, error logged and Slack alert sent to designated channel.
Run log shows retry sequence. Slack test workspace receives alert message identifying the failed Xero bill and the affected affiliate ID.
T12
HubSpot deal update fails: duplicate deal detected
Onboarding trigger for AFF042 who already has an existing open HubSpot deal.
Agent updates the existing deal rather than creating a duplicate. No second deal record created.
HubSpot sandbox shows one deal for AFF042. Deal properties updated with new conversion data. No duplicate deal present.

Reporting Agent — estimated build time: 10 hours, complexity: Simple.

ID
Scenario
Input
Expected Output
Pass Criteria
T13
Happy path: weekly digest posted to Slack
Monday 08:00 schedule fires. Google Sheets test log contains 5 records from the past 7 days: 3 affiliates, total commission $320.00, top performer AFF017 at $150.00.
Formatted Slack message posted to test channel: lists top affiliates by commission, total conversions (5), total commission accrued ($320.00), and date range.
Slack test workspace shows message in correct channel. All three data points present and match Sheets totals. Message timestamp within 2 minutes of scheduled fire time.
T14
No conversions in the past 7 days
Monday schedule fires. Google Sheets log contains zero records for the past 7-day window.
Slack message posted indicating no conversions recorded for the period. Message does not error or post blank.
Slack message present in test channel. Body reads clearly (e.g. 'No conversions recorded this week'). No null values or empty fields visible.
T15
Google Sheets read fails (simulated)
Monday schedule fires. Sheets API returns 503.
Retry logic fires. If unresolved after 3 attempts, error logged and Slack alert sent to admin channel rather than a blank digest.
Run log shows retry sequence. Admin channel receives error alert. No empty or malformed digest posted to the main reporting channel.
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

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.
Edge-case tests must all be run in sandbox. Simulate tool failures using mock API responses or by temporarily revoking the sandbox credential. Restore access and verify recovery behaviour before marking any case as passed.
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.
Test and QA PlanPage 3 of 4
FS-DOC-06Quality

04Phase 3 — end-to-end production test

Important before running Phase 3: Use an internal test affiliate address (e.g. a FullSpec or [YourCompany.com] internal email) as the recipient for all outbound Gmail communications. Ensure the test conversion record, the Xero draft bill, and the HubSpot deal created during this phase are all voided or deleted immediately after the process owner provides approval. Do not leave test artefacts in the production environment. Confirm with the Finance Manager that the test Xero bill will not be approved or paid before it is voided.

Phase 3 uses live production credentials and live tool instances. The FullSpec team coordinates each step with the process owner, who reviews outputs in real time. All test cases in this phase must pass before go-live is confirmed. The owner's approval at T24 is recorded by FullSpec in the project confirmation log and constitutes formal sign-off.

ID
Scenario
Input
Expected Output
Pass Criteria
T20
Full production run: live conversion event traced end to end
FullSpec fires a real Tapfiliate conversion event using a designated internal test affiliate (affiliate_id=AFF-TEST, sale_value=$100.00, tier=standard). Production credentials active across all six tools.
Commission record written to production Google Sheets log ($10.00 commission). HubSpot deal created for AFF-TEST. No Xero bill raised (payout cycle not yet closed). Run completes without errors.
Production Sheets log shows one new row for AFF-TEST with correct commission. HubSpot production instance shows deal linked to AFF-TEST. Run log shows all steps completed. No error entries.
T21
Production payout cycle: Xero bill raised for test affiliate
FullSpec manually triggers the payout cycle close for the test affiliate only. Production Xero connected.
Draft Xero bill created for AFF-TEST at $10.00. Bill status = awaiting approval. Finance Manager notified per normal workflow (no actual payment to be released).
Xero production instance shows one draft bill for AFF-TEST at $10.00. Bill reference populated with affiliate ID and payout period. Finance Manager alert received. Bill not approved during this test.
T22
Production Gmail confirmation: send to internal test address
FullSpec manually sets the test Xero bill status to approved in Xero (using a test approval, not real finance sign-off). Gmail trigger fires.
Personalised payment confirmation email sent to the designated internal test address. Email contains payout amount ($10.00) and reference. No real affiliate address receives an email.
Internal test inbox receives the email within 3 minutes of Xero bill approval. Amount and reference correct. No external affiliate address appears in To, CC, or BCC fields.
T23
Error-log verification: confirm clean run record
FullSpec reviews the platform run log for the full Phase 3 sequence (T20 through T22).
Run log shows all steps completed successfully. No error entries, no retries triggered, no anomaly flags raised for the test conversion. Log timestamps are sequential and consistent.
Run log reviewed and confirmed clean by FullSpec engineer. Any unexpected log entry is investigated and resolved before T24 proceeds.
T24
Process owner review and approval
Process owner reviews: the Google Sheets production log entry for AFF-TEST, the Xero draft bill (now voided by FullSpec), the Gmail confirmation received at the internal test address, and the platform run log summary provided by FullSpec.
Process owner confirms all outputs are correct, match expectations, and the automation behaved as documented. Owner provides verbal or written approval. FullSpec records the approval in the project confirmation log. All test artefacts voided.
Process owner has reviewed and approved all Phase 3 outputs. FullSpec confirmation log updated with owner name, date, and approval statement. Test Xero bill voided. Test HubSpot deal deleted. Test Sheets row archived or removed. Go-live authorised.
Once T24 is recorded as passed and all test artefacts are voided, the FullSpec team will confirm go-live readiness and hand over the operational runbook to the process owner. Any issues identified during Phase 3 that cannot be resolved within the same session will restart the affected phase from T20. Contact the FullSpec team at support@gofullspec.com for any queries during or after the testing programme.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Affiliate Programme Management.

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