Commit a069829f a069829f7f815927aa90bcffef669d669262243c by Nicolas Perriault

sync with master

2 parents 9d720691 cdeaaf43
...@@ -14,6 +14,7 @@ XXXX-XX-XX, v1.0.0 ...@@ -14,6 +14,7 @@ XXXX-XX-XX, v1.0.0
14 - fixed [#323](https://github.com/n1k0/casperjs/issues/323) - `thenEvaluate()` should be updated to take the same parameters as `evaluate()`, while maintaining backwards compatibility. 14 - fixed [#323](https://github.com/n1k0/casperjs/issues/323) - `thenEvaluate()` should be updated to take the same parameters as `evaluate()`, while maintaining backwards compatibility.
15 - merged PR [#319](https://github.com/n1k0/casperjs/pull/319), fixed [#209](https://github.com/n1k0/casperjs/issues/209) - test duration has been added to XUnit XML result file. 15 - merged PR [#319](https://github.com/n1k0/casperjs/pull/319), fixed [#209](https://github.com/n1k0/casperjs/issues/209) - test duration has been added to XUnit XML result file.
16 - `Casper.userAgent()` does not require the instance to be started anymore 16 - `Casper.userAgent()` does not require the instance to be started anymore
17 - dubious tests now have dedicated color & styling
17 18
18 2012-12-14, v1.0.0-RC6 19 2012-12-14, v1.0.0-RC6
19 ---------------------- 20 ----------------------
......
...@@ -64,7 +64,8 @@ var Colorizer = function Colorizer() { ...@@ -64,7 +64,8 @@ var Colorizer = function Colorizer() {
64 'WARNING': { fg: 'red', bold: true }, 64 'WARNING': { fg: 'red', bold: true },
65 'GREEN_BAR': { fg: 'white', bg: 'green', bold: true }, 65 'GREEN_BAR': { fg: 'white', bg: 'green', bold: true },
66 'RED_BAR': { fg: 'white', bg: 'red', bold: true }, 66 'RED_BAR': { fg: 'white', bg: 'red', bold: true },
67 'INFO_BAR': { bg: 'cyan', fg: 'white', bold: true } 67 'INFO_BAR': { bg: 'cyan', fg: 'white', bold: true },
68 'WARN_BAR': { bg: 'yellow', fg: 'white', bold: true }
68 }; 69 };
69 70
70 /** 71 /**
......
...@@ -87,7 +87,8 @@ var Tester = function Tester(casper, options) { ...@@ -87,7 +87,8 @@ var Tester = function Tester(casper, options) {
87 failFast: false, // terminates a suite as soon as a test fails? 87 failFast: false, // terminates a suite as soon as a test fails?
88 failText: "FAIL", // text to use for a succesful test 88 failText: "FAIL", // text to use for a succesful test
89 passText: "PASS", // text to use for a failed test 89 passText: "PASS", // text to use for a failed test
90 pad: 80 // maximum number of chars for a result line 90 pad: 80 , // maximum number of chars for a result line
91 warnText: "WARN" // text to use for a dubious test
91 }, options); 92 }, options);
92 93
93 this.configure(); 94 this.configure();
...@@ -1007,8 +1008,8 @@ Tester.prototype.renderResults = function renderResults(exit, status, save) { ...@@ -1007,8 +1008,8 @@ Tester.prototype.renderResults = function renderResults(exit, status, save) {
1007 result, 1008 result,
1008 exitStatus = ~~(status || (failed > 0 ? 1 : 0)); 1009 exitStatus = ~~(status || (failed > 0 ? 1 : 0));
1009 if (total === 0) { 1010 if (total === 0) {
1010 statusText = this.options.failText; 1011 statusText = this.options.warnText;
1011 style = 'RED_BAR'; 1012 style = 'WARN_BAR';
1012 result = f("%s Looks like you didn't run any test.", statusText); 1013 result = f("%s Looks like you didn't run any test.", statusText);
1013 } else { 1014 } else {
1014 if (failed > 0) { 1015 if (failed > 0) {
......
1 /*jshint strict:false*/
2 /*global CasperError casper console phantom require*/
3 if (phantom.version.major === 1 && phantom.version.minor < 8) {
4 // https://github.com/n1k0/casperjs/issues/101
5 casper.warn('document.location is broken under phantomjs < 1.8');
6 casper.test.done();
7 } else {
8 casper.start('tests/site/index.html', function() {
9 this.evaluate(function() {
10 document.location = '/tests/site/form.html';
11 });
12 });
13
14 casper.then(function() {
15 this.test.assertUrlMatches(/form\.html$/);
16 });
17
18 casper.run(function() {
19 this.test.done();
20 });
21 }