Skip to content

πŸ§ͺ Auto-Download System Testing Guide

Version: 1.0 Date: September 2024

Overview

This guide provides comprehensive testing procedures for the Printernizer Auto-Download System. Follow these steps to verify that all components are working correctly.

πŸ”§ Pre-Testing Setup

1. System Requirements

  • βœ… Frontend: All new JavaScript files loaded in index.html
  • βœ… Backend: API endpoints implemented (download and thumbnail processing)
  • βœ… Printers: At least one Bambu Lab A1 or Prusa Core One configured
  • βœ… Network: Stable connection to printers

2. Verification Checklist

Before testing, verify these files are present:

frontend/js/
β”œβ”€β”€ auto-download-manager.js
β”œβ”€β”€ download-queue.js
β”œβ”€β”€ thumbnail-queue.js
β”œβ”€β”€ download-logger.js
β”œβ”€β”€ auto-download-ui.js
└── auto-download-init.js

frontend/assets/
└── placeholder-thumbnail.svg

3. Browser Console Setup

Open browser DevTools and enable all console levels (Debug, Info, Warn, Error).


πŸš€ Testing Procedures

Phase 1: System Initialization Testing

Test 1.1: Basic System Startup

  1. Open Printernizer dashboard in browser
  2. Check console for initialization messages:
    πŸš€ Starting Auto-Download System initialization...
    πŸ“‹ Initializing core components...
    πŸ€– Initializing Auto-Download Manager...
    πŸ–₯️ Initializing UI components...
    βœ… Auto-Download System initialization complete
    
  3. Expected Result: Green success toast "Auto-Download System is now active"

Test 1.2: Component Availability

Run in browser console:

// Check global objects exist
console.log('AutoDownloadManager:', !!window.autoDownloadManager);
console.log('DownloadQueue:', !!window.downloadQueue);
console.log('ThumbnailQueue:', !!window.thumbnailQueue);
console.log('DownloadLogger:', !!window.downloadLogger);
Expected Result: All should return true

Test 1.3: System Status Verification

// Check system status
window.autoDownloadSystemInitializer.getSystemStatus()
Expected Result: Object with status: 'active' and component details


Phase 2: Dashboard Integration Testing

Test 2.1: Status Card Display

  1. Navigate to Dashboard
  2. Look for Auto-Download Status Card (blue gradient)
  3. Verify status indicator shows green (online) or red (offline)
  4. Check status text shows queue information

Test 2.2: Management Panel Access

  1. Click "βš™οΈ Verwalten" button on status card
  2. Verify management modal opens
  3. Check tabs: Downloads, Thumbnails, History
  4. Verify system overview shows correct statistics

Test 2.3: Placeholder Images

  1. Navigate through dashboard
  2. Check all missing thumbnails show placeholder image
  3. Verify placeholder shows "Keine Vorschau verfΓΌgbar"
  4. Test placeholder hover effects work

Phase 3: Download Queue Testing

Test 3.1: Manual Download Trigger

  1. Go to Dashboard with active printers
  2. Click πŸ–ΌοΈ button on any printer card
  3. Check console for download task messages:
    πŸ“‹ Added download task: manual_printer_123... (manual, priority: normal)
    πŸ”„ Processing download: manual_printer_123...
    
  4. Verify toast notification appears

Test 3.2: Queue Management Interface

  1. Open management panel β†’ Downloads tab
  2. Trigger a download (repeat Test 3.1)
  3. Watch task move from "Queued" β†’ "Processing" β†’ "Completed"
  4. Verify task shows printer name, priority, timing info

Test 3.3: Error Handling

  1. Disconnect printer or network
  2. Trigger download
  3. Verify task shows in "Failed" section
  4. Check error message displays correctly

Phase 4: Auto-Detection Testing

Test 4.1: Job Start Detection (Bambu Lab)

  1. Start a print job on Bambu Lab A1
  2. Watch console for auto-detection:
    Job started on printer bambu_123
    πŸ“‹ Added download task: current_job_bambu_123... (current_job, priority: high)
    
  3. Verify toast: "Auto-Download: Downloading current job file from..."
  4. Check management panel shows high-priority task

Test 4.2: Job Start Detection (Prusa)

  1. Start a print job on Prusa Core One
  2. Watch console for auto-detection:
    Job started on printer prusa_456
    πŸ“‹ Added download task: current_job_prusa_456... (current_job, priority: high)
    
  3. Verify auto-download triggers correctly
  4. Check same behavior as Bambu Lab

Test 4.3: Auto-Detection Toggle

  1. Open management panel
  2. Click "⏸️ Disable Auto-Detection"
  3. Start a print job
  4. Verify no auto-download triggers
  5. Re-enable and test auto-download works again

Phase 5: Thumbnail Processing Testing

Test 5.1: 3MF File Processing

  1. Download a 3MF file with embedded thumbnail
  2. Watch console for thumbnail processing:
    πŸ–ΌοΈ Added thumbnail task: thumb_file123... (3mf, method: extract)
    πŸ–ΌοΈ Processing thumbnail: thumb_file123... (extract)
    βœ… Thumbnail completed: thumb_file123...
    
  3. Verify toast: "Thumbnail Ready: Thumbnail processed for..."

Test 5.2: STL File Processing

  1. Download an STL file
  2. Verify thumbnail generation attempt:
    πŸ–ΌοΈ Added thumbnail task: thumb_file456... (stl, method: generate)
    
  3. Check fallback to placeholder if generation fails

Test 5.3: Thumbnail Queue Management

  1. Open management panel β†’ Thumbnails tab
  2. Download multiple files with different formats
  3. Watch processing order (3MF first, then STL, then G-code)
  4. Verify queue statistics update correctly

Phase 6: Printer Integration Testing

Test 6.1: Printer Card Thumbnails

  1. Start a print job with a file containing thumbnail
  2. Wait for auto-download and processing
  3. Check printer card shows thumbnail instead of placeholder
  4. Verify thumbnail is clickable and opens modal

Test 6.2: Drucker-Dateien Integration

  1. Open printer β†’ πŸ“ Drucker-Dateien
  2. Try downloading files from the interface
  3. Verify downloads go through queue system
  4. Check progress shown in management panel

Test 6.3: File Preview Integration

  1. Open Files page
  2. Click on a file to preview
  3. Verify thumbnail loads or shows placeholder
  4. Check thumbnail processing triggers if needed

Phase 7: Error Recovery Testing

Test 7.1: Network Interruption

  1. Start download while connected
  2. Disconnect network during download
  3. Reconnect network
  4. Verify download retries automatically with exponential backoff

Test 7.2: API Endpoint Failure

  1. Mock API endpoint failure (browser DevTools β†’ Network β†’ Block requests)
  2. Trigger download
  3. Verify retry attempts with increasing delays
  4. Check eventual failure marked correctly

Test 7.3: System Recovery

  1. Refresh page during active downloads
  2. Verify system reinitializes correctly
  3. Check no duplicate downloads occur
  4. Confirm logging continues properly

Phase 8: Performance Testing

Test 8.1: Concurrent Downloads

  1. Configure multiple printers
  2. Start jobs on all printers simultaneously
  3. Verify downloads process concurrently (max 2 by default)
  4. Check no system overload or freezing

Test 8.2: Large File Handling

  1. Download large files (>50MB if available)
  2. Monitor system performance
  3. Verify UI remains responsive
  4. Check memory usage doesn't spike

Test 8.3: Queue Stress Test

  1. Add many downloads quickly (>10)
  2. Verify queue prioritization works correctly
  3. Check system handles backlog gracefully
  4. Monitor for memory leaks or performance degradation

Phase 9: Logging and Analytics Testing

Test 9.1: Log Generation

  1. Perform various operations (downloads, thumbnails, errors)
  2. Check console for detailed logging:
    [INFO] download: Download started: task_123
    [ERROR] download: Download failed: task_456
    [INFO] thumbnail: Thumbnail processing completed: thumb_789
    
  3. Verify all activities are logged with timestamps

Test 9.2: Log Export

  1. Open management panel
  2. Click "πŸ’Ύ Export Logs"
  3. Verify JSON file downloads
  4. Check file contains structured log data

Test 9.3: Statistics Tracking

// Check download statistics
window.downloadLogger.getPerformanceMetrics(1) // last 24 hours
Verify returns download/thumbnail success/failure counts


Phase 10: Long-term Stability Testing

Test 10.1: Extended Operation

  1. Leave system running for several hours
  2. Perform periodic operations
  3. Monitor for memory leaks or performance degradation
  4. Check log cleanup occurs as expected

Test 10.2: Browser Refresh Stability

  1. Start downloads
  2. Refresh page multiple times
  3. Verify no duplicate processing
  4. Check system state consistency

πŸ› Troubleshooting Common Issues

Issue: System Not Initializing

Symptoms: No console messages, status card missing Check:

// Verify script loading
console.log('Scripts loaded:', {
    logger: !!window.DownloadLogger,
    queue: !!window.DownloadQueue,
    thumbnail: !!window.ThumbnailQueue,
    manager: !!window.AutoDownloadManager
});
Solutions: - Check browser console for script errors - Verify all files exist in correct locations - Check for conflicts with other scripts

Issue: Downloads Not Processing

Symptoms: Downloads stuck in queue Check:

// Check queue status
window.downloadQueue.getQueueContents()
Solutions: - Verify backend endpoints are available - Check network connectivity to printers - Review error messages in management panel

Issue: Auto-Detection Not Working

Symptoms: Manual downloads work, auto-detection doesn't Check:

// Check WebSocket status
console.log('WebSocket:', window.websocketManager?.isConnected);
// Check auto-detection status
console.log('Auto-detection:', window.autoDownloadManager?.config.autoDetectionEnabled);
Solutions: - Verify WebSocket connection - Check printer status changes are being received - Enable auto-detection in management panel

Issue: Thumbnails Not Processing

Symptoms: Downloads work, thumbnails show placeholder Check:

// Check thumbnail queue
window.thumbnailQueue.getQueueContents()
Solutions: - Verify thumbnail processing endpoints - Check file format support - Review thumbnail queue error logs


πŸ“‹ Test Results Template

Use this template to document your testing results:

# Auto-Download System Test Results

**Date**: ___________
**Tester**: ___________
**Environment**: ___________

## Phase 1: System Initialization
- [ ] Test 1.1: Basic System Startup - βœ…/❌
- [ ] Test 1.2: Component Availability - βœ…/❌
- [ ] Test 1.3: System Status Verification - βœ…/❌

## Phase 2: Dashboard Integration
- [ ] Test 2.1: Status Card Display - βœ…/❌
- [ ] Test 2.2: Management Panel Access - βœ…/❌
- [ ] Test 2.3: Placeholder Images - βœ…/❌

[Continue for all phases...]

## Issues Found
1. ___________
2. ___________

## Performance Notes
- Download speed: ___________
- Thumbnail processing time: ___________
- System responsiveness: ___________

## Recommendations
1. ___________
2. ___________

πŸ”„ Continuous Testing

Daily Checks

  • System startup and initialization
  • Auto-detection functionality
  • Queue processing status

Weekly Checks

  • Error log review
  • Performance metrics analysis
  • Log cleanup verification

Monthly Checks

  • Full system stress testing
  • Long-term stability verification
  • Update testing procedures as needed

This comprehensive testing guide ensures the Auto-Download System operates reliably in all scenarios. Follow these procedures after any system updates or changes to maintain quality and reliability.