forked from fescobar/allure-docker-service
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.html
309 lines (280 loc) · 14.4 KB
/
default.html
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<html>
<head>
<title>{{title}} - Allure Docker Service</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ css }}">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon') }}">
</head>
<body>
<div class="container jumbotron">
<div class="display-4 lead">{{title}}</div>
<div class="lead">Allure Docker Service</div>
<br>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Project ID
<span class="badge badge-light badge-pill">
{{projectId}}
</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Server Link
<span class="badge badge-light badge-pill">
<a href="{{serverUrl}}" target="_blank">{{serverUrl}}</a>
</span>
</li>
</ul>
{% set count = namespace(total=testCases|length,passed=0,failed=0,broken=0,skipped=0,unknown=0) %}
{% for testCase in testCases %}
{% if testCase.status=='passed' %}
{% set count.passed = count.passed + 1 %}
{% elif testCase.status=='failed' %}
{% set count.failed = count.failed + 1 %}
{% elif testCase.status=='broken' %}
{% set count.broken = count.broken + 1 %}
{% elif testCase.status=='skipped' %}
{% set count.skipped = count.skipped + 1 %}
{% elif testCase.status=='unknown' %}
{% set count.unknown = count.unknown + 1 %}
{% endif %}
{% endfor %}
{% set percentage = namespace(passed=0,failed=0,broken=0,skipped=0,unknown=0) %}
{% if testCases|length != 0 %}
{% set percentage.passed = (count.passed * 100)/testCases|length %}
{% set percentage.failed = (count.failed * 100)/testCases|length %}
{% set percentage.broken = (count.broken * 100)/testCases|length %}
{% set percentage.skipped = (count.skipped * 100)/testCases|length %}
{% set percentage.unknown = (count.unknown * 100)/testCases|length %}
{% endif %}
<br>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="table-active text-center">Total</th>
<th scope="col" class="table-success text-center">Passed</th>
<th scope="col" class="table-danger text-center">Failed</th>
<th scope="col" class="table-warning text-center">Broken</th>
<th scope="col" class="table-light text-center">Skipped</th>
<th scope="col" class="table-dark text-center">Unknown</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="col" class="text-center">{{ testCases|length }}</th>
<th scope="col" class="text-center">{{ count.passed }} ({{'%0.2f'| format(percentage.passed)}}%)</th>
<th scope="col" class="text-center">{{ count.failed }} ({{'%0.2f'| format(percentage.failed)}}%)</th>
<th scope="col" class="text-center">{{ count.broken }} ({{'%0.2f'| format(percentage.broken)}}%)</th>
<th scope="col" class="text-center">{{ count.skipped }} ({{'%0.2f'| format(percentage.skipped)}}%)</th>
<th scope="col" class="text-center">{{ count.unknown }} ({{'%0.2f'| format(percentage.unknown)}}%)</th>
</tr>
</tbody>
</table>
</div>
<hr class="my-4">
{% set css = namespace(border='', badge='') %}
{% for testCase in testCases %}
{% if testCase.status=='passed' %}
{% set css.border = 'border-success' %}
{% set css.badge = 'badge-success' %}
{% elif testCase.status=='failed' %}
{% set css.border = 'border-danger' %}
{% set css.badge = 'badge-danger' %}
{% elif testCase.status=='broken' %}
{% set css.border = 'border-warning' %}
{% set css.badge = 'badge-warning' %}
{% elif testCase.status=='skipped' %}
{% set css.border = 'border-light' %}
{% set css.badge = 'badge-light' %}
{% elif testCase.status=='unknown' %}
{% set css.border = 'border-dark' %}
{% set css.badge = 'badge-dark' %}
{% endif %}
<div
class="card border-secondary mb-3 {{ css.border }}">
<div class="card-header">
{{testCase.name}}
<span
class="badge badge-pill {{css.badge}}">{{testCase.status}}</span>
</div>
<div class="card-body">
<!-- CARD TEXT -->
<p class="card-text">
<b>description:</b> {{testCase.description}}
<br>
{% if testCase.time is defined and testCase.time.duration is defined %}
<b>duration:</b> {{testCase.time.duration/1000}} s
<br>
{% endif %}
{% if testCase.extra is defined and testCase.extra.severity is defined %}
<b>severity:</b> {{testCase.extra.severity}}
<br>
{% endif %}
{% for label in testCase.labels %}
{% if label.name == 'feature' or label.name == 'tag' or label.name == 'package' or label.name == 'suite' or label.name == 'testClass' or label.name == 'testMethod' %}
<b>{{label.name}}:</b> {{label.value}}
<br>
{% endif %}
{% endfor %}
{% if testCase.testStage is defined and testCase.testStage.statusMessage is defined %}
<b>Status Message: </b>
{{testCase.testStage.statusMessage}}
{% endif %}
<br>
{% if testCase.testStage is defined and testCase.testStage.statusTrace is defined %}
<b>Status Trace: </b>
{{testCase.testStage.statusTrace}}
{% endif %}
</p>
<!-- TABLE -->
{% if testCase.testStage is defined and testCase.testStage.stepsCount is defined and testCase.testStage.stepsCount > 0 %}
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Steps</th>
<th scope="col">Duration</th>
</tr>
</thead>
<tbody>
<!-- TABLE - BEFORE STAGES -->
{% if testCase.beforeStages is defined %}
{% for beforeStage in testCase.beforeStages %}
{% set css = namespace(table='') %}
{% for step in beforeStage.steps %}
{% if step.status=='passed' %}
{% set css.table = 'table-success' %}
{% elif step.status=='failed' %}
{% set css.table = 'table-danger' %}
{% elif step.status=='broken' %}
{% set css.table = 'table-warning' %}
{% elif step.status=='skipped' %}
{% set css.table = 'table-light' %}
{% elif step.status=='unknown' %}
{% set css.table = 'table-dark' %}
{% endif %}
<tr
class="{{ css.table }}">
<td>{{step.name}}</td>
{% if step.time is defined and step.time.duration is defined %}
<td>{{step.time.duration/1000}} s</td>
{% else %}
<td>0 s</td>
{% endif %}
</tr>
{% if step.statusMessage is defined %}
<tr class="table-danger">
<td style="padding-left:3em">
<h6>{{step.statusMessage}}</h6>
</td>
<td></td>
</tr>
{% endif %}
{% if step.statusTrace is defined %}
<tr class="table-danger">
<td style="padding-left:3em">
<h6>{{step.statusTrace}}</h6>
</td>
<td></td>
</tr>
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
<!-- TABLE - TEST STAGES -->
{% if testCase.testStage is defined %}
{% set css = namespace(table='') %}
{% for step in testCase.testStage.steps %}
{% if step.status=='passed' %}
{% set css.table = 'table-success' %}
{% elif step.status=='failed' %}
{% set css.table = 'table-danger' %}
{% elif step.status=='broken' %}
{% set css.table = 'table-warning' %}
{% elif step.status=='skipped' %}
{% set css.table = 'table-light' %}
{% elif step.status=='unknown' %}
{% set css.table = 'table-dark' %}
{% endif %}
<tr
class="{{ css.table }}">
<td>{{step.name}}</td>
{% if step.time is defined and step.time.duration is defined %}
<td>{{step.time.duration/1000}} s</td>
{% else %}
<td>0 s</td>
{% endif %}
</tr>
{% if step.statusMessage is defined %}
<tr class="table-danger">
<td style="padding-left:3em">
<h6>{{step.statusMessage}}</h6>
</td>
<td></td>
</tr>
{% endif %}
{% if step.statusTrace is defined %}
<tr class="table-danger">
<td style="padding-left:3em">
<h6>{{step.statusTrace}}</h6>
</td>
<td></td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
<!-- TABLE - AFTER STAGES -->
{% if testCase.afterStages is defined %}
{% for afterStage in testCase.afterStages %}
{% set css = namespace(table='') %}
{% for step in afterStage.steps %}
{% if step.status=='passed' %}
{% set css.table = 'table-success' %}
{% elif step.status=='failed' %}
{% set css.table = 'table-danger' %}
{% elif step.status=='broken' %}
{% set css.table = 'table-warning' %}
{% elif step.status=='skipped' %}
{% set css.table = 'table-light' %}
{% elif step.status=='unknown' %}
{% set css.table = 'table-dark' %}
{% endif %}
<tr
class="{{ css.table }}">
<td>{{step.name}}</td>
{% if step.time is defined and step.time.duration is defined %}
<td>{{step.time.duration/1000}} s</td>
{% else %}
<td>0 s</td>
{% endif %}
</tr>
{% if step.statusMessage is defined %}
<tr class="table-danger">
<td style="padding-left:3em">
<h6>{{step.statusMessage}}</h6>
</td>
<td></td>
</tr>
{% endif %}
{% if step.statusTrace is defined %}
<tr class="table-danger">
<td style="padding-left:3em">
<h6>{{step.statusTrace}}</h6>
</td>
<td></td>
</tr>
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</body>
</html>