FS-DOC-06Quality
Test and QA Plan
Sales Forecasting Automation
[YourCompany.com] · Sales Department · Prepared by FullSpec · [Today's Date]
This document defines the structured test and quality assurance programme for the Sales Forecasting automation. It is written for the FullSpec team executing the build and covers all three test phases: unit, integration and edge case, and end-to-end production. Each phase must fully pass before the next begins. Your process owner joins Phase 3 to review and formally sign off the production run. All test case IDs are sequential and traceable across phases.
01Testing approach
Testing runs in three phases in sequence. No phase begins until the previous phase fully passes. Phase 1 validates each agent in isolation using sandbox credentials and synthetic data. Phase 2 confirms that agents hand off correctly to one another and that the system behaves predictably under edge-case and error conditions. Phase 3 executes a complete end-to-end run in the production environment with the process owner present to review and approve the output.
1Phase 1: Unit Testing
Each agent tested in isolation before any integration work begins
Scope
Individual agent logic: trigger handling, API calls, data filtering, Slack nudge dispatch, weighting calculations, and Google Sheets writes — each tested independently.
Environment
Sandbox only. HubSpot sandbox account, Google Sheets test workbook, Slack test workspace, Gmail test account, Tableau sandbox site.
Credential rule
No production credentials may be used. All API keys and OAuth tokens must reference sandbox or test instances exclusively.
Pass condition
All cases T01 through T15 return the expected output with no errors. Any failure blocks progression to Phase 2.
Who runs it
FullSpec team only. Process owner is not required for Phase 1.
2Phase 2: Integration and Edge Case Testing
Agent handoffs and failure-mode behaviour validated in sandbox
Scope
End-to-end agent handoff chain (Data Pull to Forecast Calculation to Distribution), plus targeted edge-case scenarios covering duplicates, missing data, unavailable tools, and human timeout.
Environment
Sandbox only. Same isolated credentials as Phase 1; no production data or accounts touched.
Credential rule
Sandbox credentials only. OAuth tokens scoped to test instances. No production API keys loaded into the orchestration layer.
Pass condition
All integration cases T16 through T22 pass and all edge cases E01 through E06 produce the expected controlled outcome. Any unhandled exception or incorrect state transition is a blocking failure.
Who runs it
FullSpec team only. Process owner is not required for Phase 2.
3Phase 3: End-to-End Production Test
Full production run with process owner sign-off
Scope
A complete forecasting cycle executed against live production systems: HubSpot production account, live Google Sheets forecast workbook, production Slack workspace, Gmail production account, and live Tableau site.
Environment
Production. All credentials are live. Test deal records are used where possible; any live records touched are flagged and voided after the run.
Credential rule
Production credentials in use. OAuth tokens must carry only the minimum required scopes as documented in the Integration and API Spec. No additional scopes permitted.
Pass condition
All cases T23 through T27 pass, including the process owner review-and-approval case (T27). FullSpec records the outcome in the confirmation log.
Who runs it
FullSpec team executes T23 through T26. The process owner joins for T27 (review and approval). FullSpec records sign-off in the FullSpec confirmation log; no separate signoff block is required.
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 load production API keys, OAuth tokens, or real HubSpot deal data into the test environment at any point during this phase. Use the designated HubSpot sandbox account, the Google Sheets test workbook, the Slack test workspace, and the Gmail test account defined in the Integration and API Spec.
Data Pull and Completeness Agent (T01 to T07)
ID
Scenario
Input
Expected Output
Pass Criteria
T01
Scheduled weekly trigger fires
Cron schedule fires at configured day and time with no manual action
Agent wakes, initiates HubSpot API call, retrieves open deal records
API call made within 10 seconds of trigger; HTTP 200 response logged
T02
Stage-change trigger fires on qualifying deal
HubSpot webhook payload: deal value $15,000, stage changed to 'Proposal Sent'
Agent wakes immediately; deal record retrieved and processed
Trigger fires within 30 seconds of webhook receipt; deal ID present in run log
T03
Stage-change trigger ignored below value threshold
HubSpot webhook payload: deal value $500, stage changed
Agent does not wake; event is discarded silently
No run initiated; threshold-skip event logged with deal ID and value
T04
All open deals retrieved successfully
HubSpot sandbox contains 12 open deals across 4 stages
All 12 deal records returned with stage, amount, close date, owner, and last-modified timestamp
Record count in response equals 12; all required fields present on each record
T05
Stale record detected and rep nudged in Slack
Deal record: no stage update in 15 days, close date 45 days ago
Deal flagged as stale; owning rep receives targeted Slack DM with deal name and action requested
Slack message delivered to correct sandbox user; deal ID tagged in flag log
T06
Incomplete record detected (missing amount)
Deal record: stage set, close date set, amount field empty
Deal flagged as incomplete; rep receives Slack nudge requesting amount entry
Slack DM sent to rep; deal excluded from weighting run until updated; flag logged
T07
HubSpot API returns 401 Unauthorized
Invalid or expired OAuth token used for HubSpot Deals API call
Agent logs authentication error, halts run, and does not proceed to Forecast Calculation Agent
Error event logged with status code 401; no downstream agent triggered; alert raised
Forecast Calculation Agent (T08 to T12)
ID
Scenario
Input
Expected Output
Pass Criteria
T08
Agent receives clean deal data from Data Pull Agent
12 deal records, all fields populated, passed via internal handoff payload
Agent acknowledges receipt; begins weighting calculation without error
Handoff payload parsed correctly; all 12 records present in calculation context
T09
Probability weights applied correctly by stage
Deal A: amount $10,000, stage 'Proposal Sent' (probability 40%); Deal B: amount $20,000, stage 'Contract Sent' (probability 75%)
Deal A weighted value: $4,000; Deal B weighted value: $15,000
Calculated weighted values match expected figures exactly; formula logic verified in run log
T10
Projection tables grouped by close week and month
12 deals with close dates spread across 6 weeks and 3 months
Weekly and monthly projection tables populated in Google Sheets with correct groupings and totals
Row counts match expected groupings; subtotals and grand totals are arithmetically correct
T11
Historical comparison flags above-norm deal
Current pipeline weighted total exceeds stored historical conversion benchmark by 22%
Variance flag written to Google Sheets; cell highlighted in the designated variance column
Flag cell contains positive variance value; conditional formatting applied; benchmark figure visible
T12
Stage probability value missing for a pipeline stage
Deal record references a stage named 'Legal Review' with no probability mapping configured
Deal excluded from weighted calculation; warning written to error log; run continues for remaining deals
Error log entry present with deal ID and stage name; excluded deal not included in totals; run completes
Distribution Agent (T13 to T15)
ID
Scenario
Input
Expected Output
Pass Criteria
T13
Agent waits for approval flag in Google Sheets
Approval cell in Google Sheets review tab is empty (no value set)
Agent polls the approval cell; no email or Slack message sent; wait state maintained
No outbound messages fired; polling interval logged every 2 minutes; state remains 'awaiting approval'
T14
Forecast email sent on approval
Sales manager sets approval cell to 'Approved' in the Google Sheets review tab
Formatted forecast summary email sent via Gmail to the sandbox leadership distribution list
Email delivered to all sandbox recipients; subject line, body, and attachment present; send timestamp logged
T15
Gmail API returns 429 rate limit error during send
Gmail API responds with HTTP 429 on first send attempt
Agent retries after 60-second back-off; succeeds on retry; retry event logged
Retry attempt logged; email delivered on second attempt; no duplicate sends; final status 'delivered' in log
Test and QA PlanPage 2 of 4
FS-DOC-06Quality
03Phase 2 — integration and edge case tests
Integration tests — agent handoffs (T16 to T22)
ID
Scenario
Input
Expected Output
Pass Criteria
T16
Data Pull Agent to Forecast Calculation Agent handoff
Data Pull Agent completes successfully; 12 clean deal records ready
Handoff payload delivered to Forecast Calculation Agent; agent begins execution within 15 seconds
Forecast Calculation Agent run ID created; input record count matches Data Pull Agent output count
T17
Forecast Calculation Agent to Google Sheets write
Calculation complete; weighted totals and projection tables ready for write
All projection rows written to correct tabs in the Google Sheets workbook; previous cycle data overwritten
Row count in Sheets matches expected output; no orphaned rows from prior cycle; charts refreshed
T18
Google Sheets write triggers Tableau refresh
Sheets write completes successfully
Tableau data source refresh triggered via API; dashboard reflects updated figures
Tableau refresh job ID returned; job status polling confirms 'complete'; dashboard last-updated timestamp advances
T19
Approval flag detected, Distribution Agent triggered
Approval cell set to 'Approved'; Distribution Agent polling detects change
Distribution Agent begins execution; Gmail send and Slack post initiated in sequence
Both Gmail send and Slack post complete; sequence timestamps logged; no duplicate triggers
T20
Slack pipeline snapshot posted correctly
Distribution Agent triggered; Slack post step executes
Concise pipeline summary posted to the configured Slack channel with correct figures
Message appears in correct sandbox channel; weighted total, top deals count, and cycle date are accurate
T21
Full chain: trigger to distribution with zero manual intervention
Weekly schedule fires; all 12 deals complete; approval set by manager; distribution executes
Complete run from trigger to Gmail delivery and Slack post completes without any manual step beyond the approval
All agent run IDs present in the orchestration log; total elapsed time under 30 minutes; no errors logged
T22
Data Pull Agent failure halts downstream agents
HubSpot API returns HTTP 503 on data pull attempt
Data Pull Agent logs failure; Forecast Calculation Agent is not triggered; error alert raised
Forecast Calculation Agent run ID not created; error event logged with HTTP 503 and timestamp; no Sheets write occurs
Edge case tests (E01 to E06)
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate deal records returned by HubSpot API
HubSpot API returns the same deal ID twice in the same response payload
De-duplication logic removes the duplicate; only one instance of the deal included in the calculation
Final deal list contains no repeated deal IDs; de-duplication event logged with duplicate deal ID
E02
Deal record with missing close date
Deal has stage and amount populated but close date field is null
Deal flagged as incomplete; rep nudged via Slack; deal excluded from weekly projection grouping
Slack nudge sent to rep; deal appears in 'incomplete' flag log; deal not included in any projection table row
E03
Google Sheets API unavailable during write
Sheets API returns HTTP 503 when Forecast Calculation Agent attempts write
Agent retries up to 3 times with exponential back-off; if all retries fail, run halts and error is logged
Retry attempts logged with timestamps; on three failures, run halts; error event written; no partial data in Sheets
E04
Slack API unavailable during rep nudge dispatch
Slack API returns HTTP 429 or 503 when nudge messages are sent
Failed nudges queued for retry; agent logs affected rep IDs; forecast calculation proceeds with available data
Retry queue populated with failed message IDs; calculation agent not blocked; retry outcome logged
E05
Sales manager does not approve within 48 hours
Approval cell in Google Sheets remains empty for 48 hours after Sheets write completes
Distribution Agent sends a Slack reminder to the sales manager after 24 hours; escalation logged after 48 hours
Slack reminder message sent at the 24-hour mark to the correct user; 48-hour escalation event written to log
E06
Tableau licence tier does not support automated refresh
Tableau API call for data source refresh returns HTTP 403 Forbidden
Agent logs the 403 response; run continues to Distribution step; error note appended to the Sheets output indicating Tableau was not refreshed
403 event logged; Gmail and Slack distribution still execute; Sheets review tab contains a visible note that Tableau refresh failed
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 (not an external stakeholder address) as the Gmail distribution recipient for T24. Direct any Slack forecast posts to a private internal test channel, not the live leadership channel. After the production run completes, void the test deal records created in HubSpot and remove the test forecast entry from the Google Sheets workbook. Confirm with the FullSpec team that Tableau shows no persisted test data before marking Phase 3 closed.
ID
Scenario
Input
Expected Output
Pass Criteria
T23
Production weekly trigger fires and live deal data retrieved
Scheduled trigger fires against the production HubSpot account; all open live deals retrieved
All open deal records returned with stage, amount, close date, owner, and last-modified timestamp; stale and incomplete records flagged; Slack nudges sent to reps in the production workspace
Deal count matches HubSpot UI pipeline view; Slack nudges visible in production workspace to the correct reps; run log shows HTTP 200 from HubSpot Deals API
T24
Forecast calculated and written to production Google Sheets
Clean deal records from T23 passed to Forecast Calculation Agent
Weighted values, projection tables, variance flags, and chart data written to the live Google Sheets forecast workbook; Tableau data source refresh triggered
Google Sheets projection tables contain correct weighted totals matching manual spot-check on 3 sampled deals; variance column populated; Tableau refresh job confirmed complete via API status
T25
Error log reviewed for any unexpected warnings
Orchestration layer run log from T23 and T24 accessed by the FullSpec team
Log contains no unhandled exceptions; any expected informational events (threshold skips, de-duplication) are present and correctly categorised
Zero unhandled exceptions in the run log; all logged events carry correct severity levels; no silent failures identified on log review
T26
Distribution executes correctly on approval in production
Sales manager sets the approval cell in the live Google Sheets review tab to 'Approved'
Formatted forecast email sent via Gmail to the internal test address; pipeline snapshot posted to the private test Slack channel; both actions logged with timestamps
Gmail delivery confirmed in the test inbox within 2 minutes of approval; Slack post visible in the test channel with correct figures; distribution log entry present
T27
Process owner review and formal approval of production run
Process owner (Sales Manager) reviews the complete production run: Google Sheets output, Slack posts, Gmail delivery, Tableau dashboard, and the full orchestration run log
Process owner confirms the forecast output is accurate, the approval flow behaved correctly, and the distribution reached the intended destinations without error
Process owner verbally or in writing confirms acceptance of the production run to the FullSpec team. FullSpec records the outcome, the run log reference, and the date in the FullSpec confirmation log. This entry constitutes the formal go-live sign-off for the Sales Forecasting automation.
Once T27 is recorded in the FullSpec confirmation log, the automation is cleared for live operation. The FullSpec team will notify the process owner by email and provide the final runbook reference. For any post-launch queries, contact support@gofullspec.com.
Test and QA PlanPage 4 of 4