fixed failing test
Showing
2 changed files
with
3 additions
and
4 deletions
... | @@ -247,14 +247,14 @@ Casper.prototype.click = function click(selector, fallbackToHref) { | ... | @@ -247,14 +247,14 @@ Casper.prototype.click = function click(selector, fallbackToHref) { |
247 | throw new CasperError("Cannot click on unexistent selector: " + selector); | 247 | throw new CasperError("Cannot click on unexistent selector: " + selector); |
248 | } | 248 | } |
249 | var clicked = this.evaluate(function(selector) { | 249 | var clicked = this.evaluate(function(selector) { |
250 | __utils__.click(selector); | 250 | return __utils__.click(selector); |
251 | }, { selector: selector }); | 251 | }, { selector: selector }); |
252 | if (!clicked) { | 252 | if (!clicked) { |
253 | // fallback onto native QtWebKit mouse events | 253 | // fallback onto native QtWebKit mouse events |
254 | try { | 254 | try { |
255 | this.mouse.click(selector); | 255 | this.mouse.click(selector); |
256 | } catch (e) { | 256 | } catch (e) { |
257 | this.log(f("Error while trying to click on selector %s: %s", selector, e)); | 257 | this.log(f("Error while trying to click on selector %s: %s", selector, e), "error"); |
258 | return false; | 258 | return false; |
259 | } | 259 | } |
260 | } | 260 | } | ... | ... |
... | @@ -33,10 +33,9 @@ casper.then(function() { | ... | @@ -33,10 +33,9 @@ casper.then(function() { |
33 | this.options.onAlert = function(self, message) { | 33 | this.options.onAlert = function(self, message) { |
34 | self.test.assertEquals(message, 'plop', 'Casper.options.onAlert() can intercept an alert message'); | 34 | self.test.assertEquals(message, 'plop', 'Casper.options.onAlert() can intercept an alert message'); |
35 | }; | 35 | }; |
36 | }).thenOpen('tests/site/alert.html').thenClick('button', function() { | ||
37 | this.options.onAlert = null; | ||
38 | }); | 36 | }); |
39 | 37 | ||
40 | casper.run(function() { | 38 | casper.run(function() { |
39 | this.options.onAlert = null; | ||
41 | this.test.done(); | 40 | this.test.done(); |
42 | }); | 41 | }); | ... | ... |
-
Please register or sign in to post a comment