fixed #268 - Wrong message on step timeout
Showing
6 changed files
with
7 additions
and
14 deletions
... | @@ -5,6 +5,7 @@ XXXX-XX-XX, v1.0.0 | ... | @@ -5,6 +5,7 @@ XXXX-XX-XX, v1.0.0 |
5 | ------------------ | 5 | ------------------ |
6 | 6 | ||
7 | - fixed [#266](https://github.com/n1k0/casperjs/issues/266) - Fix `tester` module and its self tests | 7 | - fixed [#266](https://github.com/n1k0/casperjs/issues/266) - Fix `tester` module and its self tests |
8 | - fixed [#268](https://github.com/n1k0/casperjs/issues/266) - Wrong message on step timeout | ||
8 | - 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 | 9 | - 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 |
9 | - added `Tester.assertFalse()` as an alias of `Tester.assertNot()` | 10 | - added `Tester.assertFalse()` as an alias of `Tester.assertNot()` |
10 | 11 | ... | ... |
... | @@ -1078,15 +1078,7 @@ Casper.prototype.mouseEvent = function mouseEvent(type, selector) { | ... | @@ -1078,15 +1078,7 @@ Casper.prototype.mouseEvent = function mouseEvent(type, selector) { |
1078 | Casper.prototype.open = function open(location, settings) { | 1078 | Casper.prototype.open = function open(location, settings) { |
1079 | "use strict"; | 1079 | "use strict"; |
1080 | this.checkStarted(); | 1080 | this.checkStarted(); |
1081 | // settings validation | 1081 | settings = utils.isObject(settings) ? settings : { method: "get" }; |
1082 | if (!settings) { | ||
1083 | settings = { | ||
1084 | method: "get" | ||
1085 | }; | ||
1086 | } | ||
1087 | if (!utils.isObject(settings)) { | ||
1088 | throw new CasperError("open(): request settings must be an Object"); | ||
1089 | } | ||
1090 | // http method | 1082 | // http method |
1091 | // taken from https://github.com/ariya/phantomjs/blob/master/src/webpage.cpp#L302 | 1083 | // taken from https://github.com/ariya/phantomjs/blob/master/src/webpage.cpp#L302 |
1092 | var methods = ["get", "head", "put", "post", "delete"]; | 1084 | var methods = ["get", "head", "put", "post", "delete"]; |
... | @@ -1235,7 +1227,7 @@ Casper.prototype.runStep = function runStep(step) { | ... | @@ -1235,7 +1227,7 @@ Casper.prototype.runStep = function runStep(step) { |
1235 | if ((self.test.currentSuiteNum + "-" + self.step) === stepNum) { | 1227 | if ((self.test.currentSuiteNum + "-" + self.step) === stepNum) { |
1236 | self.emit('step.timeout'); | 1228 | self.emit('step.timeout'); |
1237 | if (utils.isFunction(self.options.onStepTimeout)) { | 1229 | if (utils.isFunction(self.options.onStepTimeout)) { |
1238 | self.options.onStepTimeout.call(self, self.options.onStepTimeout, stepNum); | 1230 | self.options.onStepTimeout.call(self, self.options.stepTimeout, stepNum); |
1239 | } | 1231 | } |
1240 | } | 1232 | } |
1241 | clearInterval(stepTimeoutCheckInterval); | 1233 | clearInterval(stepTimeoutCheckInterval); | ... | ... |
... | @@ -638,7 +638,7 @@ Tester.prototype.configure = function configure() { | ... | @@ -638,7 +638,7 @@ Tester.prototype.configure = function configure() { |
638 | 638 | ||
639 | // specific timeout callbacks | 639 | // specific timeout callbacks |
640 | this.casper.options.onStepTimeout = function test_onStepTimeout(timeout, step) { | 640 | this.casper.options.onStepTimeout = function test_onStepTimeout(timeout, step) { |
641 | tester.fail(f("Step timeout occured at step %d (%dms)", step, timeout)); | 641 | tester.fail(f("Step timeout occured at step %s (%dms)", step, timeout)); |
642 | }; | 642 | }; |
643 | 643 | ||
644 | this.casper.options.onTimeout = function test_onTimeout(timeout) { | 644 | this.casper.options.onTimeout = function test_onTimeout(timeout) { | ... | ... |
... | @@ -48,7 +48,7 @@ var t = casper.test, current = 0, tests = [ | ... | @@ -48,7 +48,7 @@ var t = casper.test, current = 0, tests = [ |
48 | username: 'bob', | 48 | username: 'bob', |
49 | password: 'sinclar' | 49 | password: 'sinclar' |
50 | }, "Casper.thenOpen() used the expected HTTP auth settings"); | 50 | }, "Casper.thenOpen() used the expected HTTP auth settings"); |
51 | }, | 51 | } |
52 | ]; | 52 | ]; |
53 | 53 | ||
54 | casper.start(); | 54 | casper.start(); | ... | ... |
-
Please register or sign in to post a comment