This commit is contained in:
Josh at WLTechBlog
2025-09-30 15:10:13 -05:00
parent 396718be59
commit cb4ec135ec
5 changed files with 520 additions and 95 deletions

View File

@@ -388,11 +388,14 @@ cremote drag-and-drop-offset --source=".draggable-item" --offset-x=100 --offset-
- **UI Component Testing**: Test custom drag and drop components
**Technical Details:**
- Uses Chrome DevTools Protocol for precise mouse event simulation
- Performs realistic drag operations with intermediate mouse movements
- Calculates element center points automatically for accurate targeting
- Supports timeout handling for slow or complex drag operations
- Works with all modern drag and drop APIs (HTML5 Drag and Drop, custom implementations)
- **Enhanced HTML5 Support**: Automatically injects JavaScript helpers to trigger proper HTML5 drag and drop events (dragstart, dragover, drop, dragend)
- **Smart Target Detection**: For coordinate/offset drags, automatically detects and targets valid drop zones at destination coordinates
- **Hybrid Approach**: Tries HTML5 drag events first, falls back to Chrome DevTools Protocol mouse events if needed
- **Intelligent Fallback**: Automatically switches between element-to-element and coordinate-based approaches for optimal compatibility
- **Realistic Event Simulation**: Performs drag operations with proper timing and intermediate mouse movements
- **Automatic Element Detection**: Calculates element center points automatically for accurate targeting
- **Robust Error Handling**: Supports timeout handling and graceful degradation for complex drag operations
- **Universal Compatibility**: Works with all modern drag and drop implementations (HTML5 Drag and Drop, jQuery UI, custom implementations)
The `--timeout` parameter specifies how many seconds to wait for the drag and drop operation to complete (default: 5 seconds).