diff --git a/src/__tests__/casperjs/sanity.js b/src/__tests__/casperjs/sanity.js index 37dad563..f9a9e864 100644 --- a/src/__tests__/casperjs/sanity.js +++ b/src/__tests__/casperjs/sanity.js @@ -33,12 +33,14 @@ casper.start( this.test.assertExists(selector); }.bind(this)); - this.test.done(); }) .waitFor(CasperHelp.waits.allCommandsFinished, function then() { doneSelectors.forEach(function(selector) { this.test.assertExists(selector); }.bind(this)); + }) + .then(function() { + this.test.done(); }); });