@testomatio/reporter 1.2.0-beta → 1.2.0-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- package/lib/_ArtifactStorageOld.js +1 -1
- package/lib/adapter/codecept.js +59 -39
- package/lib/adapter/cucumber/current.js +95 -59
- package/lib/adapter/cucumber/legacy.js +25 -11
- package/lib/adapter/cypress-plugin/index.js +1 -1
- package/lib/adapter/jasmine.js +1 -1
- package/lib/adapter/jest.js +18 -3
- package/lib/adapter/mocha.js +23 -23
- package/lib/adapter/playwright.js +18 -11
- package/lib/adapter/webdriver.js +1 -1
- package/lib/artifactStorage.js +2 -2
- package/lib/bin/reportXml.js +1 -0
- package/lib/bin/startTest.js +25 -4
- package/lib/client.js +102 -34
- package/lib/constants.js +7 -0
- package/lib/dataStorage.js +132 -72
- package/lib/junit-adapter/java.js +27 -9
- package/lib/logger.js +182 -164
- package/lib/pipe/csv.js +4 -1
- package/lib/pipe/github.js +24 -37
- package/lib/pipe/gitlab.js +5 -16
- package/lib/pipe/html.js +262 -0
- package/lib/pipe/index.js +2 -0
- package/lib/pipe/testomatio.js +138 -34
- package/lib/reporter.js +2 -1
- package/lib/template/real-data-example.js +47 -0
- package/lib/template/template.hbs +249 -0
- package/lib/template/testomatio.hbs +695 -0
- package/lib/utils/pipe_utils.js +135 -0
- package/lib/{util.js → utils/utils.js} +116 -10
- package/lib/xmlReader.js +132 -44
- package/package.json +10 -6
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport"
|
|
6
|
+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
8
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
|
9
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ==" crossorigin="anonymous" referrerpolicy="no-referrer">
|
|
10
|
+
<title>Report #{{runId}} - Testomat.io</title>
|
|
11
|
+
<style>
|
|
12
|
+
body {
|
|
13
|
+
padding: 0;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
header,
|
|
18
|
+
div,
|
|
19
|
+
p,
|
|
20
|
+
form,
|
|
21
|
+
input,
|
|
22
|
+
a,
|
|
23
|
+
span,
|
|
24
|
+
button {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
img {
|
|
28
|
+
width: 100%;
|
|
29
|
+
display: block;
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
height: auto;
|
|
32
|
+
}
|
|
33
|
+
p, span{
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
font-size: 12px;
|
|
36
|
+
color: grey;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
.report{
|
|
40
|
+
padding-top: 15px;
|
|
41
|
+
}
|
|
42
|
+
.level_1{
|
|
43
|
+
margin-bottom: 20px;
|
|
44
|
+
border-bottom: 1px solid grey;
|
|
45
|
+
padding-bottom: 10px;
|
|
46
|
+
}
|
|
47
|
+
.header{
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
|
52
|
+
.header__point{
|
|
53
|
+
width: 8px;
|
|
54
|
+
height: 8px;
|
|
55
|
+
border-radius: 50%;
|
|
56
|
+
margin-right: 15px;
|
|
57
|
+
}
|
|
58
|
+
.header__point_red{
|
|
59
|
+
background: red;
|
|
60
|
+
}
|
|
61
|
+
.header__block{
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
.header__case{
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
margin-right: 15px;
|
|
69
|
+
}
|
|
70
|
+
.header__case p{
|
|
71
|
+
margin-right: 7px;
|
|
72
|
+
}
|
|
73
|
+
.header__case span{
|
|
74
|
+
color: black;
|
|
75
|
+
}
|
|
76
|
+
.header__block button{
|
|
77
|
+
margin-left: 15px;
|
|
78
|
+
}
|
|
79
|
+
.header__type{
|
|
80
|
+
background: #0d6efd;
|
|
81
|
+
color: #FFF;
|
|
82
|
+
border-radius: 10px;
|
|
83
|
+
padding: 1px 5px;
|
|
84
|
+
margin-right: 15px;
|
|
85
|
+
}
|
|
86
|
+
.header__case i{
|
|
87
|
+
color: grey;
|
|
88
|
+
margin-right: 5px;
|
|
89
|
+
}
|
|
90
|
+
.title{
|
|
91
|
+
display: flex;
|
|
92
|
+
margin-bottom: 20px;
|
|
93
|
+
}
|
|
94
|
+
.title p{
|
|
95
|
+
color: black;
|
|
96
|
+
font-size: 20px;
|
|
97
|
+
margin-right: 5px;
|
|
98
|
+
}
|
|
99
|
+
.statright{
|
|
100
|
+
display: flex;
|
|
101
|
+
}
|
|
102
|
+
.statdesc{
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
}
|
|
106
|
+
.statdesc__row{
|
|
107
|
+
padding: 15px 10px;
|
|
108
|
+
display: flex;
|
|
109
|
+
}
|
|
110
|
+
.statdesc__row_first{
|
|
111
|
+
width: 150px;
|
|
112
|
+
}
|
|
113
|
+
.statdesc__row:nth-child(odd){
|
|
114
|
+
background: #F4F5FF;
|
|
115
|
+
}
|
|
116
|
+
.statdesc__row p{
|
|
117
|
+
font-weight: bold;
|
|
118
|
+
}
|
|
119
|
+
.statdesc{
|
|
120
|
+
width: 100%;
|
|
121
|
+
}
|
|
122
|
+
.statstatus{
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
}
|
|
126
|
+
.statstatus p{
|
|
127
|
+
font-weight: bold;
|
|
128
|
+
}
|
|
129
|
+
.statstatus div{
|
|
130
|
+
font-weight: bold;
|
|
131
|
+
}
|
|
132
|
+
.statstatus_failed div{
|
|
133
|
+
width: 10px;
|
|
134
|
+
height: 10px;
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
margin-right: 5px;
|
|
137
|
+
}
|
|
138
|
+
.statstatus_failed p{
|
|
139
|
+
color: red;
|
|
140
|
+
text-transform: uppercase;
|
|
141
|
+
}
|
|
142
|
+
.statstatus_failed div{
|
|
143
|
+
background: red;
|
|
144
|
+
}
|
|
145
|
+
.statstatus_passed div{
|
|
146
|
+
width: 10px;
|
|
147
|
+
height: 10px;
|
|
148
|
+
border-radius: 50%;
|
|
149
|
+
margin-right: 5px;
|
|
150
|
+
text-transform: uppercase;
|
|
151
|
+
}
|
|
152
|
+
.statstatus_passed div {
|
|
153
|
+
background: green;
|
|
154
|
+
}
|
|
155
|
+
.statstatus_passed p {
|
|
156
|
+
color: green;
|
|
157
|
+
text-transform: uppercase;
|
|
158
|
+
}
|
|
159
|
+
.statstatus_skipped div{
|
|
160
|
+
width: 10px;
|
|
161
|
+
height: 10px;
|
|
162
|
+
border-radius: 50%;
|
|
163
|
+
margin-right: 5px;
|
|
164
|
+
text-transform: uppercase;
|
|
165
|
+
}
|
|
166
|
+
.statstatus_skipped div {
|
|
167
|
+
background: yellow;
|
|
168
|
+
}
|
|
169
|
+
.statstatus_skipped p {
|
|
170
|
+
color: yellow;
|
|
171
|
+
text-transform: uppercase;
|
|
172
|
+
}
|
|
173
|
+
.fa-magnifying-glass{
|
|
174
|
+
font-size: 24px;
|
|
175
|
+
color: gray;
|
|
176
|
+
}
|
|
177
|
+
.level_5{
|
|
178
|
+
margin-top: 20px;
|
|
179
|
+
}
|
|
180
|
+
.numTest{
|
|
181
|
+
font-weight: 700;
|
|
182
|
+
font-size: 16px;
|
|
183
|
+
color:#0d6efd;
|
|
184
|
+
}
|
|
185
|
+
.testitem{
|
|
186
|
+
border: 1px solid grey;
|
|
187
|
+
border-radius: 10px;
|
|
188
|
+
margin-bottom: 15px;
|
|
189
|
+
}
|
|
190
|
+
.testitem__top{
|
|
191
|
+
width: 100%;
|
|
192
|
+
display: flex;
|
|
193
|
+
background: #e9ecef;
|
|
194
|
+
padding: 3px 0;
|
|
195
|
+
border-radius:10px;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
}
|
|
198
|
+
.testitem__icon{
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
width: 30px;
|
|
203
|
+
margin-right: 15px;
|
|
204
|
+
}
|
|
205
|
+
.testitem__ico{
|
|
206
|
+
font-size: 18px;
|
|
207
|
+
}
|
|
208
|
+
.testitem__name{
|
|
209
|
+
font-weight: 700;
|
|
210
|
+
color: black;
|
|
211
|
+
font-size: 16px;
|
|
212
|
+
}
|
|
213
|
+
.testitem__body{
|
|
214
|
+
display: flex;
|
|
215
|
+
border-top: 1px solid grey;
|
|
216
|
+
}
|
|
217
|
+
.testitem__menu{
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-direction: column;
|
|
220
|
+
border-right: 1px solid grey;
|
|
221
|
+
padding: 15px;
|
|
222
|
+
}
|
|
223
|
+
.testitem__mitem{
|
|
224
|
+
margin-bottom: 10px;
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
color: grey;
|
|
228
|
+
}
|
|
229
|
+
.testitem__mitem_active{
|
|
230
|
+
color: green;
|
|
231
|
+
}
|
|
232
|
+
.testitem__case{
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
padding: 10px;
|
|
236
|
+
}
|
|
237
|
+
.testitem__title{
|
|
238
|
+
font-size: 18px;
|
|
239
|
+
color: black;
|
|
240
|
+
font-weight: 700;
|
|
241
|
+
margin-bottom: 15px;
|
|
242
|
+
text-decoration: underline;
|
|
243
|
+
}
|
|
244
|
+
.testitem__block p{
|
|
245
|
+
font-size: 14px;
|
|
246
|
+
white-space: pre-line;
|
|
247
|
+
}
|
|
248
|
+
</style>
|
|
249
|
+
</head>
|
|
250
|
+
|
|
251
|
+
<body class="bg-gray-50 pt-6 px-4 lg:pt-4 lg:px-40 h-full;">
|
|
252
|
+
<section class="report" id="report">
|
|
253
|
+
<div class="container">
|
|
254
|
+
<!-- top -->
|
|
255
|
+
<div class="row level_1">
|
|
256
|
+
<div class="col-12">
|
|
257
|
+
<div class="header">
|
|
258
|
+
<div class="header__block">
|
|
259
|
+
<div class="header__case">
|
|
260
|
+
<p>Run</p>
|
|
261
|
+
<span><strong>#</strong>{{runId}}</span>
|
|
262
|
+
</div>
|
|
263
|
+
<p class="header__type">
|
|
264
|
+
<i class="fa-solid fa-face-smile"></i>
|
|
265
|
+
automated job
|
|
266
|
+
</p>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="header__block">
|
|
269
|
+
<a href="{{runUrl}}" target="_blank" class="btn btn-primary">
|
|
270
|
+
Full Report
|
|
271
|
+
</a>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
<!-- top -->
|
|
277
|
+
|
|
278
|
+
<div class="row level_2">
|
|
279
|
+
<div class="col-12">
|
|
280
|
+
<div class="title">
|
|
281
|
+
<p>Testomatio Run Information</p>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<!-- Schedule and information -->
|
|
287
|
+
<div class="row level_3">
|
|
288
|
+
<div class="col-6">
|
|
289
|
+
<div class="statleft">
|
|
290
|
+
<div id="graff"></div>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
<div class="col-6">
|
|
294
|
+
<div class="statright">
|
|
295
|
+
<div class="statdesc">
|
|
296
|
+
<!-- 1 -->
|
|
297
|
+
<div class="statdesc__row">
|
|
298
|
+
<div class="statdesc__row_first">
|
|
299
|
+
<p>Status</p>
|
|
300
|
+
</div>
|
|
301
|
+
<div class="statstatus statstatus_{{status}}">
|
|
302
|
+
<div></div>
|
|
303
|
+
<p>{{status}}</p>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
<!-- 1 -->
|
|
307
|
+
<!-- 1 -->
|
|
308
|
+
<div class="statdesc__row">
|
|
309
|
+
<div class="statdesc__row_first">
|
|
310
|
+
<p>Execution Duration</p>
|
|
311
|
+
</div>
|
|
312
|
+
<span>{{executionTime}}</span>
|
|
313
|
+
</div>
|
|
314
|
+
<!-- 1 -->
|
|
315
|
+
<!-- 1 -->
|
|
316
|
+
<div class="statdesc__row">
|
|
317
|
+
<div class="statdesc__row_first">
|
|
318
|
+
<p>Tests</p>
|
|
319
|
+
</div>
|
|
320
|
+
<span>{{tests.length}}</span>
|
|
321
|
+
</div>
|
|
322
|
+
<!-- 1 -->
|
|
323
|
+
<!-- 1 -->
|
|
324
|
+
<div class="statdesc__row">
|
|
325
|
+
<div class="statdesc__row_first">
|
|
326
|
+
<p>Start Execution Date</p>
|
|
327
|
+
</div>
|
|
328
|
+
<span>{{executionDate}}</span>
|
|
329
|
+
</div>
|
|
330
|
+
<!-- 1 -->
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
<!-- Schedule and information -->
|
|
336
|
+
<div class="row level_4">
|
|
337
|
+
<div class="col-6">
|
|
338
|
+
<div class="input-group">
|
|
339
|
+
<div class="input-group-prepend">
|
|
340
|
+
<span class="input-group-text" id="basic-addon1">
|
|
341
|
+
<i class="fa-solid fa-magnifying-glass"></i>
|
|
342
|
+
</span>
|
|
343
|
+
</div>
|
|
344
|
+
<input type="text" class="form-control inputSearch" placeholder="Search" aria-label="Search" aria-describedby="basic-addon1">
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<div class="col-6 d-flex justify-content-end">
|
|
349
|
+
<div class="btn-group menuTests" role="group" aria-label="Basic radio toggle button group">
|
|
350
|
+
|
|
351
|
+
<input type="radio" class="btn-check" name="groupTest" id="allTest" autocomplete="off" category="all" checked>
|
|
352
|
+
<label class="btn btn-outline-dark" for="allTest">All <span class="numTest" name="numTest" lcategory="all">0</span></label>
|
|
353
|
+
|
|
354
|
+
<input type="radio" class="btn-check" name="groupTest" id="passedTest" autocomplete="off" category="passed">
|
|
355
|
+
<label class="btn btn-outline-dark" for="passedTest">Passed <span class="numTest" name="numTest" lcategory="passed">0</span></label>
|
|
356
|
+
|
|
357
|
+
<input type="radio" class="btn-check" name="groupTest" id="failedTest" autocomplete="off" category="failed">
|
|
358
|
+
<label class="btn btn-outline-dark" for="failedTest">Failed <span class="numTest" name="numTest" lcategory="failed">0</span></label>
|
|
359
|
+
|
|
360
|
+
<input type="radio" class="btn-check" name="groupTest" id="skippedTest" autocomplete="off" category="skipped">
|
|
361
|
+
<label class="btn btn-outline-dark" for="skippedTest" >Skipped <span class="numTest" name="numTest" lcategory="skipped">0</span></label>
|
|
362
|
+
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div class="row level_5">
|
|
368
|
+
<div class="col-12">
|
|
369
|
+
|
|
370
|
+
<div class="testWrapp">
|
|
371
|
+
{{#each tests}}
|
|
372
|
+
|
|
373
|
+
<div class="testitem d-none" name="testitem" type="dummy" category="false">
|
|
374
|
+
|
|
375
|
+
<div class="testitem__top">
|
|
376
|
+
<div class="testitem__icon">
|
|
377
|
+
<i class="fa-solid fa-chevron-right testitem__ico testitem__ico_right"></i>
|
|
378
|
+
<i class="fa-solid fa-chevron-down d-none testitem__ico testitem__ico_down"></i>
|
|
379
|
+
</div>
|
|
380
|
+
<p class="testitem__name">Test</p>
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
<div class="testitem__body d-none">
|
|
384
|
+
|
|
385
|
+
<div class="testitem__menu">
|
|
386
|
+
<span type="steps" class="testitem__mitem testitem__mitem_active">Steps <i class="fa-solid fa-arrow-right"></i></span>
|
|
387
|
+
<span type="status" class="testitem__mitem">Status <i class="fa-solid fa-arrow-right"></i></span>
|
|
388
|
+
<span type="message" class="testitem__mitem">Message <i class="fa-solid fa-arrow-right"></i></span>
|
|
389
|
+
<span type="files" class="testitem__mitem">Files <i class="fa-solid fa-arrow-right"></i></span>
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
<div class="testitem__content">
|
|
393
|
+
|
|
394
|
+
<!-- 1 -->
|
|
395
|
+
<div class="testitem__case" type="steps">
|
|
396
|
+
<p class="testitem__title">Steps</p>
|
|
397
|
+
<div class="testitem__block">
|
|
398
|
+
<span>...</span>
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
<!-- 1 -->
|
|
402
|
+
|
|
403
|
+
<!-- 2 -->
|
|
404
|
+
<div class="testitem__case d-none" type="status">
|
|
405
|
+
<p class="testitem__title">Status</p>
|
|
406
|
+
<div class="testitem__block">
|
|
407
|
+
<span>...</span>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
<!-- 2 -->
|
|
411
|
+
|
|
412
|
+
<!-- 3 -->
|
|
413
|
+
<div class="testitem__case d-none" type="message">
|
|
414
|
+
<p class="testitem__title">Message</p>
|
|
415
|
+
<div class="testitem__block">
|
|
416
|
+
<span>...</span>
|
|
417
|
+
</div>
|
|
418
|
+
</div>
|
|
419
|
+
<!-- 3 -->
|
|
420
|
+
|
|
421
|
+
<!-- 4 -->
|
|
422
|
+
<div class="testitem__case d-none" type="files">
|
|
423
|
+
<p class="testitem__title">Files</p>
|
|
424
|
+
<div class="testitem__block">
|
|
425
|
+
<span>...</span>
|
|
426
|
+
</div>
|
|
427
|
+
</div>
|
|
428
|
+
<!-- 4 -->
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
</div>
|
|
432
|
+
{{/each}}
|
|
433
|
+
</div>
|
|
434
|
+
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
</div>
|
|
439
|
+
</section>
|
|
440
|
+
|
|
441
|
+
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
|
442
|
+
<script type="text/javascript">
|
|
443
|
+
// Load google charts
|
|
444
|
+
google.charts.load('current', {'packages':['corechart']});
|
|
445
|
+
google.charts.setOnLoadCallback(drawChart);
|
|
446
|
+
|
|
447
|
+
// Draw the chart and set the chart values
|
|
448
|
+
function drawChart() {
|
|
449
|
+
const passedTests = {{getTestsByStatus tests "PASSED"}};
|
|
450
|
+
const failedTests = {{getTestsByStatus tests "FAILED"}};
|
|
451
|
+
const skippedTests = {{getTestsByStatus tests "SKIPPED"}};
|
|
452
|
+
|
|
453
|
+
const data = google.visualization.arrayToDataTable([
|
|
454
|
+
['Task', 'Tests'],
|
|
455
|
+
['Passed', passedTests],
|
|
456
|
+
['Failed', failedTests],
|
|
457
|
+
['Skipped', skippedTests],
|
|
458
|
+
]);
|
|
459
|
+
|
|
460
|
+
// Optional: add a title and set the width and height of the chart
|
|
461
|
+
const options = {
|
|
462
|
+
'title':'',
|
|
463
|
+
'width':550,
|
|
464
|
+
'height':300,
|
|
465
|
+
'colors': ['#39BD2F', '#F2230C', '#F2C00C']
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
// Display the chart inside the <div> element with id="piechart"
|
|
469
|
+
const chart = new google.visualization.PieChart(document.getElementById('graff'));
|
|
470
|
+
chart.draw(data, options);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// processing and adding test data to the template
|
|
474
|
+
function addOneTest(category,testData = {}){
|
|
475
|
+
const { suite_title, title, steps, message, files } = testData;
|
|
476
|
+
// radio btn test's count
|
|
477
|
+
function incrementCount(element) {
|
|
478
|
+
let count = parseInt(element.textContent);
|
|
479
|
+
count++;
|
|
480
|
+
element.textContent = count;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function addCountToRadio(page,category){
|
|
484
|
+
const menuTests = page.querySelector('.menuTests');
|
|
485
|
+
const all = menuTests.querySelector('span[name="numTest"][lcategory="all"]');
|
|
486
|
+
|
|
487
|
+
incrementCount(all);
|
|
488
|
+
|
|
489
|
+
const elemCat = menuTests.querySelector('span[name="numTest"][lcategory="' + category + '"]');
|
|
490
|
+
|
|
491
|
+
if (elemCat) {
|
|
492
|
+
incrementCount(elemCat);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
// collapse - expand block
|
|
496
|
+
function collapse_expand(top){
|
|
497
|
+
const block = top.closest('.testitem');
|
|
498
|
+
const icon = top.querySelector('.testitem__icon');
|
|
499
|
+
const testitem__ico_right = icon.querySelector('.testitem__ico_right');
|
|
500
|
+
const testitem__ico_down = icon.querySelector('.testitem__ico_down');
|
|
501
|
+
const body = block.querySelector('.testitem__body');
|
|
502
|
+
|
|
503
|
+
if(body.classList.contains('d-none')){
|
|
504
|
+
body.classList.remove('d-none');
|
|
505
|
+
testitem__ico_right.classList.add('d-none');
|
|
506
|
+
testitem__ico_down.classList.remove('d-none');
|
|
507
|
+
}
|
|
508
|
+
else{
|
|
509
|
+
body.classList.add('d-none');
|
|
510
|
+
testitem__ico_down.classList.add('d-none');
|
|
511
|
+
testitem__ico_right.classList.remove('d-none');
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function menu(clone){
|
|
516
|
+
|
|
517
|
+
function removeAddActive(elem){
|
|
518
|
+
const menu = elem.closest('.testitem__menu');
|
|
519
|
+
const item = menu.querySelectorAll('.testitem__mitem');
|
|
520
|
+
|
|
521
|
+
for(let i=0; i<item.length; i++){
|
|
522
|
+
item[i].classList.remove('testitem__mitem_active');
|
|
523
|
+
}
|
|
524
|
+
elem.classList.add('testitem__mitem_active');
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function show_content(elem){
|
|
528
|
+
removeAddActive(elem);
|
|
529
|
+
|
|
530
|
+
const body = elem.closest('.testitem__body');
|
|
531
|
+
const content = body.querySelector('.testitem__content');
|
|
532
|
+
const blocks = content.querySelectorAll('.testitem__case');
|
|
533
|
+
|
|
534
|
+
for(let i=0; i<blocks.length; i++){
|
|
535
|
+
blocks[i].classList.add('d-none');
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const type = elem.getAttribute('type');
|
|
539
|
+
const show_elem = content.querySelector('div[type="'+type+'"]');
|
|
540
|
+
show_elem.classList.remove('d-none');
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
const menu = clone.querySelector('.testitem__menu');
|
|
544
|
+
const item = menu.querySelectorAll('.testitem__mitem');
|
|
545
|
+
|
|
546
|
+
for(let i=0; i<item.length; i++){
|
|
547
|
+
item[i].addEventListener('click',function(){
|
|
548
|
+
show_content(item[i])
|
|
549
|
+
})
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const page = document.querySelector('.report');
|
|
554
|
+
const wrapp = page.querySelector('.testWrapp');
|
|
555
|
+
const dummy = wrapp.querySelector('div[name="testitem"][type="dummy"]');
|
|
556
|
+
const clone = dummy.cloneNode(true);
|
|
557
|
+
|
|
558
|
+
clone.setAttribute('type','clone');
|
|
559
|
+
clone.setAttribute('category',category);
|
|
560
|
+
clone.classList.remove('d-none');
|
|
561
|
+
wrapp.append(clone);
|
|
562
|
+
|
|
563
|
+
const testitem__name = clone.querySelector('.testitem__name');
|
|
564
|
+
|
|
565
|
+
const fullTestName = suite_title ? suite_title + " - " + title : title;
|
|
566
|
+
testitem__name.textContent = fullTestName;
|
|
567
|
+
|
|
568
|
+
const body = clone.querySelector('.testitem__body');
|
|
569
|
+
let content = body.querySelector('.testitem__content');
|
|
570
|
+
|
|
571
|
+
let content_error = content.querySelector('div[type="steps"]').querySelector('span');
|
|
572
|
+
content_error.innerHTML = steps;
|
|
573
|
+
|
|
574
|
+
let content_status = content.querySelector('div[type="status"]').querySelector('span');
|
|
575
|
+
content_status.innerHTML = category;
|
|
576
|
+
|
|
577
|
+
let content_message = content.querySelector('div[type="message"]').querySelector('span');
|
|
578
|
+
content_message.innerHTML = message;
|
|
579
|
+
|
|
580
|
+
let content_files = content.querySelector('div[type="files"]').querySelector('span');
|
|
581
|
+
|
|
582
|
+
if (files.includes("This test has no files")) {
|
|
583
|
+
content_files.innerHTML = files;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
if (!files.includes("This test has no files")) {
|
|
587
|
+
const filesList = document.createElement('ul');
|
|
588
|
+
content_files.innerHTML = "";
|
|
589
|
+
|
|
590
|
+
if (Array.isArray(files) && files.length > 0) {
|
|
591
|
+
files.forEach((file) => {
|
|
592
|
+
const listItem = document.createElement('li');
|
|
593
|
+
const fileLink = document.createElement('a');
|
|
594
|
+
fileLink.href = file.path;
|
|
595
|
+
fileLink.target = '_blank';
|
|
596
|
+
fileLink.textContent = file.path;
|
|
597
|
+
|
|
598
|
+
listItem.appendChild(fileLink);
|
|
599
|
+
filesList.appendChild(listItem);
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
content_files.appendChild(filesList);
|
|
603
|
+
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
const testitem__top = clone.querySelector('.testitem__top');
|
|
608
|
+
|
|
609
|
+
testitem__top.addEventListener("click", function(){
|
|
610
|
+
collapse_expand(testitem__top);
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
menu(clone);
|
|
614
|
+
addCountToRadio(page,category);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function radioMenuStart(){
|
|
618
|
+
function showBlockForCat(input){
|
|
619
|
+
const page = input.closest('.report');
|
|
620
|
+
const wrapp = page.querySelector('.testWrapp');
|
|
621
|
+
const clone = wrapp.querySelectorAll('div[name="testitem"][type="clone"]');
|
|
622
|
+
|
|
623
|
+
for(let i=0; i<clone.length; i++){
|
|
624
|
+
clone[i].classList.add('d-none');
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const category = input.getAttribute('category');
|
|
628
|
+
|
|
629
|
+
if(category == 'all'){
|
|
630
|
+
for(let i=0; i<clone.length; i++){
|
|
631
|
+
clone[i].classList.remove('d-none');
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
else{
|
|
635
|
+
for(let i=0; i<clone.length; i++){
|
|
636
|
+
if(clone[i].getAttribute('category') == category){
|
|
637
|
+
clone[i].classList.remove('d-none');
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
const page = document.querySelector('.report');
|
|
644
|
+
const menuTests = page.querySelector('.menuTests');
|
|
645
|
+
const items = menuTests.querySelectorAll('input[name="groupTest"]');
|
|
646
|
+
|
|
647
|
+
for(let i=0; i<items.length; i++){
|
|
648
|
+
items[i].addEventListener('change',function(){
|
|
649
|
+
showBlockForCat(items[i])
|
|
650
|
+
})
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
radioMenuStart();
|
|
654
|
+
|
|
655
|
+
function search(){
|
|
656
|
+
function searchBlock(input){
|
|
657
|
+
const value = input.value;
|
|
658
|
+
|
|
659
|
+
const page = input.closest('.report');
|
|
660
|
+
const wrapp = page.querySelector('.testWrapp');
|
|
661
|
+
const clone = wrapp.querySelectorAll('div[name="testitem"][type="clone"]');
|
|
662
|
+
|
|
663
|
+
for(let i=0; i<clone.length; i++){
|
|
664
|
+
clone[i].classList.add('d-none');
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
for(let i=0; i<clone.length; i++){
|
|
668
|
+
let testitem__name = clone[i].querySelector('.testitem__name');
|
|
669
|
+
let nameInBlock = testitem__name.textContent;
|
|
670
|
+
|
|
671
|
+
if(nameInBlock.includes(value)){
|
|
672
|
+
clone[i].classList.remove('d-none');
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
}
|
|
677
|
+
const page = document.querySelector('.report');
|
|
678
|
+
const inputSearch = page.querySelector('.inputSearch');
|
|
679
|
+
|
|
680
|
+
inputSearch.addEventListener('input',function(){
|
|
681
|
+
searchBlock(inputSearch)
|
|
682
|
+
})
|
|
683
|
+
}
|
|
684
|
+
search();
|
|
685
|
+
|
|
686
|
+
const executedTests = {{{ json tests }}};
|
|
687
|
+
|
|
688
|
+
for (let i = 0; i < executedTests.length; i++) {
|
|
689
|
+
const status = executedTests[i].status;
|
|
690
|
+
|
|
691
|
+
addOneTest(status, executedTests[i]);
|
|
692
|
+
}
|
|
693
|
+
</script>
|
|
694
|
+
</body>
|
|
695
|
+
</html>
|