Skip to content

Commit 39f493d

Browse files
committed
Add time attribute in Junit Reporter #275
- Using suites as dictionary; - Using start, end to print time attributes in testsuite and testcase.
1 parent fc3a271 commit 39f493d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

share/junit.xml.ejs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
<testsuite name="<%= suite.name %>"
55
errors="<%= suite.errorCount %>"
66
failures="<%= suite.failureCount %>"
7-
tests="<%= suite.tests %>">
8-
<% for (var j=0; j < suite.testcases.length; j++) { %>
9-
<% var testcase=suites[i].testcases[j]; %>
10-
<testcase name="<%= testcase.name %>">
7+
tests="<%= suite.tests %>"
8+
time="<%= (suite.end - suite.start)/1000 %>"
9+
>
10+
<% for (var testCaseName in suite.testcases) { %>
11+
<% var testcase=suite.testcases[testCaseName]; %>
12+
<testcase name="<%= testcase.name %>" time="<%= (testcase.end - testcase.start)/1000 %>">
1113
<% if (testcase.failure) { %>
1214
<failure message="<%= testcase.failure.message %>">
1315
<% if (testcase.failure.backtrace) { %><%= testcase.failure.backtrace %><% } %>

0 commit comments

Comments
 (0)