Commit 6f4899a2 6f4899a25a92fee629ede0ae9b7a760d706799a5 by Nicolas Perriault

fixed selftest failed outside lib root path

1 parent cd85a928
Subproject commit f2d604f78f2c6005c6fd6b63617a2df67c48bab3
Subproject commit 8cd7fe5c1657b79ca1c467e7dae2b34425778c54
......
......@@ -1081,7 +1081,7 @@ Casper.prototype.runStep = function runStep(step) {
var skipLog = utils.isObject(step.options) && step.options.skipLog === true;
var stepInfo = f("Step %d/%d", this.step, this.steps.length);
var stepResult;
if (!skipLog) {
if (!skipLog && /^http/.test(this.getCurrentUrl())) {
this.log(stepInfo + f(' %s (HTTP %d)', this.getCurrentUrl(), this.currentHTTPStatus), "info");
}
if (utils.isNumber(this.options.stepTimeout) && this.options.stepTimeout > 0) {
......
......@@ -107,7 +107,18 @@ var Tester = function Tester(casper, options) {
}
if (failure.values && Object.keys(failure.values).length > 0) {
for (var name in failure.values) {
this.comment(' ' + name + ': ' + utils.serialize(failure.values[name]));
var comment = ' ' + name + ': ';
var value = failure.values[name];
try {
comment += utils.serialize(failure.values[name]);
} catch (e) {
try {
comment += utils.serialize(failure.values[name].toString());
} catch (e) {
comment += '(unserializable value)';
}
}
this.comment(comment);
}
}
});
......
......@@ -9,8 +9,8 @@ casper.test.assertMatch(xunit.getXML(), /<testcase classname="bar" name="baz"><f
// named classname
xunit = require('xunit').create();
xunit.addSuccess(require('fs').workingDirectory + '/plop.js', 'It worked');
casper.test.assertMatch(xunit.getXML(), /<testcase classname="plop" name="It worked"/, 'XUnitExporter.addSuccess() handles class name');
casper.test.assertMatch(xunit.getXML(), /<testcase classname="(.*)plop" name="It worked"/, 'XUnitExporter.addSuccess() handles class name');
xunit.addSuccess(require('fs').workingDirectory + '/plip.js', 'Failure');
casper.test.assertMatch(xunit.getXML(), /<testcase classname="plip" name="Failure"/, 'XUnitExporter.addFailure() handles class name');
casper.test.assertMatch(xunit.getXML(), /<testcase classname="(.*)plip" name="Failure"/, 'XUnitExporter.addFailure() handles class name');
casper.test.done();
\ No newline at end of file
casper.test.done();
......