Commit 27398293 27398293d589208f94101c9fa94ad8dfd5fc214a by Nicolas Perriault

fixed failing test

1 parent c0d6ee10
......@@ -247,14 +247,14 @@ Casper.prototype.click = function click(selector, fallbackToHref) {
throw new CasperError("Cannot click on unexistent selector: " + selector);
}
var clicked = this.evaluate(function(selector) {
__utils__.click(selector);
return __utils__.click(selector);
}, { selector: selector });
if (!clicked) {
// fallback onto native QtWebKit mouse events
try {
this.mouse.click(selector);
} catch (e) {
this.log(f("Error while trying to click on selector %s: %s", selector, e));
this.log(f("Error while trying to click on selector %s: %s", selector, e), "error");
return false;
}
}
......
......@@ -33,10 +33,9 @@ casper.then(function() {
this.options.onAlert = function(self, message) {
self.test.assertEquals(message, 'plop', 'Casper.options.onAlert() can intercept an alert message');
};
}).thenOpen('tests/site/alert.html').thenClick('button', function() {
this.options.onAlert = null;
});
casper.run(function() {
this.options.onAlert = null;
this.test.done();
});
......