#!/usr/bin/env node /** * Smart Video Recording Test Script * * Tests the new smart recording features: * - Recording modes (continuous, smart, action-only, segment) * - Auto-pause/resume during waits * - Manual pause/resume controls * - Action-aware recording */ console.log('🎬 Smart Video Recording Test'); console.log('============================\n'); const testWorkflow = ` # Smart Recording Test Workflow ## Test 1: Smart Mode (Default) 1. browser_start_recording() # Should start in smart mode 2. browser_recording_status() # Check mode and status 3. browser_navigate({url: "https://example.com"}) # Should auto-resume for action 4. browser_wait_for({time: 3}) # Should auto-pause during wait 5. browser_recording_status() # Should show paused 6. browser_click(...some element...) # Should auto-resume for action 7. browser_wait_for({time: 2, recordDuringWait: true}) # Should keep recording 8. browser_stop_recording() # Finalize and show video paths ## Test 2: Recording Mode Changes 1. browser_set_recording_mode({mode: "continuous"}) # Switch to continuous 2. browser_start_recording() # Start continuous recording 3. browser_navigate({url: "https://httpbin.org"}) # Should not pause 4. browser_wait_for({time: 3}) # Should not pause 5. browser_set_recording_mode({mode: "segment"}) # Switch to segment mode 6. browser_click(...some element...) # Should create new segment 7. browser_stop_recording() # Show all segments ## Test 3: Manual Controls 1. browser_start_recording() # Start recording 2. browser_navigate({url: "https://example.com"}) # Action 3. browser_pause_recording() # Manual pause 4. browser_wait_for({time: 5}) # Long wait (no recording) 5. browser_resume_recording() # Manual resume 6. browser_click(...some element...) # Action should record 7. browser_stop_recording() # Finalize ## Test 4: Path Resolution 1. browser_reveal_artifact_paths() # Show where videos are stored 2. browser_start_recording() # Start recording 3. browser_recording_status() # Show current paths and status 4. Perform some actions... 5. browser_stop_recording() # Get actual video file paths ## Expected Results: βœ… Smart mode auto-pauses during waits, resumes during actions βœ… Continuous mode never pauses βœ… Segment mode creates separate files per action sequence βœ… Manual pause/resume works independently of mode βœ… recordDuringWait parameter overrides smart mode behavior βœ… Status tool shows current mode and pause state βœ… Actual video files are created at reported paths `; console.log(testWorkflow); console.log('🎯 Key Features to Test:'); console.log('========================'); console.log('1. πŸ“Š browser_set_recording_mode - Choose recording behavior'); console.log('2. ⏸️ browser_pause_recording - Manual pause control'); console.log('3. ▢️ browser_resume_recording - Manual resume control'); console.log('4. 🧠 Smart wait handling - browser_wait_for with recordDuringWait'); console.log('5. πŸ“ˆ Enhanced status - browser_recording_status shows mode/state'); console.log('6. πŸ—‚οΈ Path discovery - browser_reveal_artifact_paths shows locations'); console.log('7. 🎞️ Segment mode - Creates separate files per action sequence'); console.log(''); console.log('πŸ’‘ LLM-Friendly Usage Patterns:'); console.log('==============================='); console.log(''); console.log('🎬 For Clean Demo Videos (Recommended):'); console.log('```'); console.log('browser_set_recording_mode({mode: "smart"}) // Auto-pause during waits'); console.log('browser_start_recording()'); console.log('// Perform demo actions - recording auto-manages pausing'); console.log('browser_navigate(...), browser_click(...), etc.'); console.log('browser_wait_for({time: 5}) // Auto-pauses here'); console.log('browser_stop_recording() // Clean video with minimal dead time'); console.log('```'); console.log(''); console.log('🎞️ For Action Sequences:'); console.log('```'); console.log('browser_set_recording_mode({mode: "segment"}) // Separate file per action'); console.log('browser_start_recording()'); console.log('browser_navigate(...) // Creates segment-1.webm'); console.log('browser_click(...) // Creates segment-2.webm'); console.log('browser_type(...) // Creates segment-3.webm'); console.log('browser_stop_recording() // Returns array of segment paths'); console.log('```'); console.log(''); console.log('⚑ For Minimal Recording:'); console.log('```'); console.log('browser_set_recording_mode({mode: "action-only"}) // Only record interactions'); console.log('browser_start_recording()'); console.log('// Automatically pauses between actions, resumes during interactions'); console.log('browser_stop_recording()'); console.log('```'); console.log(''); console.log('πŸ“Ή For Traditional Behavior:'); console.log('```'); console.log('browser_set_recording_mode({mode: "continuous"}) // Never auto-pause'); console.log('browser_start_recording()'); console.log('// Records everything including waits (original behavior)'); console.log('browser_stop_recording()'); console.log('```'); console.log(''); console.log('πŸ”§ Manual Control When Needed:'); console.log('```'); console.log('browser_start_recording()'); console.log('browser_navigate(...)'); console.log('browser_pause_recording() // Manual pause before long wait'); console.log('// ... long processing or thinking time ...'); console.log('browser_resume_recording() // Manual resume before next action'); console.log('browser_click(...)'); console.log('browser_stop_recording()'); console.log('```');