Commit 5fdfdc54 5fdfdc547006f4b7205918dd887536e7dd040ad8 by Nicolas Perriault

fixes #119 - HTTP status wasn't properly caught

1 parent fada3d7d
...@@ -4,6 +4,7 @@ CasperJS Changelog ...@@ -4,6 +4,7 @@ CasperJS Changelog
4 XXXX-XX-XX, v0.6.11 4 XXXX-XX-XX, v0.6.11
5 ------------------- 5 -------------------
6 6
7 - fixed [#119](https://github.com/n1k0/casperjs/issues/119) - HTTP status wasn't properly caught
7 - fixed [#132](https://github.com/n1k0/casperjs/issues/132) - added ability to include js/coffee files using a dedicated option when using the [`casper test` command](http://casperjs.org/testing.html) 8 - fixed [#132](https://github.com/n1k0/casperjs/issues/132) - added ability to include js/coffee files using a dedicated option when using the [`casper test` command](http://casperjs.org/testing.html)
8 - fixed [#140](https://github.com/n1k0/casperjs/issues/140) - `casper test` now resolves local paths urls 9 - fixed [#140](https://github.com/n1k0/casperjs/issues/140) - `casper test` now resolves local paths urls
9 - fixed [#148](https://github.com/n1k0/casperjs/issues/148) - [`utils.isWebPage()`](http://casperjs.org/api.html#utils.isWebPage) was broken 10 - fixed [#148](https://github.com/n1k0/casperjs/issues/148) - [`utils.isWebPage()`](http://casperjs.org/api.html#utils.isWebPage) was broken
......
...@@ -112,7 +112,7 @@ var Casper = function Casper(options) { ...@@ -112,7 +112,7 @@ var Casper = function Casper(options) {
112 this.cli = phantom.casperArgs; 112 this.cli = phantom.casperArgs;
113 this.colorizer = this.getColorizer(); 113 this.colorizer = this.getColorizer();
114 this.currentUrl = 'about:blank'; 114 this.currentUrl = 'about:blank';
115 this.currentHTTPStatus = 200; 115 this.currentHTTPStatus = 0;
116 this.defaultWaitTimeout = 5000; 116 this.defaultWaitTimeout = 5000;
117 this.history = []; 117 this.history = [];
118 this.loadInProgress = false; 118 this.loadInProgress = false;
...@@ -1521,7 +1521,7 @@ function createPage(casper) { ...@@ -1521,7 +1521,7 @@ function createPage(casper) {
1521 if (resource.stage === "end") { 1521 if (resource.stage === "end") {
1522 casper.resources.push(resource); 1522 casper.resources.push(resource);
1523 } 1523 }
1524 if (resource.url === casper.requestUrl && resource.stage === "start") { 1524 if (resource.url === casper.requestUrl && resource.stage === "end") {
1525 casper.currentHTTPStatus = resource.status; 1525 casper.currentHTTPStatus = resource.status;
1526 casper.emit('http.status.' + resource.status, resource); 1526 casper.emit('http.status.' + resource.status, resource);
1527 if (utils.isObject(casper.options.httpStatusHandlers) && 1527 if (utils.isObject(casper.options.httpStatusHandlers) &&
......
...@@ -625,7 +625,7 @@ var Tester = function Tester(casper, options) { ...@@ -625,7 +625,7 @@ var Tester = function Tester(casper, options) {
625 line = ~~failure.line; 625 line = ~~failure.line;
626 message = failure.message; 626 message = failure.message;
627 casper.echo(f('In %s:%s', failure.file, line)); 627 casper.echo(f('In %s:%s', failure.file, line));
628 casper.echo(f(' %s: %s', type, message || "(no message was entered)"), "COMMENT"); 628 casper.echo(f(' %s: %s', type, message || failure.standard || "(no message was entered)"), "COMMENT");
629 }); 629 });
630 }; 630 };
631 631
......