<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="<%= module.errors %>"
            failures="<%= module.failures %>"
            tests="<%= module.tests %>">

  <testsuite name="<%= moduleName %>"
    errors="<%= module.errors %>" failures="<%= module.failures %>" hostname="" id="" package="<%= module.group || moduleName %>" skipped="<%= (Array.isArray(module.skipped)) ? module.skipped.length : 0 %>"
    tests="<%= module.tests %>" time="<%= module.time %>" timestamp="<%= module.timestamp %>">
  <% for (var item in module.completed) {
    var testcase = module.completed[item];
    var assertions = testcase.assertions %>
    <testcase name="<%= item %>" time="<%= testcase.time %>" assertions="<%= assertions.length %>"><%
      for (var i = 0; i < assertions.length; i++) { %><% if (assertions[i].failure) { %>  <failure message="<%= assertions[i].message %>"><%= assertions[i].stackTrace %></failure><% } %>
<% if (assertions[i].screenshots && assertions[i].screenshots.length > 0) { %><system-out><% for (var j = 0; j < assertions[i].screenshots.length; j++) { %>[[ATTACHMENT|<%= assertions[i].screenshots[j] %>]]<% } %></system-out><% } %>
    <% }
    if (testcase.failed > 0 && testcase.stackTrace) {
    %><failure message="<%= testcase.message %>"><%= testcase.stackTrace %></failure><% } %>
    </testcase><% if (systemerr != '') {%>
      <system-err>
        <%= systemerr %>
      </system-err><% } %>
  <% } %>
  <% if (module.skipped && (module.skipped.length > 0)) { %>
    <% for (var j = 0; j < module.skipped.length; j++) { %>
    <testcase
      name="<%= module.skipped[j] %>">
      <skipped />
    </testcase>
    <% } %>
  <% } %>
  </testsuite>
</testsuites>
