clearInterval(interval);
result.time = (new Date().getTime() - start);
result.failed ? failFx(result) : readyFx(result);
- phantom.exit(result.failed == 0 ? 0 : 2);
+
+ // See: https://github.com/ariya/phantomjs/issues/12697
+ // phantomjs 1.9.8
+ page.close();
+ setTimeout(function () {
+ phantom.exit(result.failed == 0 ? 0 : 2);
+ }, 0);
}
// timeout
html: $("html").html(),
duration: $(".duration").text(),
error_msg: error_msg,
- failed: list.length,
+ failed: (list.length > 0 || !passing),
passing: passing
};
})