Commit 698294ef 698294efab21ba4bc2fbad87b4bce1682fb80830 by Nicolas Perriault

refs #410 - click() mouse events ordering

1 parent 3a8d495e
...@@ -421,7 +421,7 @@ Casper.prototype.clear = function clear() { ...@@ -421,7 +421,7 @@ Casper.prototype.clear = function clear() {
421 Casper.prototype.click = function click(selector) { 421 Casper.prototype.click = function click(selector) {
422 "use strict"; 422 "use strict";
423 this.checkStarted(); 423 this.checkStarted();
424 var success = this.mouseEvent('mousedown', selector); 424 var success = this.mouseEvent('mousedown', selector) && this.mouseEvent('mouseup', selector);
425 success = success && this.mouseEvent('click', selector); 425 success = success && this.mouseEvent('click', selector);
426 this.evaluate(function(selector) { 426 this.evaluate(function(selector) {
427 var element = __utils__.findOne(selector); 427 var element = __utils__.findOne(selector);
...@@ -429,7 +429,7 @@ Casper.prototype.click = function click(selector) { ...@@ -429,7 +429,7 @@ Casper.prototype.click = function click(selector) {
429 element.focus(); 429 element.focus();
430 } 430 }
431 }, selector); 431 }, selector);
432 return success && this.mouseEvent('mouseup', selector); 432 return success;
433 }; 433 };
434 434
435 /** 435 /**
......