Back to Accounts Receivable & Chasing

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

Accounts Receivable & Chasing

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

This document defines the full quality assurance programme for the AR Chase Agent automation. It is written for the FullSpec build team and covers every test case required before the workflow goes live. Testing runs in three sequential phases: unit tests in sandbox, integration and edge-case tests in sandbox, and a final end-to-end production run. No phase begins until the previous phase has fully passed. The process owner joins Phase 3 only, to review and approve the production run before go-live is confirmed.

01Testing approach

Testing follows three phases in strict sequence. No phase begins until the previous phase has fully passed, all failures are resolved, and a pass record is logged. Phase 1 validates individual agent logic in isolation. Phase 2 confirms tool handoffs and system boundaries under normal and abnormal conditions. Phase 3 executes a complete end-to-end run in the production environment with real credentials and live data, observed by the process owner.

1
Phase 1 — Unit Testing
Individual agent logic and tool connections in isolation
Scope
AR Chase Agent internal logic: Xero poll parsing, reminder tier selection, Gmail send, Google Sheets read/write, Slack alert trigger, HubSpot note write. Each action tested independently with mock or sandbox data.
Environment
Sandbox only. Xero demo company, Gmail sandbox sending address, Google Sheets test tab, Slack test channel, HubSpot sandbox portal.
Credential rule
No production credentials permitted. All tokens and API keys must reference sandbox or test accounts exclusively. See Section 02 note.
Pass condition
All test cases T01 through T14 return the expected output with no errors. Any failure blocks progression to Phase 2.
Who runs it
FullSpec team only. Process owner not required for this phase.
2
Phase 2 — Integration and Edge-Case Testing
Agent handoffs, tool boundaries, and failure-mode handling
Scope
Full agent flow from Xero trigger through to HubSpot note write. All tool-to-tool handoffs, the 60-day escalation decision branch, and defined edge cases: duplicate invoices, missing data, tool unavailability, and human timeout scenarios.
Environment
Sandbox only. Integration tests use the same sandbox credentials as Phase 1. No production data is accessed at any point in this phase.
Credential rule
Sandbox credentials only. OAuth tokens must be scoped to test environments. Production OAuth tokens must not be loaded into the test workspace.
Pass condition
All integration test cases T15 through T22 pass and all edge-case tests E01 through E06 produce the defined safe-fail output. No unhandled exceptions permitted.
Who runs it
FullSpec team only. Process owner not required for this phase.
3
Phase 3 — End-to-End Production Test
Full live run with real credentials, observed by the process owner
Scope
One complete production run traced end to end: Xero poll, reminder history check, correct email sent via Gmail, Google Sheets row appended, Slack alert fired (where threshold met), Xero payment reconciled, and HubSpot note written. Error log verification also performed.
Environment
Production environment. Live Xero account, Gmail send-as address, live Google Sheets tracker, live Slack finance channel, live HubSpot portal. Internal test invoice and internal recipient address used.
Credential rule
Production OAuth tokens loaded. Xero connected app scoped to openid, profile, email, accounting.transactions, accounting.contacts. Gmail scoped to gmail.send and gmail.readonly. HubSpot scoped to crm.objects.contacts.write.
Pass condition
All production test cases T23 through T27 pass, including the final process owner review and sign-off (T27). Owner approval recorded in the FullSpec confirmation log.
Who runs it
FullSpec team executes cases T23 through T26. Process owner joins for T27 to review outputs and confirm approval.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only throughout Phase 1. Do not load, reference, or test against any production Xero company, Gmail account, Google Sheets file, Slack workspace, or HubSpot portal. All test data must be synthetic. If a sandbox token expires during testing, refresh it within the sandbox environment before continuing. Do not substitute a production token as a workaround.

AR Chase Agent — unit test cases. The agent is the sole agent in this process. Test cases cover the happy path for each discrete action and the key failure modes for each tool connection.

ID
Scenario
Input
Expected Output
Pass Criteria
T01
Xero poll detects one overdue invoice
Xero demo company: invoice INV-001, due date yesterday, balance $1,200, status AUTHORISED
Agent receives invoice payload: invoice ID, contact ID, amount due, due date, days overdue
Payload parsed without error; all five fields present and correctly typed
T02
Xero poll detects multiple overdue invoices in a single run
Xero demo company: 5 overdue invoices with varying ages (1, 7, 14, 30, 65 days)
Agent processes all 5 invoices sequentially; no invoice skipped
Exactly 5 execution branches initiated; no duplicate processing
T03
Xero poll returns no overdue invoices
Xero demo company: all invoices either paid or not yet due
Agent exits gracefully; no downstream actions triggered
Zero reminder emails sent; zero Sheets rows appended; no errors logged
T04
Google Sheets reminder history read — first reminder (count 0)
Google Sheets test tab: invoice INV-001, no existing rows
Agent determines reminder count = 0; selects Tier 1 (polite) template
Correct template ID returned; no read error
T05
Google Sheets reminder history read — second reminder (count 1)
Google Sheets test tab: invoice INV-002, one existing row with reminder_count = 1
Agent determines reminder count = 1; selects Tier 2 (firm) template
Correct template ID returned; read operation returns exactly one matching row
T06
Google Sheets reminder history read — third reminder (count 2)
Google Sheets test tab: invoice INV-003, two existing rows with reminder_count = 2
Agent determines reminder count = 2; selects Tier 3 (final notice) template
Correct template ID returned; escalation flag set to true
T07
Gmail sends Tier 1 reminder email
Invoice INV-001, contact email test@internal.com, amount $1,200, due date populated
Email delivered to sandbox inbox; subject line contains invoice number; body references amount and due date
Gmail API returns status 200; message ID recorded; no delivery error
T08
Gmail sends Tier 2 firm reminder email
Invoice INV-002, reminder count 1, days overdue 14
Firm-tone template sent; subject prefix 'Reminder:' present; correct invoice details in body
Correct template rendered; Gmail API 200 response; message ID logged
T09
Gmail sends Tier 3 final notice email
Invoice INV-003, reminder count 2, days overdue 30
Final notice template sent; subject prefix 'Final Notice:' present; escalation language in body
Correct template rendered; Gmail API 200 response; message ID logged
T10
Gmail send fails — authentication error
Gmail sandbox token revoked mid-run
Agent catches 401 error; logs failure to error log; does not retry; alerts via Slack error channel
Error entry written to log with timestamp; no unhandled exception; Slack error alert fired
T11
Google Sheets append — new reminder row written
Post-send: invoice INV-001, reminder count 1, sent timestamp, email subject
New row appended to test Sheets tab: client name, invoice number, reminder number, date sent, email subject, status = 'sent'
Row count increments by exactly 1; all 6 fields populated correctly
T12
Slack escalation alert fires when invoice is 60+ days overdue
Invoice INV-004, days overdue = 62, reminder count = 3
Formatted Slack message posted to test channel: contact name, invoice number, amount, days overdue, reminder count
Slack API returns 200; message visible in test channel; all 5 data fields present in message
T13
Slack escalation does NOT fire when invoice is under 60 days and fewer than 3 reminders
Invoice INV-005, days overdue = 20, reminder count = 1
No Slack message posted; agent continues to Sheets log step only
Zero Slack messages in test channel for this run; no escalation flag set
T14
HubSpot note written to contact record
HubSpot sandbox contact ID matching Xero contact; note text: reminder stage, date, invoice reference
Note created on HubSpot contact timeline; note body contains invoice number, reminder stage, and date
HubSpot API returns 201; note ID returned; all three fields present in note body
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Phase 2 tests the full agent flow as a connected system, validating handoffs between each tool and confirming that the escalation decision branch routes correctly. Test IDs continue the sequence from Phase 1. A separate edge-case table follows, covering conditions outside the happy path that the agent must handle safely.

ID
Scenario
Input
Expected Output
Pass Criteria
T15
Full happy-path run: Tier 1 reminder, no escalation
Xero: INV-010, 3 days overdue, balance $800. Sheets: no prior rows. Days overdue = 3, reminders = 0.
Tier 1 email sent via Gmail; Sheets row appended (reminder 1); no Slack alert; HubSpot note written
All 4 downstream actions complete in sequence; no step skipped; no error logged
T16
Full happy-path run: Tier 3 final notice, escalation triggered
Xero: INV-011, 35 days overdue, balance $3,500. Sheets: 2 prior reminder rows.
Tier 3 email sent; Sheets row appended (reminder 3); Slack escalation posted to test channel; HubSpot note written
All 5 actions complete; Slack message contains correct contact and amount; escalation flag confirmed in Sheets row
T17
Xero to Google Sheets handoff: reminder count correctly read from Sheets before email selection
Xero: INV-012, 10 days overdue. Sheets: 1 existing row for INV-012.
Agent reads Sheets row, determines count = 1, selects Tier 2 template; Tier 2 email sent
Sheets read completes before Gmail send executes; correct template confirmed by inspecting sent message subject
T18
Gmail to Google Sheets handoff: Sheets row is written only after Gmail confirms delivery
Invoice INV-013, Tier 1 send. Simulate delayed Gmail response (2-second mock delay).
Sheets append executes only after Gmail API returns 200; row timestamp is after send timestamp
Sheets row created; row timestamp within 5 seconds of Gmail send timestamp; no premature write
T19
Escalation branch: Slack fires and finance channel receives correctly formatted alert
Invoice INV-014, 61 days overdue, 3 reminders. Slack test channel configured.
Slack message contains: client name, invoice number, $amount, days overdue, reminder count. Finance channel tag present.
Message format matches specification; all 5 data fields rendered; channel is correct test channel ID
T20
Non-escalation branch: Slack step skipped, flow continues to HubSpot
Invoice INV-015, 10 days overdue, 1 reminder. Escalation condition not met.
Slack step bypassed; HubSpot note written; no Slack message in test channel
Zero new messages in test Slack channel; HubSpot note present; no branch error logged
T21
Google Sheets to HubSpot handoff: HubSpot note references same invoice logged in Sheets
Invoice INV-016, Tier 2 send. Sheets row appended with invoice number INV-016.
HubSpot note body contains 'INV-016' and matches the reminder stage recorded in Sheets
Invoice reference consistent across Sheets row and HubSpot note; no mismatch
T22
Run with multiple concurrent invoices: all processed without data collision
Xero: 4 overdue invoices simultaneously in sandbox — INV-020 through INV-023, mixed reminder counts
Each invoice processed independently; 4 separate Gmail sends; 4 Sheets rows appended; correct tier applied to each
No invoice data written to another invoice's Sheets row; 4 HubSpot notes created; no cross-contamination

Edge-case test table. These cases simulate conditions outside the normal operating path. The agent must handle each case with a defined safe-fail outcome and must not crash, skip silently, or write incorrect data.

ID
Scenario
Input
Expected Safe-Fail Output
Pass Criteria
E01
Duplicate invoice returned by Xero poll in the same run
Xero poll returns INV-030 twice in a single response (simulated API quirk)
Agent detects duplicate by invoice ID; processes INV-030 only once; second instance discarded
Exactly one Gmail send, one Sheets row, one HubSpot note for INV-030; no duplicate
E02
Missing contact email on Xero invoice
Invoice INV-031 is overdue but linked Xero contact has no email address recorded
Agent logs 'missing contact email' error for INV-031; skips Gmail send; appends error row to Sheets; continues processing next invoice
Error row written to Sheets with status = 'error: no email'; Gmail not called; subsequent invoices still processed
E03
Google Sheets service unavailable during reminder history read
Mock Sheets API to return 503 on read request for INV-032
Agent retries Sheets read twice with 30-second backoff; on third failure, logs error and skips this invoice; moves to next
Two retry attempts logged with timestamps; error entry written after third failure; no Gmail send for INV-032
E04
HubSpot contact record not found for Xero contact
Invoice INV-033 linked to Xero contact whose email does not match any HubSpot contact
Agent completes Gmail send and Sheets log successfully; HubSpot step logs 'contact not found' warning; does not crash
Gmail and Sheets steps succeed; HubSpot returns 404; warning logged; workflow run marked 'partial success'
E05
Slack API unavailable at time of escalation alert
Invoice INV-034, 65 days overdue. Mock Slack API to return 500.
Agent logs Slack delivery failure; escalation error recorded in Sheets row status field; Gmail and HubSpot steps still complete
Slack failure entry in error log; Sheets row status = 'escalation failed'; Gmail and HubSpot steps confirmed complete
E06
Invoice tagged as disputed or on exception list in Google Sheets
Invoice INV-035 has status = 'disputed' in the Sheets tracker exception column
Agent reads disputed status; skips all reminder and escalation actions for INV-035; logs 'skipped: disputed' in Sheets
No Gmail send; no Slack alert; no HubSpot note for INV-035; Sheets row updated with skip reason
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 email address as the recipient for all production test emails — do not send to any real client address. Create a dedicated test invoice in the live Xero account (marked clearly as a test record) and void or delete it immediately after the run is confirmed. Confirm with the process owner that the live Slack finance channel will receive a test alert and that team members are aware before the run begins. Do not proceed if production OAuth tokens for any tool are not yet authorised and scoped correctly.

Phase 3 uses the live production environment, real API credentials, and a controlled test invoice to verify the automation behaves correctly from end to end before the first real daily run. The FullSpec team executes cases T23 through T26. The process owner joins for T27, reviews all outputs, and records approval. That approval is the go-live gate.

ID
Scenario
Production Input
Expected Output
Pass Criteria
T23
Production Xero poll detects test invoice and triggers run
Live Xero account: test invoice INV-TEST-001, due date set to yesterday, balance $100, contact email = internal test address
Automation platform triggers a new run for INV-TEST-001 within the scheduled poll window (daily, within 10 minutes of poll time)
Run log shows trigger fired for correct invoice ID; no other live invoices accidentally reprocessed
T24
Full production send: Tier 1 email received at internal test address via Gmail
INV-TEST-001, 1 day overdue, 0 prior reminders in live Sheets tracker
Tier 1 polite reminder email arrives at internal test inbox; subject contains 'INV-TEST-001'; body contains amount $100 and due date; from address is the authorised Gmail send-as address
Email received within 2 minutes of trigger; all merge fields correct; no raw variable placeholders visible; Gmail API message ID logged
T25
Live Google Sheets tracker row appended and HubSpot note created
Post-send for INV-TEST-001
Live Sheets tracker: new row with client name, INV-TEST-001, reminder number 1, today's date, email subject, status = 'sent'. HubSpot live contact record: note added referencing INV-TEST-001, reminder stage 1, and today's date.
Sheets row present and all 6 fields populated; HubSpot note visible on contact timeline within 3 minutes of email send; no duplicate rows
T26
Error log verification: run completes with no errors recorded
Full production run for INV-TEST-001 as above
Automation platform run log shows status = 'success'; zero error entries; all steps show green completion status
Run log inspected by FullSpec team; no warnings, retries, or failures recorded; execution time within expected range (under 90 seconds for single invoice)
T27
Process owner review and approval — final go-live gate
Process owner reviews: test email received, Sheets row, HubSpot note, run log, and Slack test alert (if escalation threshold test was included)
Process owner confirms all outputs are correct, templates are acceptable, and the automation is ready for live operation. Approval recorded in FullSpec confirmation log with name, date, and sign-off statement.
Owner approval confirmed and logged in FullSpec system. Test invoice INV-TEST-001 voided in Xero. Go-live authorised.
Once T27 is approved, the FullSpec team will void the test invoice in Xero, confirm the daily poll schedule is active, and monitor the first two live daily runs with the bookkeeper present as described in the Launch Plan. Any issues surfaced in those first two live runs are treated as post-launch defects and resolved by FullSpec at no additional cost within the standard support window. Contact the FullSpec team at support@gofullspec.com for any questions or issues during testing or post-launch monitoring.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Accounts Receivable & Chasing.

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