- Merge tests/e2e/ into test/e2e/ (single test directory) - Update backend/jest.config.js for new test path - Archive 4 duplicate GitHub issues docs to docs/archive/issues/ - Archive 6 completed plan files to docs/archive/plans/ - Add SECURITY.md
8.5 KiB
E2E Test Specification - Analytics Module
Module: Analytics Test Suite: Frontend Version: 2.0 Status: Active
1. Test Overview
This specification defines end-to-end tests for the Analytics module, covering charts, summaries, and data visualization.
2. Test Scenarios
2.1. View Analytics
ID: T-001 Priority: Must Type: Smoke
Steps
- Navigate to "Analytics" module
- Verify dashboard displays
- Verify summary cards
Validation
- Analytics page renders
- Summary cards visible
- Charts present
- Period selector visible
Expected Result
User sees analytics dashboard.
2.2. Change Date Range
ID: T-002 Priority: Must Type: Positive
Steps
- Click period selector
- Select "This Week"
- Verify charts update
- Verify summary updates
Validation
- Period selector works
- Charts update
- Summary numbers update
- Tooltip shows date range
Expected Result
Date range changes work.
2.3. View Spending by Category
ID: T-003 Priority: Must Type: Positive
Steps
- Navigate to Analytics
- View spending by category chart
- Verify chart renders
- Verify labels
Validation
- Chart visible
- Labels correct
- Data matches transactions
- Interactive tooltips
Expected Result
Spending by category chart works.
2.4. View Income vs Expense
ID: T-004 Priority: Must Type: Positive
Steps
- Navigate to Analytics
- View income vs expense chart
- Verify line chart
- Verify totals
Validation
- Chart visible
- Income line correct
- Expense line correct
- Net flow shown
Expected Result
Income vs expense chart works.
2.5. View Cash Flow Trend
ID: T-005 Priority: Must Type: Positive
Steps
- Navigate to Analytics
- View cash flow trend chart
- Verify chart renders
- Verify dates
Validation
- Chart visible
- Dates correct
- Values correct
- Interactive hover
Expected Result
Cash flow trend chart works.
2.6. View Budget Progress
ID: T-006 Priority: Must Type: Positive
Steps
- Navigate to Analytics
- View budget progress chart
- Verify chart renders
- Verify progress indicators
Validation
- Chart visible
- Budget amounts correct
- Current spending shown
- Remaining shown
Expected Result
Budget progress chart works.
2.7. Export Report
ID: T-007 Priority: Should Type: Positive
Steps
- Click export button
- Select format (CSV)
- Verify download
Validation
- Export options visible
- File downloads
- File contains data
- Date range included
Expected Result
Report export works.
2.8. Change Chart Type
ID: T-008 Priority: Should Type: Positive
Steps
- Click chart type selector
- Change to different type
- Verify chart updates
Validation
- Type selector visible
- Chart updates
- New type renders
- Old data visible
Expected Result
Chart type changes work.
2.9. Mobile Responsive
ID: T-009 Priority: Must Type: Visual
Steps
- Resize to mobile
- Navigate to Analytics
- Verify layout
Validation
- Layout responsive
- Charts scrollable
- Summary readable
- Controls accessible
Expected Result
Analytics work on mobile.
2.10. Empty State
ID: T-010 Priority: Must Type: Visual
Steps
- Navigate with no data
- Verify empty state
Validation
- Empty message visible
- Illustration present
- "Add Data" call to action
Expected Result
Empty state displays appropriately.
2.11. Toast Notifications
ID: T-011 Priority: Must Type: Visual
Steps
- Export report
- Verify toast
Validation
- Toast appears
- Success message
- Auto-dismisses
Expected Result
Toast notification displayed.
3. Negative Test Scenarios
3.1. Invalid Period
ID: T-N001 Priority: Should Type: Negative
Steps
- Try to select invalid period
- Verify error
Expected Result
Error for invalid period.
3.2. No Data for Period
ID: T-N002 Priority: Should Type: Negative
Steps
- Select period with no data
- Verify empty state
Expected Result
Empty state shows when no data.
3.3. Network Error
ID: T-N003 Priority: Should Type: Negative
Steps
- Simulate network failure
- Try to load analytics
- Verify error
Expected Result
Error displayed.
3.4. Invalid Export Format
ID: T-N004 Priority: Should Type: Negative
Steps
- Try invalid export format
- Verify error
Expected Result
Invalid format rejected.
4. Integration Tests
4.1. Analytics and Transactions
ID: T-I001 Priority: Must Type: Integration
Steps
- Create transactions
- Navigate to Analytics
- Verify charts include transactions
- Verify totals match
Validation
- Charts reflect transactions
- Totals accurate
- Dates correct
Expected Result
Analytics reflects transactions.
4.2. Analytics and Accounts
ID: T-I002 Priority: Should Type: Integration
Steps
- Create accounts
- Create transactions
- View analytics
- Verify account totals
Validation
- Account breakdown shown
- Totals correct
- Charts include account data
Expected Result
Analytics includes account data.
4.3. Analytics and Budgets
ID: T-I003 Priority: Should Type: Integration
Steps
- Create budgets
- Create transactions
- View analytics
- Verify budget progress
Validation
- Budget progress shown
- Current spending calculated
- Over-budget indicators
Expected Result
Analytics shows budget progress.
4.4. Analytics and Dashboard
ID: T-I004 Priority: Should Type: Integration
Steps
- Update data
- View Dashboard
- Verify totals match analytics
Validation
- Dashboard totals match
- Data consistency maintained
- Real-time updates
Expected Result
Analytics and Dashboard are consistent.
4.5. Charts Update Real-Time
ID: T-I005 Priority: Should Type: Integration
Steps
- View Analytics
- Create transaction
- Verify charts update
- Verify summary updates
Validation
- Charts update immediately
- Totals updated
- No page refresh needed
Expected Result
Charts update in real-time.
5. Performance Tests
5.1. Load Speed
ID: T-P001 Priority: Must Type: Performance
Steps
- Navigate to Analytics
- Measure load time
- Verify meets 2s threshold
Expected Result
Page loads within 2 seconds.
5.2. Chart Rendering
ID: T-P002 Priority: Must Type: Performance
Steps
- Change date range
- Measure chart render time
- Verify meets 300ms
Expected Result
Charts render quickly.
5.3. Filter Performance
ID: T-P003 Priority: Should Type: Performance
Steps
- Apply filter
- Measure response
- Verify meets 500ms
Expected Result
Filter responds quickly.
6. Accessibility Tests
6.1. Keyboard Navigation
ID: T-A001 Priority: Must Type: Accessibility
Steps
- Navigate with Tab
- Test controls
Validation
- Tab moves through items
- Buttons accessible
- Period selector accessible
Expected Result
Full keyboard navigation.
6.2. Chart Accessibility
ID: T-A002 Priority: Should Type: Accessibility
Steps
- Test charts with screen reader
- Verify announcements
Validation
- Chart type announced
- Data points announced
- Hover details announced
Expected Result
Charts are accessible.
7. Cross-Browser Tests
7.1. Browser Compatibility
ID: T-C001 Priority: Must Type: Cross-Browser
Steps
- Test in Chrome, Firefox, Safari, Edge
- Verify behavior
Validation
- All browsers work
- No console errors
- Charts render correctly
Expected Result
Works across browsers.
8. Acceptance Criteria
- All Must scenarios pass
- At least 80% of Should scenarios pass
- Performance targets met
- Accessibility requirements met
- No critical bugs
9. Test Execution Notes
- Test with various date ranges
- Test with large datasets
- Verify chart interactions
- Test export functionality
10. Dependencies
- Backend /api/analytics must be operational
- Backend /api/transactions data source
- Backend /api/budgets data source
- Auth system must be functional