# NextAV Test Suite Documentation ## ๐ **Test Organization** This directory contains all test scripts and testing utilities for the NextAV media library system, organized by testing category. --- ## ๐ฌ **Player Testing** (`tests/player/`) ### **HTML Interface Tests** - **`test-artplayer.html`** - ArtPlayer integration testing - Tests ArtPlayer functionality across different pages - Validates bookmark/rating integration - Provides interactive checklist for manual testing - **`test-hls.html`** - HLS streaming endpoint testing - Tests HLS playlist generation and segment delivery - Interactive buttons for testing different endpoints - Video player integration testing **Usage**: Open in browser at `http://localhost:3000/tests/player/[filename].html` --- ## โ๏ธ **Streaming Tests** (`tests/streaming/`) ### **Node.js Streaming Tests** - **`test-ts-streaming.mjs`** - .ts file streaming test suite - Tests format detection for .ts files - Validates streaming URL generation - Tests different quality levels and endpoints - **`verify-hls.js`** - HLS endpoint verification script - Automated HLS implementation diagnostics - Tests playlist and segment endpoints - Validates HTTP headers and responses **Usage**: `node tests/streaming/[script-name].mjs` --- ## ๐ **Performance Tests** (`tests/performance/`) ### **Progress and Transcoding Tests** - **`test-progress-bar.mjs`** - Progress bar accuracy testing - Tests duration header detection - Validates progress calculation for transcoded videos - Checks transcoding endpoint headers - **`test-transcoding.mjs`** - Video transcoding system testing - Tests codec detection logic - Validates transcoding decision making - Simulates different video format scenarios **Usage**: `node tests/performance/[script-name].mjs` --- ## ๐ง **Diagnostic Tools** (`tests/diagnostics/`) ### **System Diagnostics** - **`diagnose-hls.js`** - HLS implementation diagnostic tool - Checks HLS API route existence - Validates format detector configuration - Identifies potential implementation issues - **`migrate-folder-bookmarks.sh`** - Database migration utility - Migrates folder bookmark data - Shell script for database operations - Backup and migration procedures - **`test-intellisense-case-sensitivity.mjs`** - IntelliSense case sensitivity test - Tests the fix for case sensitivity issues in the library IntelliSense feature - Verifies that paths with different case are properly matched on Linux systems - Validates path normalization logic **Usage**: - `node tests/diagnostics/diagnose-hls.js` - `bash tests/diagnostics/migrate-folder-bookmarks.sh` - `node tests/diagnostics/test-intellisense-case-sensitivity.mjs` --- ## ๐ฏ **Testing Categories** | Category | Purpose | Scripts | Status | |----------|---------|---------|---------| | **Player Testing** | Video player functionality | 2 HTML files | โ Active | | **Streaming** | HLS and .ts streaming | 2 Node.js scripts | โ Active | | **Performance** | Progress and transcoding | 2 Node.js scripts | โ Active | | **Diagnostics** | System health checks | 1 Node.js + 1 shell + 1 Node.js | โ Active | --- ## ๐โโ๏ธ **Quick Start** ### **Run All Tests** ``` # Player tests (manual browser testing) open http://localhost:3000/tests/player/test-artplayer.html open http://localhost:3000/tests/player/test-hls.html # Automated tests node tests/streaming/test-ts-streaming.mjs node tests/streaming/verify-hls.js node tests/performance/test-progress-bar.mjs node tests/performance/test-transcoding.mjs node tests/diagnostics/diagnose-hls.js node tests/diagnostics/test-intellisense-case-sensitivity.mjs # Migration utility bash tests/diagnostics/migrate-folder-bookmarks.sh ``` ### **Test Individual Components** ```bash # Test specific video ID node tests/streaming/test-ts-streaming.mjs # Verify HLS endpoints node tests/streaming/verify-hls.js # Check progress bar fixes node tests/performance/test-progress-bar.mjs # Diagnose HLS implementation node tests/diagnostics/diagnose-hls.js # Test IntelliSense case sensitivity fix node tests/diagnostics/test-intellisense-case-sensitivity.mjs ``` --- ## ๐ **Test Coverage** ### **Video Player Features** - โ ArtPlayer integration - โ HLS streaming support - โ Bookmark/rating integration - โ Cross-page compatibility ### **Streaming Capabilities** - โ .ts file handling - โ HLS playlist generation - โ Segment delivery - โ Format detection ### **Performance Features** - โ Progress bar accuracy - โ Transcoding decisions - โ Duration header handling - โ Process management ### **System Health** - โ HLS route validation - โ Database migration - โ Format detector checks - โ API endpoint verification --- ## ๐ง **Creating New Tests** ### **Test Script Template** ``` #!/usr/bin/env node /** * Test Description * Brief explanation of what this test validates */ const BASE_URL = 'http://localhost:3000'; async function runTest() { console.log('๐งช Running test...'); try { // Test implementation console.log('โ Test passed'); } catch (error) { console.error('โ Test failed:', error.message); process.exit(1); } } runTest(); ``` ### **HTML Test Template** ```