forked from vakenbolt/go-test-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_report.html.template
275 lines (235 loc) · 7.59 KB
/
test_report.html.template
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{.ReportTitle}}</title>
<style type="text/css">
body {
font-family: sans-serif;
background-color: #f3f3f3;
border-top: 2px #dee6e8 solid;
margin: 0;
}
div.pageHeader span.projectTitle {
font-family: serif;
font-size: 2em;
padding-left: 56px;
padding-top: 80px;
display: block;
color: #a5a5a5;
text-shadow: 0 -1px 1px white;
}
div.pageHeader div.testStats {
position: absolute;
top: 7px;
right: 52px;
font-size: 0.8em;
color: #a2a2a2;
}
div.pageHeader div.testStats span.indicator {
font-size: 2em;
position: relative;
top: 5px;
text-shadow: 0 1px 0 white;
}
div.pageHeader div.testStats span strong {
margin-right: 16px;
}
div.pageHeader div.testStats span.total {
border-right: 1px #afafaf dotted;
background: #8298af;
}
div.pageHeader div.testStats span.passed {
border-right: 1px #afafaf dotted;
background: #6fca83;
}
div.pageHeader div.testStats span.skipped {
background: #bababa;
}
div.pageHeader div.testStats span.failed {
background: #ff7676;
}
div.pageHeader div.testStats span {
margin-right: 1px;
height: 55px;
padding: 20px 8px 18px;
color: white;
}
div.pageHeader .testGroupsTitle {
margin: 16px 32px 8px 40px;
font-size: 0.9em;
color: darkgrey;
display: inline-block;
}
div.pageHeader .testExecutionDate {
display: inline-block;
position: absolute;
right: 10px;
margin: 14px 32px 8px 40px;
color: #9e9e9e;
font-size: 0.9em;
}
.testReportContainer {
padding: 0 32px 32px 32px;
}
.cardContainer {
padding: 16px 16px 16px;
box-shadow: 0 4px 4px #d4d4d4;
background-color: white;
}
#testResults {
display: flex;
flex-wrap: wrap;
}
.testResultGroup {
width: {{.TestResultGroupIndicatorWidth}};
height: {{.TestResultGroupIndicatorHeight}};
background-color: #43c143;
margin-left: 1px;
margin-bottom: 1px;
box-sizing: border-box;
}
.testResultGroup.selected {
border: 1px white solid;
background-color: black !important;
}
.testResultGroup.skipped {
border: 2px gray solid;
}
.testResultGroup.failed {
background-color: red;
}
.cardContainer.testGroupList,
.cardContainer.testDetail {
margin-top: 16px;
padding: 16px;
}
.cardContainer.testGroupList {
color: #9c9c9c;
padding: 0;
}
.cardContainer.testGroupList .testGroupRow {
cursor: default;
border-bottom: 1px #dadada dotted;
}
.cardContainer.testGroupList .testGroupRow span.testStatus {
font-size: 1.2em;
font-weight: bold;
color: #139e13;
pointer-events: none;
display: inline-block;
overflow: hidden;
float: left;
padding-top: 10px;
padding-left: 20px;
padding-right: 12px;
}
.cardContainer.testGroupList .testGroupRow span.testStatus.skipped {
color: gray;
}
.cardContainer.testGroupList .testGroupRow span.testStatus.failed {
color: red;
}
.cardContainer.testGroupList .testGroupRow span.testTitle {
font-size: 0.9em;
padding: 12px 0 10px;
display: inline-block;
pointer-events: none;
color: #525252;
text-overflow: ellipsis;
overflow: hidden;
width: calc(100% - 110px);
}
.cardContainer.testGroupList .testGroupRow span.testDuration {
pointer-events: none;
}
.cardContainer.testGroupList .testGroupRow {
position: relative;
border-left: 4px #43c143 solid;
}
.cardContainer.testGroupList .testGroupRow.skipped {
color: gray;
border-left: 4px gray solid;
}
.cardContainer.testGroupList .testGroupRow.failed {
color: red;
border-left: 4px red solid;
}
.cardContainer.testGroupList .testGroupRow:hover {
background-color: #fffaea;
transition: 0.250s;
}
.cardContainer .testOutput {
padding: 8px 16px 24px 16px;
}
.cardContainer .console {
display: block;
font-family: monospace;
padding: 10px;
background-color: #424242;
color: #1aff00;
border-bottom: 1px #1aff00 dotted;
overflow: auto;
font-size: 1.1em;
}
.cardContainer .testOutput .testDetail {
border-bottom: 1px #d0d0d0 solid;
padding: 16px;
background-color: #e6e6e6;
border-radius: 0 0 4px 4px;
color: dimgrey;
font-size: 0.8em;
}
.cardContainer .console.skipped{
color: #d9d9d9;
}
.cardContainer .console.failed {
color: #ffb2b2;
}
.cardContainer .testDuration {
position: absolute;
top: 5px;
right: 8px;
text-align: right;
padding-right: 8px;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="pageHeader">
<span class="projectTitle">{{.ReportTitle}}</span>
<div class="testStats">
<span class="total"><span class="indicator">⧉</span> Total: <strong>{{.NumOfTests}}</strong>Duration: <strong>{{.TestDuration}}</strong>
</span><span class="passed"><span class="indicator">✓</span> Passed: <strong>{{.NumOfTestPassed}}</strong>
</span><span class="skipped"><span class="indicator">‐</span> Skipped: <strong>{{.NumOfTestSkipped}}</strong>
</span><span class="failed"><span class="indicator">✗</span> Failed: <strong>{{.NumOfTestFailed}}</strong>
</span>
</div>
<span class="testGroupsTitle">Test Groups:</span>
<span class="testExecutionDate">{{.TestExecutionDate}}</span>
</div>
<div class="testReportContainer">
<div class="cardContainer">
<div id="testResults">
{{range $k, $v := .TestResults}}
<div class="testResultGroup {{.FailureIndicator}} {{.SkippedIndicator}}" id="{{$k}}"></div>
{{end}}
</div>
</div>
<div class="cardContainer testGroupList" id="testGroupList"></div>
</div>
<script type="application/javascript">
{{.JsCode}}
/**
* @type {TestResults}
*/
const data = {{.TestResults}}
const report = window.GoTestReport({
data: data,
testResultsElem: document.getElementById('testResults'),
testGroupListElem: document.getElementById('testGroupList')
});
</script>
</body>
</html>