From 594ae0619def7bd5b610ed64e2bc0548b6235e3a Mon Sep 17 00:00:00 2001 From: Vasilii Besschetnov Date: Mon, 18 Mar 2019 10:18:52 -0700 Subject: [PATCH] Only one error element is allowed Also error is not created if failure element is presented --- lib/runner/reporters/junit.xml.ejs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/runner/reporters/junit.xml.ejs b/lib/runner/reporters/junit.xml.ejs index fd3eac82de..4910acd503 100644 --- a/lib/runner/reporters/junit.xml.ejs +++ b/lib/runner/reporters/junit.xml.ejs @@ -16,10 +16,10 @@ <% if (assertions[i].screenshots && assertions[i].screenshots.length > 0) { %><% for (var j = 0; j < assertions[i].screenshots.length; j++) { %>[[ATTACHMENT|<%= assertions[i].screenshots[j] %>]]<% } %><% } %> <% } if (testcase.failed > 0 && testcase.stackTrace) { - %><%= testcase.stackTrace %><% } - for (var i = 0; i < errorMessages.length; i++) { %> - <%= errorMessages[i] %> - <% } %> + %><%= testcase.stackTrace %><% + } else if (errorMessages.length > 0 ) { + %><%= errorMessages.join('\n') %><% + } %> <% if (systemerr != '') {%> <%= systemerr %>