MouseEmulator up on GitHub
I've been busy today, I also put the MouseEmulator up on GitHub! The purpose of the MouseEmulator is to make unit testing of UI Components easier in Javascript. The MouseEmulator makes a "fake mouse cursor", and allows the cursor to be programatically moved around the page. It allows for easy dragging, clicking, moving, etc.
// moves the mouse from the center of the // target 10px right and 10px down. $( target ).emulate( 'mousemove' ).x( 10 ).y( 10 ).go(); // click the mouse in the center of the target $( target ).emulate( 'click' ).go(); // drag the element from its current position 100px // to the right and call a callback when complete $( target ).emulate( 'drag' ).x( 100 ).go( function() { // do something here. } );
Grab the code, make some updates, submit back, with more help, this project could make unit testing UI elements much easier!