Analytics Recently Changed
Overview Tab
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-001 | Load Overview tab with default date range (last 7 days) | Logged in as Agent with analytics:read permission, WhatsApp account connected, conversation history exists | 1. Navigate to /analytics 2. Observe Overview tab is active by default 3. Check date range selector shows "7d" preset | Overview tab loads, Hero KPIs widget displays total messages, conversations, and automation stats for last 7 days. Message Volume Chart shows daily breakdown. Conversation Status donut and Automation Wins widget render without errors. Data sourced from analytics database via safe read-through to source database | High |
| ANA-002 | Load Overview tab with custom date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click date range selector 3. Click "Custom" option 4. Enter start date as 2026-01-01 5. Enter end date as 2026-03-31 6. Click Apply | Overview stats refresh to show data only for Jan-Mar 2026. Charts and KPIs update to reflect custom range. Date selector shows custom range label. Analytics repository queries both analytics_session and source_session | High |
| ANA-003 | Switch between date presets | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click date range selector 3. Select "Today" preset 4. Observe charts update 5. Click selector again and select "30d" 6. Observe charts update again | Each preset change triggers immediate data refresh. Charts update to reflect selected time period. No loading errors occur. Safe refresh queries source data when needed | High |
| ANA-004 | Widget visibility toggle persists on Overview tab | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Settings icon (gear) in Overview tab header 3. Toggle off "Message Volume Chart" widget 4. Close settings panel 5. Refresh page | Message Volume Chart remains hidden after page refresh. Widget Settings panel shows toggle state persists in localStorage. Other widgets remain visible | Medium |
| ANA-005 | Hide all widgets on Overview tab | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Settings icon 3. Toggle off all 4 widgets (Hero KPIs, Message Volume Chart, Conversation Status, Automation Wins) 4. Close panel | All widgets disappear from Overview tab. Empty state message appears: "No widgets selected. Open Widget Settings to show widgets." | Medium |
| ANA-006 | Re-enable hidden widgets on Overview tab | Logged in as Agent with analytics:read permission, all Overview widgets hidden | 1. Navigate to /analytics 2. Click Settings icon 3. Toggle on "Hero KPIs" widget 4. Toggle on "Message Volume Chart" widget 5. Close panel | Previously hidden widgets reappear in correct positions on Overview tab. Widget Settings panel reflects enabled state with toggle switches | Medium |
| ANA-007 | Overview tab loads with no conversation data | Logged in as Agent with analytics:read permission, no messages sent in date range | 1. Navigate to /analytics 2. Set date range to future dates (e.g., 2026-12-01 to 2026-12-31) 3. Observe Overview tab | Hero KPIs show 0 or "—" for metrics (Total Messages, Active Conversations, Automation Rate). Charts display empty state or flat lines. No error toasts appear | Medium |
| ANA-008 | Permission denied: User without analytics:read cannot access Overview | Logged in as user with no analytics:read permission | 1. Try to navigate to /analytics/overview | Redirected to /chat (or home). Analytics nav item hidden. API returns 403 if called directly | High |
Conversations Tab
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-009 | Load Conversations tab with Response Time KPIs | Logged in as Agent with analytics:read permission, conversations with response times logged | 1. Navigate to /analytics 2. Click Conversations tab 3. Set date range to last 30 days | Response Time KPIs widget displays Avg Response Time, 95th Percentile, and SLA Compliance % for selected date range. Conversation Volume Trend chart loads showing status breakdown (open, closed, pending). Data retrieved from analytics database | High |
| ANA-010 | Agent Performance Table displays all agents | Logged in as Admin with analytics:read permission, 3+ agents in org | 1. Navigate to /analytics 2. Click Conversations tab 3. Scroll to Agent Performance Table 4. Observe table rows | Table shows one row per agent with columns: Agent Name, Total Conversations, Response Time (avg), Conversations Resolved, Resolution Rate (%). Agents sorted by most conversations by default. Data fact-backed from source database | High |
| ANA-011 | Sort Agent Performance Table by column | Logged in as Agent with analytics:read permission, Agent Performance Table visible | 1. Navigate to /analytics → Conversations tab 2. Click "Response Time (avg)" column header | Agent rows re-sort ascending by response time (lowest first). Click again sorts descending (highest first). Sort indicator arrow appears on column header | Medium |
| ANA-012 | Team Rollup Table shows team-level metrics | Logged in as Agent with analytics:read permission, 2+ teams with assigned agents | 1. Navigate to /analytics 2. Click Conversations tab 3. Scroll to Team Rollup Table | Table displays one row per team with columns: Team Name, Total Conversations, Avg Response Time, Avg Resolution Time. Row totals match sum of agent rows from Agent Performance Table | High |
| ANA-013 | Filter Conversations tab by date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Conversations tab 3. Change date range from "7d" to "30d" 4. Observe tables and charts | Response Time KPIs, SLA Compliance Trend, Conversation Volume Trend, Agent Performance, and Team Rollup all refresh immediately. No page reload required. All data reflects selected 30-day range. Analytics repository safely reads from source when needed | High |
| ANA-014 | Resolution Time widget displays histogram | Logged in as Agent with analytics:read permission, resolved conversations exist | 1. Navigate to /analytics 2. Click Conversations tab 3. Scroll to Resolution Time widget | Bar chart renders showing number of conversations resolved in 0-1h, 1-4h, 4-24h, 24h+ buckets. Hover over bar shows exact count | Medium |
| ANA-015 | Conversations tab with no data in date range | Logged in as Agent with analytics:read permission, date range selected with no conversation activity | 1. Navigate to /analytics 2. Click Conversations tab 3. Set date range to future dates | All widgets display empty states or show "—" for metrics. No errors thrown. KPI cards show 0 or blank values | Medium |
| ANA-016 | SLA Compliance Trend line chart updates with date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Conversations tab 3. Set date range to "daily" period for last 7 days 4. Observe SLA Compliance Trend chart | Line chart shows one data point per day with SLA compliance percentage (0–100%). X-axis shows date labels. Trend line color changes based on overall compliance (green >95%, yellow 85–95%, red <85%). Data retrieved from analytics_session and source_session | Medium |
Bot Performance (Automation) Tab
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-017 | Load Automation tab with Automation KPIs | Logged in as Agent with analytics:read permission, flows exist and have been executed | 1. Navigate to /analytics 2. Click "Bot Performance" tab 3. Set date range to last 30 days | Automation KPIs widget displays: Total Bot Messages, Flow Completion Rate (%), Total Flows Executed, Automation Win Rate (%). AI vs Human Split donut chart renders showing percentage split. Data fact-backed from analytics repository | High |
| ANA-018 | Flow Performance Table displays all flows with execution stats | Logged in as Agent with analytics:read permission, 3+ flows with execution history | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Scroll to Flow Performance Table | Table shows one row per flow: Flow Name, Sessions, Completed, Dropped Off, Completion Rate (%). Default sorted by Dropped Off (highest first) to surface problem flows | High |
| ANA-019 | Sort Flow Performance Table by Completion Rate | Logged in as Agent with analytics:read permission, Flow Performance Table visible | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Click "Completion Rate" column header in Flow Performance Table | Flow rows sort by completion rate descending (worst performers first). Sort indicator arrow appears. Click again sorts ascending (best performers first) | Medium |
| ANA-020 | Sort Flow Performance Table alphabetically by flow name | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Click "Flow Name" column header in Flow Performance Table | Flows sort A–Z alphabetically. Click again sorts Z–A. Sort indicator shows direction | Medium |
| ANA-021 | Keyword Rule Leaderboard displays top keywords | Logged in as Agent with analytics:read permission, keyword rules with message matches exist | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Scroll to Keyword Rule Leaderboard | Table shows top 10 keywords by match count: Keyword, Matches, Response Flow, Success Rate (%). Sorted descending by match count | Medium |
| ANA-022 | Nurture Sequence Table shows sequence performance | Logged in as Agent with analytics:read permission, nurture sequences active | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Scroll to Nurture Sequence Table | Table displays: Sequence Name, Total Enrolled, Completed, Dropped, Completion Rate (%). Shows engagement metrics for automated nurture workflows | Medium |
| ANA-023 | Reminders Summary widget shows reminder stats | Logged in as Agent with analytics:read permission, reminders sent in date range | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Scroll to Reminders Summary widget | Widget displays Total Reminders Sent, Sent Rate (%), Completed (contacts who acted after reminder), Completion Rate (%). KPI cards with numeric values | Medium |
| ANA-024 | AI vs Human Split donut shows accurate percentages | Logged in as Agent with analytics:read permission, mixed bot and human messages in history | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Set date range to capture both bot and human traffic 4. Observe donut chart | Donut shows 3 segments: AI (blue), Bot/Flow (green), Human (gray) with percentages adding to 100%. Hover shows exact message counts. Legend identifies each segment | High |
| ANA-025 | Automation tab with no flow executions | Logged in as Agent with analytics:read permission, no flows run in selected date range | 1. Navigate to /analytics 2. Click Bot Performance tab 3. Set date range to future with no activity | Flow Performance Table shows "No flows executed in this period." Keyword Leaderboard empty. Automation KPIs show 0 or "—". No error toast | Medium |
Campaigns Tab
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-026 | Load Campaigns tab with Campaign KPIs | Logged in as Agent with analytics:read permission, broadcast/campaign messages sent | 1. Navigate to /analytics 2. Click Campaigns tab 3. Set date range to last 30 days | Campaign KPIs widget displays: Total Sent, Delivery Rate (%), Read Rate (%), Failed Rate (%). Delivery Funnel visualization shows sent → delivered → read flow with conversion percentages. Data retrieved via analytics_read_repository | High |
| ANA-027 | Campaign Performance Table displays all campaigns | Logged in as Agent with analytics:read permission, 3+ campaigns with delivery history | 1. Navigate to /analytics 2. Click Campaigns tab 3. Scroll to Campaign Performance Table | Table shows one row per campaign: Campaign Name, Sent, Delivered, Read, Failed, Delivery Rate (%), Read Rate (%). Campaigns listed in descending order by sent count | High |
| ANA-028 | Delivery Funnel shows conversion percentages | Logged in as Agent with analytics:read permission, campaigns with message stats | 1. Navigate to /analytics 2. Click Campaigns tab 3. Observe Delivery Funnel visualization | Funnel displays 4 stages: Sent (100%), Delivered (e.g., 95%), Read (e.g., 42%), Failed (e.g., 3%). Each stage shows count and percentage of previous stage. Color coding: green for success, red for failed | High |
| ANA-029 | Delivery Trend line chart shows daily delivery performance | Logged in as Agent with analytics:read permission, campaigns sent over 7+ days | 1. Navigate to /analytics 2. Click Campaigns tab 3. Set date range to last 7 days 4. Scroll to Delivery Trend chart | Line chart displays 3 lines: Delivered (green), Read (blue), Failed (red) by date. X-axis shows day labels, Y-axis shows message count. Hover shows exact values. Period parameter sent to analytics_read_repository | Medium |
| ANA-030 | Template Performance Table ranks templates by engagement | Logged in as Agent with analytics:read permission, 5+ templates used in campaigns | 1. Navigate to /analytics 2. Click Campaigns tab 3. Scroll to Template Performance Table | Table shows: Template Name, Used Count, Delivered, Read, Delivery Rate (%), Read Rate (%). Sorted descending by Read Rate (best performers first) | High |
| ANA-031 | Filter Campaign metrics by date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Campaigns tab 3. Change date range from "7d" to "month" 4. Observe KPIs and tables refresh | All campaign metrics (KPIs, funnel, performance table, trend, template performance) refresh without page reload. Data reflects selected month only. Analytics repository queries source database safely | High |
| ANA-032 | Campaigns tab with no campaign activity | Logged in as Agent with analytics:read permission, no campaigns sent in date range | 1. Navigate to /analytics 2. Click Campaigns tab 3. Set date range to future with no activity | Campaign Performance Table shows "No campaigns in this period." Template Performance Table empty. KPIs show 0 or "—". Delivery Funnel shows 0 for all stages | Medium |
| ANA-033 | Sort Campaign Performance Table by Delivery Rate | Logged in as Agent with analytics:read permission, Campaign Performance Table visible | 1. Navigate to /analytics 2. Click Campaigns tab 3. Click "Delivery Rate" column header | Campaigns sort descending by delivery rate (best performers first). Click again sorts ascending. Sort indicator appears on header | Medium |
Contacts Tab
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-034 | Load Contacts tab with Contact KPIs | Logged in as Agent with analytics:read permission, contacts imported/created | 1. Navigate to /analytics 2. Click Contacts tab 3. Set date range to last 30 days | Contact KPIs widget displays: Total Contacts, Active Contacts (opt-in), Opt-out Rate (%), New Contacts (in period). Contact Growth Chart loads showing cumulative contact count over time. Data fact-backed via analytics_read_repository | High |
| ANA-035 | Contact Growth Chart displays cumulative growth | Logged in as Agent with analytics:read permission, contact history spanning 30+ days | 1. Navigate to /analytics 2. Click Contacts tab 3. Set date range to last 30 days 4. Scroll to Contact Growth Chart | Line chart shows cumulative contact count ascending over time. X-axis shows dates, Y-axis shows total contact count. No data gaps unless no activity on specific days | High |
| ANA-036 | Opt-in/Opt-out Trend chart shows daily changes | Logged in as Agent with analytics:read permission, contacts with opt-in/opt-out history | 1. Navigate to /analytics 2. Click Contacts tab 3. Set date range to 30 days 4. Scroll to Opt-in/Opt-out Trend | Stacked bar chart shows daily opt-in count (green) and opt-out count (red). X-axis shows dates. Tooltip shows exact counts per day. Net growth calculated. Analytics repository queries source_session | Medium |
| ANA-037 | Contact Source Breakdown donut shows channel distribution | Logged in as Agent with analytics:read permission, contacts from multiple sources (manual, import, form, API) | 1. Navigate to /analytics 2. Click Contacts tab 3. Scroll to Contact Source Breakdown | Donut chart segments show: Manual Add, CSV Import, Web Form, API, WhatsApp, etc. with percentages. Hover shows exact contact count per source. Legend identifies sources | High |
| ANA-038 | Tag Distribution widget shows most-used tags | Logged in as Agent with analytics:read permission, contacts tagged with multiple tags | 1. Navigate to /analytics 2. Click Contacts tab 3. Scroll to Tag Distribution widget | Bar chart or list displays top 10 tags by contact count: Tag Name, Contact Count. Sorted descending by usage. Shows tag adoption across database | Medium |
| ANA-039 | Assignment Coverage shows agent-to-contact ratio | Logged in as Agent with analytics:read permission, agents assigned to contacts | 1. Navigate to /analytics 2. Click Contacts tab 3. Scroll to Assignment Coverage widget | Widget displays: Assigned Contacts, Unassigned Contacts, Assignment Coverage (%). Pie chart shows ratio. Identifies coverage gaps if >20% unassigned | Medium |
| ANA-040 | Filter Contacts metrics by date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Contacts tab 3. Change date range to "month" 4. Observe KPIs and charts refresh | Contact KPIs, Growth Chart, Opt-in/Opt-out Trend, and other widgets refresh without reload. Data reflects new date range. Analytics repository performs safe read from source | High |
| ANA-041 | Contacts tab with no contacts in org | Logged in as Agent with analytics:read permission, zero contacts created | 1. Navigate to /analytics 2. Click Contacts tab | Contact KPIs show 0 for all metrics. Growth Chart flat line at 0. Other charts display empty states. Message appears: "No contacts yet. Import or create contacts to get started." | Medium |
| ANA-042 | Export Contacts analytics (if feature exists) | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Contacts tab 3. Look for Export button | If export button exists: clicking exports data as CSV or PDF. File downloads with timestamp in filename (e.g., contacts_analytics_2026-04-17.csv). Success toast shown | Low |
Leads Tab
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-075 | Load Leads tab with agent lead performance metrics | Logged in as Agent with analytics:read permission, lead pipeline exists with agent assignments | 1. Navigate to /analytics 2. Click Leads tab 3. Observe metrics load | Agent Lead Performance widget displays fact-backed metrics for each agent: Leads Assigned, Leads Converted, Conversion Rate (%), Avg Lead Value, Pipeline Value. Tab loads without errors. Data retrieved from analytics_read_repository | High |
| ANA-076 | Lead Performance widget shows per-agent metrics | Logged in as Agent with analytics:read permission, 3+ agents with lead assignments | 1. Navigate to /analytics 2. Click Leads tab 3. Scroll to Agent Lead Performance table | Table displays one row per agent: Agent Name, Leads Assigned, New Leads (in period), Leads Qualified, Leads Converted, Conversion Rate (%), Pipeline Value, Avg Deal Size. Sorted by Leads Assigned by default. Facts sourced from source database | High |
| ANA-077 | Pipeline Health donut shows lead stage distribution | Logged in as Agent with analytics:read permission, leads in multiple pipeline stages | 1. Navigate to /analytics 2. Click Leads tab 3. Observe Pipeline Health widget | Donut chart displays segments for each lead stage (e.g., New, Qualified, Negotiation, Closed Won, Closed Lost) with count and percentage. Hover shows stage name and exact lead count. Legend identifies all stages | High |
| ANA-078 | Work Queue widget shows leads requiring action | Logged in as Agent with analytics:read permission, overdue or stalled leads exist | 1. Navigate to /analytics 2. Click Leads tab 3. Scroll to Work Queue widget | Widget displays actionable leads: Overdue Leads count, Stalled Leads count (no activity >X days), Leads Due Today count. Each with action button linking to lead detail or CRM view | High |
| ANA-079 | Lead drilldown table shows individual leads by stage | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Leads tab 3. Click on a stage donut segment or view drilldown table 4. Select stage filter | Table displays individual leads in selected stage: Lead Name, Agent, Company, Value, Days in Stage, Last Activity. Paginated if >25 leads. Shows current stage mode by default. Data from AgentLeadDrilldownResponse | High |
| ANA-080 | Lead stage transition view shows lead movement | Logged in as Agent with analytics:read permission, leads with status history | 1. Navigate to /analytics 2. Click Leads tab 3. Toggle "Transition Mode" or similar on drilldown | Table shifts to show leads moved between stages in date range: From Stage, To Stage, Lead Name, Agent, Transition Date, Count of moves. Reveals bottlenecks and progression patterns | Medium |
| ANA-081 | Filter Leads tab by date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Leads tab 3. Change date range from "7d" to "30d" 4. Observe all metrics refresh | Agent Lead Performance table, Pipeline Health, Work Queue, and drilldown all update to reflect 30-day range. No page reload. Metrics recalculate based on new date range. Analytics repository queries source safely | High |
| ANA-082 | Filter Leads by specific agent | Logged in as Agent with analytics:read permission, 3+ agents in org | 1. Navigate to /analytics 2. Click Leads tab 3. Click agent filter dropdown or select agent row 4. Choose specific agent | All metrics (Pipeline Health, Work Queue, drilldown) filter to show only that agent's leads. Donut shows only their stages. Work Queue shows their overdue leads. Breadcrumb or label shows applied filter | Medium |
| ANA-083 | Lead metrics show zero when no leads assigned | Logged in as Agent with analytics:read permission, zero leads in pipeline | 1. Navigate to /analytics 2. Click Leads tab 3. Observe all widgets | Agent Lead Performance table shows agents with 0 leads or hides rows. Pipeline Health donut flat (0 leads). Work Queue shows "No overdue or stalled leads." No errors. Empty state message: "No leads in pipeline yet" | Medium |
| ANA-084 | Leads Tab permission check: analyst without analytics:read cannot access | Logged in as user without analytics:read permission | 1. Try to navigate to /analytics and click Leads tab OR 2. Try to access /analytics/v1/agents/leads/performance | Either: (a) Leads tab hidden/disabled, or (b) 403 Forbidden error with toast "You don't have permission to view lead analytics" | High |
| ANA-085 | Leads tab shows only org's lead data (multi-tenant isolation) | Logged in as Agent in Org A with analytics:read permission | 1. Navigate to /analytics 2. Click Leads tab 3. Check all displayed leads and agent assignments | All leads displayed belong to Org A only. No leads from Org B visible. Agent rows show only Org A's agents. Data filtered by org_id at API and UI level | High |
| ANA-086 | Agent Lead Performance sorts by column | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Leads tab 3. Click "Conversion Rate (%)" column header in Agent Lead Performance table | Table re-sorts by conversion rate ascending. Click again sorts descending. Sort indicator arrow shows direction. Column header highlights | Medium |
| ANA-087 | Lead drilldown pagination works | Logged in as Agent with leads in single stage totaling >25 | 1. Navigate to /analytics 2. Click Leads tab 3. View drilldown table for a stage 4. Observe pagination controls 5. Click "Next" or page 2 | Table shows max 25 leads per page. Pagination controls (< prev, page numbers, next >) appear at bottom. Clicking next loads next page without full reload. Total count shown: "Showing 26-50 of 127 leads" | Medium |
| ANA-088 | Lead drilldown supports sorting and filtering | Logged in as Agent with leads in multiple stages | 1. Navigate to /analytics 2. Click Leads tab 3. Open drilldown for a stage 4. Try clicking "Agent" column header to sort 5. Look for filter options | Drilldown table sorts by any column (Lead Name, Agent, Value, Days in Stage, etc.). Click again reverses order. Column header highlights. Optional: inline filter textbox allows search by lead name | Medium |
| ANA-089 | Pipeline Health donut color-codes stages by health | Logged in as Agent with leads in all pipeline stages, some stalled | 1. Navigate to /analytics 2. Click Leads tab 3. Observe Pipeline Health donut colors | Donut segments color-coded by health: green for high conversion stages (Negotiation, Won), yellow for middle (Qualified), red for stalled/lost. Tooltip on hover explains color coding | Low |
| ANA-090 | Work Queue leads are actionable (link to lead detail) | Logged in as Agent with Leads tab visible, overdue leads exist | 1. Navigate to /analytics 2. Click Leads tab 3. In Work Queue, click "Overdue Leads" count or lead name if listed 4. Observe navigation | Clicking overdue count opens /crm or /leads page filtered by "Overdue" status. Lead names (if shown as list) link to individual lead detail pages. Action is clear and reduces friction | High |
| ANA-091 | Pipeline Health accepts date range parameters | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click Leads tab 3. Check Network tab and call GET /analytics/v1/agents/leads/pipeline-health with start_date=2026-01-01 and end_date=2026-03-31 | Request includes start_date and end_date query parameters. Response shows Pipeline Health data filtered to the specified date range. API call completes with status 200 | Medium |
| ANA-092 | Work Queue respects date range filters | Logged in as Agent with analytics:read permission, leads with dates in different ranges | 1. Navigate to /analytics 2. Click Leads tab 3. Verify Work Queue widget respects selected date range 4. Change date range and observe Work Queue update | Work Queue metrics (Overdue, Stalled, Due Today) recalculate based on selected date range. Counts change when date range changes. No page reload required. API call includes start_date and end_date params | High |
Date Range & Refresh Controls
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-043 | Refresh button updates all analytics data | Logged in as Agent with analytics:read permission, on any analytics tab | 1. Navigate to /analytics 2. Wait 30 seconds 3. Click Refresh button (circular arrow icon) if visible | All widgets and charts reload immediately. Loading spinner appears briefly. Data refreshes to latest values. Timestamp shows refresh time. Safe refresh queries source database through analytics_read_repository | Medium |
| ANA-044 | URL path persists selected tab | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics/campaigns 2. Refresh page 3. Use browser back/forward after visiting another tab | Campaigns tab remains selected after refresh. URL is /analytics/campaigns (not query params). Legacy /analytics?tab=campaigns redirects to /analytics/campaigns | Medium |
| ANA-045 | URL query parameter persists date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics?start=2026-01-01&end=2026-03-31 2. Refresh page | Custom date range persists in URL and UI. Charts show data for specified range. URL parameters remain intact. Analytics repository queries respect date boundaries | Low |
| ANA-046 | Preset date change updates all tabs | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Go to Overview tab 3. Change date range to "30d" 4. Click to Conversations tab | Date range "30d" is applied to Conversations tab as well. All tabs share the same date range state. Change in one tab applies globally. Analytics repository queries reflect shared date range | High |
| ANA-047 | Manual date picker validates end date after start date | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click date range selector 3. Select Custom 4. Enter start: 2026-03-01 5. Enter end: 2026-02-01 (before start) 6. Click Apply | Error message appears: "End date must be after start date." Apply button remains disabled. Date range not applied | Medium |
| ANA-048 | Manual date picker limits maximum range to 365 days | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Click date range selector 3. Select Custom 4. Enter start: 2025-01-01 5. Enter end: 2026-04-17 (>365 days) 6. Click Apply | Warning or info message appears: "Date range is limited to 365 days." Dates auto-adjust to fit limit, or Apply button disables. Final range ≤365 days | Low |
| ANA-091 | Message volume endpoint accepts custom date range parameters | Logged in as Agent with analytics:read permission | 1. Open browser DevTools Network tab 2. Navigate to /analytics 3. Click Overview or Bot Performance tab with custom date range 4. Check GET /analytics/message-volume request | Request includes ?start_date=2026-01-01&end_date=2026-03-31 query parameters (or equivalent). Response status 200. Data reflects custom date range, not days parameter. Message Volume Chart updates to selected range | Medium |
| ANA-092 | Message volume endpoint respects period parameter with date range | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Change date range to custom: 2026-03-01 to 2026-04-17 3. Click Overview or Bot Performance 4. Check Network tab for message_volume call | GET /analytics/message-volume includes ?period=daily&start_date=2026-03-01&end_date=2026-04-17. Response returns daily aggregation within custom range. Charts render daily data points for the specified range | Medium |
Analytics Freshness & Data Trust
| ID | Test Case | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| ANA-093 | Analytics Freshness endpoint returns data freshness timestamp | Logged in as Agent with analytics:read permission | 1. Open browser DevTools Network tab 2. Navigate to /analytics 3. Observe Network tab for GET /analytics/freshness request | Request to /analytics/freshness completes with status 200. Response includes AnalyticsFreshnessResponse with last_refresh_time and freshness_indicator (e.g., "fresh", "stale", "pending"). Data retrieved from analytics_session | High |
| ANA-094 | Analytics freshness indicator displays in UI | Logged in as Agent with analytics:read permission | 1. Navigate to /analytics 2. Look for freshness badge or indicator (usually in header or near Refresh button) | Freshness indicator shows: "Last updated 5 minutes ago" or similar. Color-coded: green (fresh <1h), yellow (stale 1-24h), red (stale >24h). Clicking indicator shows full timestamp in ISO format | High |
| ANA-095 | Freshness updates after manual refresh | Logged in as Agent with analytics:read permission, on any analytics tab | 1. Navigate to /analytics 2. Note freshness timestamp 3. Click Refresh button 4. Observe freshness indicator update | Freshness indicator updates to show current time (e.g., "just now" or "1 minute ago"). Fresh indicator color (green) appears. Timestamp in seconds precision shows refresh happened | High |