iamchrismiller / grunt-casper

Run CasperJS Scripts/Functional Tests
Other
69 stars 38 forks source link

"Done, without errors." even if test fails (SlimerJS 0.9.2, casper 1.1.0-beta3, grunt-casper 0.4.1) example inside #58

Closed icd2k3 closed 9 years ago

icd2k3 commented 9 years ago

EDIT: this bug can only be reproduced by using 'slimerjs' as your engine option

Hey all,

I'm running into an issue where grunt reports "Done, without issues" even through my tests fail. I'm trying to set up a deployment flow where grunt wont allow you to deploy unless some casper tests pass.

Here's the test I'm using: casper.start('http://www.google.com').then(function(){ this.test.assert(false, 'test fail'); }).run(function() { this.test.done(); });

And my grunt-casper setup: casper: { options: { test: true, engine : 'slimerjs' }, test: { src: ['tests/_fast/00-helpers.js'] } }

And the output after running the grunt command grunt casper:test ...

FAIL test fail
    type: assert
    file: .../00-helpers.js
    subject: false
FAIL 1 test executed in 0.69s, 0 passed, 1 failed, 0 dubious, 0 skipped.      

Details for the 1 failed test:

In .../00-helpers.js
  Untitled suite in .../00-helpers.js
    assert: test fail
Casper Task 'casper:test' took ~1411ms to run

Done, without errors.

Any ideas or advice would be greatly appreciated - if this issue is resolved it will really help improve the workflow for my application. Thanks!

Versions: Casper: 1.1.0-beta3 grunt-casper: 0.4.1 grunt: 0.4.5

iamchrismiller commented 9 years ago

This seems to be a bug in slimerjs at the moment. I would recommend using the phantomjs engine. References : https://github.com/n1k0/casperjs/issues/904, https://github.com/laurentj/slimerjs/issues/50