diff --git a/Gruntfile.js b/Gruntfile.js index d9c5385..82e4ece 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -157,7 +157,9 @@ module.exports = function(grunt) { var selenium = require("./tests/selenium.js"); var done = this.async(); var browsers = (browser) ? [grunt.config.get(this.name + "." + browser)] : _.values(grunt.config.get(this.name)); - selenium.tests(browsers, test).finally(function() { + selenium.tests(browsers, test).catch(function() { + done(false); + }).finally(function() { console.log("Done"); done(); }); diff --git a/tests/selenium.js b/tests/selenium.js index baeb30d..9ad32a8 100644 --- a/tests/selenium.js +++ b/tests/selenium.js @@ -113,6 +113,12 @@ } else { throw new Error("Couldn't run test after 3 retries"); } + }) + .then(function(e) { + if (e.message === "timeout error") { + throw e; + } + return e; }); }