mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
20 lines
597 B
JavaScript
20 lines
597 B
JavaScript
//! unsupported
|
|
test(function () {
|
|
var page = require('webpage').create();
|
|
|
|
page.evaluate(function() {
|
|
window.addEventListener('mousemove', function(event) {
|
|
window.loggedEvent = window.loggedEvent || [];
|
|
window.loggedEvent.push(event);
|
|
}, false);
|
|
});
|
|
|
|
page.sendEvent('mousemove', 14, 3);
|
|
var loggedEvent = page.evaluate(function() {
|
|
return window.loggedEvent;
|
|
});
|
|
assert_equals(loggedEvent.length, 1);
|
|
assert_equals(loggedEvent[0].clientX, 14);
|
|
assert_equals(loggedEvent[0].clientY, 3);
|
|
}, "mouse-move events");
|