Commit 2e6cf773 2e6cf773e91e276721354cdcf500c16065ef443e by Nicolas Perriault

fixed #268 - Wrong message on step timeout

1 parent 491d40ff
......@@ -5,6 +5,7 @@ XXXX-XX-XX, v1.0.0
------------------
- fixed [#266](https://github.com/n1k0/casperjs/issues/266) - Fix `tester` module and its self tests
- fixed [#268](https://github.com/n1k0/casperjs/issues/266) - Wrong message on step timeout
- fixed [#215](https://github.com/n1k0/casperjs/issues/215) - added a `--fail-fast` option to the `casper test` command, in order to terminate a test suite execution as soon as any failure is encountered
- added `Tester.assertFalse()` as an alias of `Tester.assertNot()`
......
Subproject commit 2eb2c0d1d5aed057ada6afe8a3a795f57b09a91d
Subproject commit a6a2706deca272222dc7a8d2e5d02024a17df402
......
......@@ -1078,15 +1078,7 @@ Casper.prototype.mouseEvent = function mouseEvent(type, selector) {
Casper.prototype.open = function open(location, settings) {
"use strict";
this.checkStarted();
// settings validation
if (!settings) {
settings = {
method: "get"
};
}
if (!utils.isObject(settings)) {
throw new CasperError("open(): request settings must be an Object");
}
settings = utils.isObject(settings) ? settings : { method: "get" };
// http method
// taken from https://github.com/ariya/phantomjs/blob/master/src/webpage.cpp#L302
var methods = ["get", "head", "put", "post", "delete"];
......@@ -1235,7 +1227,7 @@ Casper.prototype.runStep = function runStep(step) {
if ((self.test.currentSuiteNum + "-" + self.step) === stepNum) {
self.emit('step.timeout');
if (utils.isFunction(self.options.onStepTimeout)) {
self.options.onStepTimeout.call(self, self.options.onStepTimeout, stepNum);
self.options.onStepTimeout.call(self, self.options.stepTimeout, stepNum);
}
}
clearInterval(stepTimeoutCheckInterval);
......
......@@ -638,7 +638,7 @@ Tester.prototype.configure = function configure() {
// specific timeout callbacks
this.casper.options.onStepTimeout = function test_onStepTimeout(timeout, step) {
tester.fail(f("Step timeout occured at step %d (%dms)", step, timeout));
tester.fail(f("Step timeout occured at step %s (%dms)", step, timeout));
};
this.casper.options.onTimeout = function test_onTimeout(timeout) {
......
/*global casper*/
/*jshint strict:false*/
/*jshint strict:false maxparams:99*/
casper.test.comment('Casper.evaluate()');
casper.start();
......
......@@ -48,7 +48,7 @@ var t = casper.test, current = 0, tests = [
username: 'bob',
password: 'sinclar'
}, "Casper.thenOpen() used the expected HTTP auth settings");
},
}
];
casper.start();
......