diff --git a/beans/step.js b/beans/step.js index 826ce1d..2618dea 100644 --- a/beans/step.js +++ b/beans/step.js @@ -20,11 +20,15 @@ Step.prototype.end = function (status, timestamp) { }; Step.prototype.toXML = function () { + var start = (this.start == '' || typeof this.start === 'undefined') ? Date.now() : this.start; + var stop = (this.stop == '' || typeof this.stop === 'undefined') ? Date.now() : this.stop; + var status = (this.status == '' || typeof this.status === 'undefined') ? 'failed' : this.status; + return { '@': { - start: this.start, - stop: this.stop, - status: this.status + start: start, + stop: stop, + status: status }, name: this.name, title: this.name, diff --git a/beans/suite.js b/beans/suite.js index 3aba5a9..67eba7f 100644 --- a/beans/suite.js +++ b/beans/suite.js @@ -16,11 +16,13 @@ Suite.prototype.addTest = function(test) { }; Suite.prototype.toXML = function() { + var start = (this.start == '' || typeof this.start === 'undefined') ? Date.now() : this.start; + var stop = (this.stop == '' || typeof this.stop === 'undefined') ? Date.now() : this.stop; return { '@': { 'xmlns:ns2' : 'urn:model.allure.qatools.yandex.ru', - start: this.start, - stop: this.stop + start: start, + stop: stop }, name: this.name, title: this.name, diff --git a/beans/test.js b/beans/test.js index 54df501..30961c4 100644 --- a/beans/test.js +++ b/beans/test.js @@ -46,11 +46,14 @@ Test.prototype.end = function (status, error, timestamp) { }; Test.prototype.toXML = function () { + var start = (this.start == '' || typeof this.start === 'undefined') ? Date.now() : this.start; + var stop = (this.stop == '' || typeof this.stop === 'undefined') ? Date.now() : this.stop; + var status = (this.status == '' || typeof this.status === 'undefined') ? 'failed' : this.status; var result = { '@': { - start: this.start, - stop: this.stop, - status: this.status + start: start, + stop: stop, + status: status }, name: this.name, title: this.name,