-
Notifications
You must be signed in to change notification settings - Fork 4
/
report.vm
161 lines (151 loc) · 4.64 KB
/
report.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#set ($s_color = "#43A047")
#set ($sf_color = "#8ED670")
#set ($f_color = "#E53935")
#set ($w_color = "#FFEB3B")
#if ($sections.get(0))
<h2>
#if ($summary.getFailedTests().size()> 0)
<font color=$f_color>
Suite "$summary.getName()" has ended with $summary.getFailedTests().size() failures
</font>
#else
<font color=$s_color>
Suite "$summary.getName()" has ended with no failures
</font>
#end
</h2>
#end
#if ($sections.get(1))
<h3>Test Status Summary</h3>
<hr>
<table border="0">
<tr>
<td style="padding-right:10px">Start Date</td>
<td>$summary.getStartDate()</td>
</tr>
<tr>
<td style="padding-right:10px">Duration</td>
#set ($millis = $summary.getEndDate().getTime() - $summary.getStartDate().getTime())
#set ($minutes = $millis / 1000.0 / 60.0)
<td>$numberTool.format("#0.00", $minutes) minutes ($millis ms)</td>
</tr>
<tr>
<td style="padding-right:10px">Total Tests</td>
#set ($total = $summary.getPassedTests().size() + $summary.getFailedTests().size() + $summary.getSkippedTests().size() + $summary.getFailedButWithinSuccessPercentageTests().size())
<td>$total</td>
</tr>
<tr>
<td style="padding-right:10px">Passed Tests</td>
<td>$summary.getPassedTests().size()</td>
</tr>
<tr>
<td style="padding-right:10px">Failed Tests</td>
<td>$summary.getFailedTests().size()</td>
</tr>
#if ($summary.getSkippedTests().size() > 0)
<tr>
<td style="padding-right:10px">Skipped Tests</td>
<td>$summary.getSkippedTests().size()</td>
</tr>
#end
#if ($summary.getFailedButWithinSuccessPercentageTests().size() > 0)
<tr>
<td style="padding-right:10px">Failed But Within Succuess Percentage Tests</td>
<td>$summary.getFailedButWithinSuccessPercentageTests().size()</td>
</tr>
#end
</table>
<br>
#end
#if ($sections.get(2))
<br>
<h3>Test Method Status Per Test</h3>
<hr>
<table border="0" style="width:40%">
<tr>
<th>Suite Name</th>
<th>Passed</th>
<th>Failed</th>
<th>Skipped</th>
</tr>
#foreach ($suiteResult in $suite.getResults().values())
#set ($testContext = $suiteResult.getTestContext())
<tr>
<td>$testContext.getName()</td>
#set ($successTests = $testContext.getPassedTests().size() + $testContext.getFailedButWithinSuccessPercentageTests().size())
<td bgcolor="$s_color"><font color="white">$successTests</font></td>
<td bgcolor="$f_color"><font color="white">$testContext.getFailedTests().size()</font></td>
<td bgcolor="$w_color"><font color="white">$testContext.getSkippedTests().size()</font></td>
</tr>
#end
</table>
<br>
#end
#if ($sections.get(3))
<br>
#if ($summary.getFailedTests().size() > 0)
<h3>Failed Tests</h3>
<hr>
<table border="0" style="width:100%">
<tr align="left">
<th>Test Name</th>
<th>Status</th>
<th>Failure Reason</th>
</tr>
#foreach ($result in $summary.getFailedTests().getAllResults())
<tr>
<td style="padding-right:10px;word-break: break-all" title="$result.getMethod().getQualifiedName()">$result.getName()</td>
<td bgcolor=$f_color><font color="white">FAILURE</font></td>
<td style="padding-left:10px;word-break: break-all" >$result.getThrowable()</td>
</tr>
#end
</table>
<br><small><i>(Hover the method name to see the test class name)</i></small>
#end
#end
#if ($sections.get(4))
#if ($summary.getSkippedTests().size() > 0)
<h3>Skipped Tests</h3>
<hr>
<table border="0">
<tr align="left">
<th>Test Name</th>
<th>Status</th>
<tr>
#foreach ($result in $summary.getSkippedTests().getAllResults())
<tr>
<td title="$result.getMethod().getQualifiedName()" style="padding-right:10px">$result.getName()</td>
<td bgcolor=$w_color><font color="white">SKIPPED</font></td>
</tr>
#end
</table>
<br><small><i>(Hover the method name to see the test class name)</i></small>
#end
#end
#if ($sections.get(5))
#if ($summary.getPassedTests().size() > 0)
<h3>Passed Tests</h3>
<hr>
<table border="0">
<tr align="left">
<th>Test Name</th>
<th>Status</th>
<tr>
#foreach ($result in $summary.getPassedTests().getAllResults())
<tr>
<td title="$result.getMethod().getQualifiedName()" style="padding-right:10px">$result.getName()</td>
<td bgcolor=$s_color><font color="white">PASSED</font></td>
</tr>
#end
#foreach ($result in $summary.getFailedButWithinSuccessPercentageTests().getAllResults())
<tr>
<td title="$result.getMethod().getQualifiedName()" style="padding-right:10px">$result.getName()</td>
<td bgcolor=$sf_color><font color="white">SUCCESS_PERCENTAGE_FAILURE</font></td>
</tr>
#end
</table>
<br><small><i>(Hover the method name to see the test class name)</i></small>
#end
</h2>
<br>
#end