-
Notifications
You must be signed in to change notification settings - Fork 0
Testing‐Guide
Comprehensive guide to testing BizGrow v1.3.3, including the enhanced testing suite, manual testing procedures, and quality assurance practices.
BizGrow includes a comprehensive testing framework designed to ensure reliability and quality across all features, with special focus on the new v1.3.3 functionality.
- Comprehensive Coverage - 25+ automated tests covering all major functionality
- User-Centric - Tests focus on real user scenarios and workflows
- Performance Aware - Tests include performance benchmarks and memory usage
- Developer Friendly - Easy-to-use testing tools and clear feedback
-
Start Development Server
npm run dev
-
Access Test Runner
- Navigate to Dashboard page
- Click green "Test Suite" button next to "Manage Data"
- TestRunner dialog appears in bottom-right corner
-
Run Tests
- Select test type from dropdown
- Click "Run Tests" button
- View results in console and dialog
// Open browser console (F12) and run:
// Full comprehensive test suite
window.BizGrowTestSuite.runAllTests()
// Quick essential tests
window.BizGrowTestSuite.quickTest()
// Individual test categories
window.BizGrowTestSuite.testMultiSelection()
window.BizGrowTestSuite.testModalSystem()
window.BizGrowTestSuite.testIdManagement()
window.BizGrowTestSuite.testPerformance()
window.BizGrowTestSuite.testVersionSynchronization()
// Debug and utilities
window.BizGrowTestSuite.debugState()
window.BizGrowTestSuite.exportResults()Tests the core v1.3.3 multi-selection functionality:
window.BizGrowTestSuite.testMultiSelection()What it tests:
- Set-based selection logic preventing duplicates
- ID normalization (string vs number handling)
- Toggle selection functionality
- Select All/Deselect All operations
- Selection state persistence
Expected Results:
- ✅ Set prevents duplicate selections
- ✅ ID normalization works correctly
- ✅ Toggle selection maintains proper state
- ✅ Select All functionality works as expected
Tests the professional UI modal system:
window.BizGrowTestSuite.testModalSystem()What it tests:
- Modal state management (open/close)
- Props generation for different modal types
- State reset functionality
- Event handling
Expected Results:
- ✅ Modals open and close correctly
- ✅ State is properly managed
- ✅ Props are generated correctly for different modal types
Tests data integrity and ID uniqueness:
window.BizGrowTestSuite.testIdManagement()What it tests:
- Duplicate ID detection in datasets
- ID uniqueness enforcement
- Sequential ID generation
- Data migration and fixing
Expected Results:
- ✅ Duplicate IDs are detected
- ✅ ID uniqueness is enforced
- ✅ Sequential ID generation works correctly
Tests application performance and scalability:
window.BizGrowTestSuite.testPerformance()What it tests:
- Large dataset generation (1000+ items)
- Set operations performance
- Memory usage estimation
- Operation timing benchmarks
Expected Results:
- ✅ Large datasets generated quickly (<100ms for 1000 items)
- ✅ Set operations are efficient (<50ms for 1000 operations)
- ✅ Memory usage is reasonable
Tests automatic version management:
window.BizGrowTestSuite.testVersionSynchronization()What it tests:
- DataStore version accessibility
- Semantic versioning format compliance
- Version source identification (package.json vs fallback)
- Version info method functionality
Expected Results:
- ✅ Version is accessible and properly formatted
- ✅ Version source is correctly identified
- ✅ Version info methods work correctly
🧪 [12:34:56] Testing Multi-Selection Functionality...
✅ [12:34:56] PASS: Set-based selection prevents duplicates
✅ [12:34:56] PASS: ID normalization works correctly
✅ [12:34:56] PASS: Toggle selection works correctly
✅ [12:34:56] Multi-Selection tests completed
📋 TEST SUITE SUMMARY
==========================================
✅ Passed: 23
❌ Failed: 0
📊 Total: 23
⏱️ Duration: 2.45s
📈 Success Rate: 100%
- ✅ All tests passing - Application is stable and ready
- 📈 100% success rate - No critical issues detected
- ⚡ Fast execution - Performance is optimal (<5 seconds total)
⚠️ Some tests failing - Investigate specific failures- 🐛 Performance degradation - Tests taking longer than expected
- 💾 High memory usage - Potential memory leaks detected
-
Add Customer
- Fill out customer form with valid data
- Submit and verify customer appears in list
- Check data persistence after page refresh
-
Edit Customer
- Click edit button on existing customer
- Modify information and save
- Verify changes are reflected
-
Delete Customer
- Click delete button
- Confirm deletion in modal
- Verify customer is removed
-
Add Revenue/Expense
- Navigate to Reports page
- Add new revenue or expense entry
- Verify data appears correctly
-
Multi-Selection Operations
- Click "Select Multiple"
- Select individual items using checkboxes
- Test "Select All" functionality
- Perform bulk delete operation
-
CSV Import
- Click "Manage Data" button
- Upload CSV file with test data
- Verify data is imported correctly
- Check for proper data type detection
-
Data Export
- Export data in JSON and CSV formats
- Verify exported files contain correct data
- Test import of exported data
-
Confirmation Modals
- Trigger delete operations
- Verify custom modals appear (not browser alerts)
- Test modal animations and interactions
- Confirm proper button functionality
-
Toast Notifications
- Perform various operations
- Verify toast notifications appear
- Check auto-dismiss functionality
- Test different toast types (success, error, warning)
-
Desktop Testing
- Test on different screen sizes (1920x1080, 1366x768)
- Verify layout adapts properly
- Check all functionality works
-
Mobile Testing
- Test on mobile devices or browser dev tools
- Verify touch interactions work
- Check responsive layout
// Check application state
window.BizGrowTestSuite.debugState()
// Check DataStore version info
window.dataStore.getVersionInfo()
// Check localStorage usage
window.BizGrowTestSuite.getStorageUsage()
// Export test results for bug reports
window.BizGrowTestSuite.exportResults()- Refresh the page - Clear any state issues
- Check browser console - Look for JavaScript errors
- Clear localStorage - Remove corrupted data
- Update browser - Ensure modern browser support
- Close other tabs - Free up memory
- Restart browser - Clear memory leaks
- Check system resources - Ensure adequate RAM
- Run individual tests - Isolate performance issues
// Check if test suite is loaded
if (typeof window.BizGrowTestSuite === 'undefined') {
console.error('Test suite not loaded. Refresh the page.');
}| Test Category | Expected Duration | Memory Usage | Items Tested |
|---|---|---|---|
| Multi-Selection | <1s | <10MB | 1000 items |
| Modal System | <0.5s | <5MB | All modal types |
| ID Management | <0.5s | <5MB | 1000 IDs |
| Performance | <2s | <20MB | Large datasets |
| Version Sync | <0.1s | <1MB | Version info |
// Monitor test execution time
const startTime = performance.now();
await window.BizGrowTestSuite.runAllTests();
const duration = performance.now() - startTime;
console.log(`Tests completed in ${duration.toFixed(2)}ms`);
// Monitor memory usage
const memoryInfo = performance.memory;
console.log('Memory usage:', {
used: Math.round(memoryInfo.usedJSHeapSize / 1024 / 1024) + 'MB',
total: Math.round(memoryInfo.totalJSHeapSize / 1024 / 1024) + 'MB'
});-
Identify Test Need
- New feature requiring testing
- Bug that needs regression testing
- Performance concern
-
Write Test Function
testNewFeature() { this.log('🧪 Testing New Feature...', 'info'); // Test implementation const result = performTestOperation(); this.assert( result === expectedValue, 'New feature works correctly', `Expected ${expectedValue}, got ${result}` ); this.log('✅ New Feature tests completed', 'success'); }
-
Add to Test Suite
- Add to
runAllTests()method - Add to global window object
- Update documentation
- Add to
- Clear Names - Test names should describe what they test
- Isolated Tests - Tests should not depend on each other
- Comprehensive Assertions - Test both positive and negative cases
- Performance Aware - Include timing and memory considerations
- Good Logging - Provide clear feedback about test progress
If you encounter testing issues:
- Check Documentation - Review this guide thoroughly
- Run Debug Commands - Use built-in debugging tools
- Export Results - Generate detailed test reports
- Search Issues - Look through GitHub Issues
- Create Issue - Report bugs with test results attached
- Community Support - Ask in Discord
Related Documentation:
- Multi-Selection System - Testing multi-selection features
- API Reference - Technical implementation details
- Troubleshooting - Common issues and solutions