@testomatio/reporter 2.0.1-beta-ignore-xml → 2.0.1-beta.1
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/lib/adapter/codecept.js +0 -2
- package/lib/adapter/cypress-plugin/index.js +0 -2
- package/lib/adapter/mocha.js +0 -1
- package/lib/adapter/nightwatch.d.ts +4 -0
- package/lib/adapter/nightwatch.js +80 -0
- package/lib/adapter/webdriver.d.ts +1 -1
- package/lib/adapter/webdriver.js +17 -8
- package/lib/bin/cli.js +126 -8
- package/lib/bin/reportXml.js +4 -2
- package/lib/bin/startTest.js +3 -2
- package/lib/bin/uploadArtifacts.js +5 -4
- package/lib/client.js +18 -9
- package/lib/config.js +2 -2
- package/lib/data-storage.d.ts +1 -1
- package/lib/data-storage.js +17 -7
- package/lib/junit-adapter/csharp.d.ts +1 -0
- package/lib/junit-adapter/csharp.js +11 -1
- package/lib/pipe/bitbucket.d.ts +2 -0
- package/lib/pipe/bitbucket.js +38 -26
- package/lib/pipe/debug.js +17 -3
- package/lib/pipe/github.d.ts +2 -2
- package/lib/pipe/github.js +35 -3
- package/lib/pipe/gitlab.d.ts +2 -0
- package/lib/pipe/gitlab.js +27 -9
- package/lib/pipe/html.d.ts +1 -0
- package/lib/pipe/html.js +1 -3
- package/lib/pipe/index.js +17 -7
- package/lib/pipe/testomatio.d.ts +2 -1
- package/lib/pipe/testomatio.js +79 -73
- package/lib/reporter.d.ts +12 -12
- package/lib/services/artifacts.d.ts +1 -1
- package/lib/services/key-values.d.ts +1 -1
- package/lib/services/logger.d.ts +1 -1
- package/lib/services/logger.js +1 -2
- package/lib/template/testomatio.hbs +443 -68
- package/lib/uploader.js +2 -2
- package/lib/utils/utils.d.ts +2 -0
- package/lib/utils/utils.js +41 -18
- package/lib/xmlReader.js +54 -19
- package/package.json +8 -9
- package/src/adapter/codecept.js +0 -2
- package/src/adapter/cypress-plugin/index.js +0 -2
- package/src/adapter/mocha.js +0 -1
- package/src/adapter/nightwatch.js +88 -0
- package/src/adapter/webdriver.js +1 -2
- package/src/bin/cli.js +131 -2
- package/src/bin/reportXml.js +4 -1
- package/src/bin/startTest.js +2 -1
- package/src/bin/uploadArtifacts.js +2 -1
- package/src/client.js +1 -2
- package/src/config.js +2 -2
- package/src/junit-adapter/csharp.js +13 -1
- package/src/pipe/bitbucket.js +22 -24
- package/src/pipe/debug.js +18 -3
- package/src/pipe/github.js +1 -2
- package/src/pipe/gitlab.js +27 -9
- package/src/pipe/html.js +3 -4
- package/src/pipe/testomatio.js +98 -103
- package/src/services/logger.js +1 -2
- package/src/template/testomatio.hbs +443 -68
- package/src/uploader.js +2 -2
- package/src/utils/utils.js +19 -9
- package/src/xmlReader.js +69 -17
|
@@ -28,74 +28,449 @@
|
|
|
28
28
|
<title>Report Testomat.io</title>
|
|
29
29
|
{{/if}}
|
|
30
30
|
<style>
|
|
31
|
-
body {
|
|
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
|
-
|
|
31
|
+
body {
|
|
32
|
+
padding: 0;
|
|
33
|
+
margin: 0;
|
|
34
|
+
font-family: 'Inter', sans-serif;
|
|
35
|
+
}
|
|
36
|
+
header,
|
|
37
|
+
div,
|
|
38
|
+
p,
|
|
39
|
+
form,
|
|
40
|
+
input,
|
|
41
|
+
a,
|
|
42
|
+
span,
|
|
43
|
+
button {
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
}
|
|
46
|
+
img {
|
|
47
|
+
width: 100%;
|
|
48
|
+
display: block;
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
height: auto;
|
|
51
|
+
}
|
|
52
|
+
p,
|
|
53
|
+
span {
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
color: grey;
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
.report {
|
|
60
|
+
padding-top: 15px;
|
|
61
|
+
}
|
|
62
|
+
.level_1 {
|
|
63
|
+
margin-bottom: 20px;
|
|
64
|
+
border-bottom: 2px solid #ababab;
|
|
65
|
+
padding-bottom: 20px;
|
|
66
|
+
}
|
|
67
|
+
.header {
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
.header__point {
|
|
73
|
+
width: 8px;
|
|
74
|
+
height: 8px;
|
|
75
|
+
border-radius: 50%;
|
|
76
|
+
margin-right: 15px;
|
|
77
|
+
}
|
|
78
|
+
.header__point_red {
|
|
79
|
+
background: red;
|
|
80
|
+
}
|
|
81
|
+
.header__block {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
}
|
|
85
|
+
.header__case {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
margin-right: 15px;
|
|
89
|
+
}
|
|
90
|
+
.header__case p {
|
|
91
|
+
margin-right: 7px;
|
|
92
|
+
}
|
|
93
|
+
.header__case span {
|
|
94
|
+
color: black;
|
|
95
|
+
}
|
|
96
|
+
.header__block button {
|
|
97
|
+
margin-left: 15px;
|
|
98
|
+
}
|
|
99
|
+
.header__type {
|
|
100
|
+
font-size: 15px;
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
background: #ca95ff;
|
|
103
|
+
color: #fff;
|
|
104
|
+
border-radius: 5px;
|
|
105
|
+
padding: 5px 35px;
|
|
106
|
+
margin-right: 15px;
|
|
107
|
+
}
|
|
108
|
+
.btn {
|
|
109
|
+
box-shadow: none !important;
|
|
110
|
+
}
|
|
111
|
+
.btn-report {
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
background: #ca95ff;
|
|
115
|
+
color: #fff !important;
|
|
116
|
+
border-radius: 5px;
|
|
117
|
+
padding: 9px 37px;
|
|
118
|
+
font-size: 15px;
|
|
119
|
+
}
|
|
120
|
+
.run-style {
|
|
121
|
+
color: #5d5c5d;
|
|
122
|
+
}
|
|
123
|
+
.run-span {
|
|
124
|
+
font-weight: 800 !important;
|
|
125
|
+
color: #5d5c5d !important;
|
|
126
|
+
}
|
|
127
|
+
.btn-report:hover {
|
|
128
|
+
background: #b468ff;
|
|
129
|
+
}
|
|
130
|
+
.border-none {
|
|
131
|
+
border: none;
|
|
132
|
+
}
|
|
133
|
+
.level_4 {
|
|
134
|
+
height: 53px !important;
|
|
135
|
+
}
|
|
136
|
+
.inputSearch:focus {
|
|
137
|
+
box-shadow: none;
|
|
138
|
+
border: 1px solid black !important;
|
|
139
|
+
background: #fff !important;
|
|
140
|
+
border-radius: 3px;
|
|
141
|
+
}
|
|
142
|
+
.btn-all {
|
|
143
|
+
border: 1px solid #a0caff !important;
|
|
144
|
+
}
|
|
145
|
+
.btn-passed {
|
|
146
|
+
border: 1px solid #75b583 !important;
|
|
147
|
+
}
|
|
148
|
+
.btn-failed {
|
|
149
|
+
border: 1px solid #ff6363 !important;
|
|
150
|
+
}
|
|
151
|
+
.btn-skipped {
|
|
152
|
+
border: 1px solid #ffc350 !important;
|
|
153
|
+
}
|
|
154
|
+
.btn-all:hover,
|
|
155
|
+
.btn-all:focus {
|
|
156
|
+
color: #a0caff !important;
|
|
157
|
+
background: #fff !important;
|
|
158
|
+
border: 1px solid #a0caff !important;
|
|
159
|
+
font-weight: 700 !important;
|
|
160
|
+
}
|
|
161
|
+
.btn-all:hover span,
|
|
162
|
+
.btn-all:focus span {
|
|
163
|
+
color: #a0caff !important;
|
|
164
|
+
font-weight: 700 !important;
|
|
165
|
+
}
|
|
166
|
+
.allTest:checked + .btn-all span {
|
|
167
|
+
color: #a0caff !important;
|
|
168
|
+
}
|
|
169
|
+
.allTest:checked + .btn-all {
|
|
170
|
+
color: #a0caff !important;
|
|
171
|
+
background: #fff !important;
|
|
172
|
+
border: 1px solid #a0caff !important;
|
|
173
|
+
font-weight: 700 !important;
|
|
174
|
+
}
|
|
175
|
+
.btn-passed:hover,
|
|
176
|
+
.btn-passed:focus {
|
|
177
|
+
color: #75b583 !important;
|
|
178
|
+
border: 1px solid #75b583 !important;
|
|
179
|
+
background: #fff !important;
|
|
180
|
+
font-weight: 700 !important;
|
|
181
|
+
}
|
|
182
|
+
.btn-passed:hover span,
|
|
183
|
+
.btn-passed:focus span {
|
|
184
|
+
color: #75b583 !important;
|
|
185
|
+
font-weight: 700 !important;
|
|
186
|
+
}
|
|
187
|
+
.passedTest:checked + .btn-passed span {
|
|
188
|
+
color: #75b583 !important;
|
|
189
|
+
font-weight: 700 !important;
|
|
190
|
+
}
|
|
191
|
+
.passedTest:checked + .btn-passed {
|
|
192
|
+
color: #75b583 !important;
|
|
193
|
+
border: 1px solid #75b583 !important;
|
|
194
|
+
background: #fff !important;
|
|
195
|
+
font-weight: 700 !important;
|
|
196
|
+
}
|
|
197
|
+
.btn-failed:hover,
|
|
198
|
+
.btn-failed:focus {
|
|
199
|
+
color: #ff6363 !important;
|
|
200
|
+
border: 1px solid #ff6363 !important;
|
|
201
|
+
background: #fff !important;
|
|
202
|
+
font-weight: 700 !important;
|
|
203
|
+
}
|
|
204
|
+
.btn-failed:hover span,
|
|
205
|
+
.btn-failed:focus span {
|
|
206
|
+
color: #ff6363 !important;
|
|
207
|
+
font-weight: 700 !important;
|
|
208
|
+
}
|
|
209
|
+
.failedTest:checked + .btn-failed span {
|
|
210
|
+
color: #ff6363 !important;
|
|
211
|
+
font-weight: 700 !important;
|
|
212
|
+
}
|
|
213
|
+
.failedTest:checked + .btn-failed {
|
|
214
|
+
color: #ff6363 !important;
|
|
215
|
+
border: 1px solid #ff6363 !important;
|
|
216
|
+
background: #fff !important;
|
|
217
|
+
font-weight: 700 !important;
|
|
218
|
+
}
|
|
219
|
+
.btn-skipped:hover,
|
|
220
|
+
.btn-skipped:focus {
|
|
221
|
+
color: #ffc350 !important;
|
|
222
|
+
border: 1px solid #ffc350 !important;
|
|
223
|
+
background: #fff !important;
|
|
224
|
+
font-weight: 700 !important;
|
|
225
|
+
}
|
|
226
|
+
.btn-skipped:hover span,
|
|
227
|
+
.btn-skipped:focus span {
|
|
228
|
+
color: #ffc350 !important;
|
|
229
|
+
font-weight: 700 !important;
|
|
230
|
+
}
|
|
231
|
+
.skippedTest:checked + .btn-skipped span {
|
|
232
|
+
color: #ffc350 !important;
|
|
233
|
+
font-weight: 700 !important;
|
|
234
|
+
}
|
|
235
|
+
.skippedTest:checked + .btn-skipped {
|
|
236
|
+
color: #ffc350 !important;
|
|
237
|
+
border: 1px solid #ffc350 !important;
|
|
238
|
+
background: #fff !important;
|
|
239
|
+
font-weight: 700 !important;
|
|
240
|
+
}
|
|
241
|
+
.passed {
|
|
242
|
+
color: #75b583;
|
|
243
|
+
}
|
|
244
|
+
.failed {
|
|
245
|
+
color: #ff6363;
|
|
246
|
+
}
|
|
247
|
+
.skipped {
|
|
248
|
+
color: #ffc350;
|
|
249
|
+
}
|
|
250
|
+
.testWrapp {
|
|
251
|
+
margin-top: 45px;
|
|
252
|
+
}
|
|
253
|
+
.fa-arrow-right {
|
|
254
|
+
display: none !important;
|
|
255
|
+
}
|
|
256
|
+
.header__type:hover {
|
|
257
|
+
background: #b468ff;
|
|
258
|
+
}
|
|
259
|
+
.header__case i {
|
|
260
|
+
color: grey;
|
|
261
|
+
margin-right: 5px;
|
|
262
|
+
}
|
|
263
|
+
.title {
|
|
264
|
+
display: flex;
|
|
265
|
+
margin-bottom: 20px;
|
|
266
|
+
}
|
|
267
|
+
.title p {
|
|
268
|
+
color: #262523;
|
|
269
|
+
font-size: 15px;
|
|
270
|
+
font-weight: 500;
|
|
271
|
+
margin-right: 5px;
|
|
272
|
+
}
|
|
273
|
+
.statright {
|
|
274
|
+
display: flex;
|
|
275
|
+
}
|
|
276
|
+
.statdesc {
|
|
277
|
+
display: flex;
|
|
278
|
+
flex-direction: column;
|
|
279
|
+
}
|
|
280
|
+
.statdesc__row {
|
|
281
|
+
padding: 15px 25px;
|
|
282
|
+
display: flex;
|
|
283
|
+
border-radius: 5px;
|
|
284
|
+
}
|
|
285
|
+
.statdesc__row_first {
|
|
286
|
+
width: 150px;
|
|
287
|
+
}
|
|
288
|
+
.statdesc__row:nth-child(odd) {
|
|
289
|
+
background: #f6faff;
|
|
290
|
+
}
|
|
291
|
+
.statdesc__row p,
|
|
292
|
+
.statdesc__row span {
|
|
293
|
+
font-weight: semi-bold;
|
|
294
|
+
font-size: 11px;
|
|
295
|
+
}
|
|
296
|
+
.statdesc {
|
|
297
|
+
width: 100%;
|
|
298
|
+
}
|
|
299
|
+
.statstatus {
|
|
300
|
+
display: flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
}
|
|
303
|
+
.statstatus p {
|
|
304
|
+
font-weight: bold;
|
|
305
|
+
}
|
|
306
|
+
.statstatus div {
|
|
307
|
+
font-weight: bold;
|
|
308
|
+
}
|
|
309
|
+
.statstatus_failed div {
|
|
310
|
+
width: 10px;
|
|
311
|
+
height: 10px;
|
|
312
|
+
border-radius: 50%;
|
|
313
|
+
margin-right: 5px;
|
|
314
|
+
}
|
|
315
|
+
.statstatus_failed p {
|
|
316
|
+
color: red;
|
|
317
|
+
text-transform: uppercase;
|
|
318
|
+
}
|
|
319
|
+
.statstatus_failed div {
|
|
320
|
+
background: red;
|
|
321
|
+
}
|
|
322
|
+
.statstatus_passed div {
|
|
323
|
+
width: 10px;
|
|
324
|
+
height: 10px;
|
|
325
|
+
border-radius: 50%;
|
|
326
|
+
margin-right: 5px;
|
|
327
|
+
text-transform: uppercase;
|
|
328
|
+
}
|
|
329
|
+
.statstatus_passed div {
|
|
330
|
+
background: green;
|
|
331
|
+
}
|
|
332
|
+
.statstatus_passed p {
|
|
333
|
+
color: green;
|
|
334
|
+
text-transform: uppercase;
|
|
335
|
+
}
|
|
336
|
+
.statstatus_skipped div {
|
|
337
|
+
width: 10px;
|
|
338
|
+
height: 10px;
|
|
339
|
+
border-radius: 50%;
|
|
340
|
+
margin-right: 5px;
|
|
341
|
+
text-transform: uppercase;
|
|
342
|
+
}
|
|
343
|
+
.statstatus_skipped div {
|
|
344
|
+
background: yellow;
|
|
345
|
+
}
|
|
346
|
+
.statstatus_skipped p {
|
|
347
|
+
color: yellow;
|
|
348
|
+
text-transform: uppercase;
|
|
349
|
+
}
|
|
350
|
+
.fa-magnifying-glass {
|
|
351
|
+
font-size: 24px;
|
|
352
|
+
color: gray;
|
|
353
|
+
}
|
|
354
|
+
.numTest {
|
|
355
|
+
font-weight: 500;
|
|
356
|
+
font-size: 16px;
|
|
357
|
+
color: #0d6efd;
|
|
358
|
+
}
|
|
359
|
+
.testitem {
|
|
360
|
+
border: 1px solid grey;
|
|
361
|
+
border-radius: 3px;
|
|
362
|
+
margin-bottom: 15px;
|
|
363
|
+
}
|
|
364
|
+
.testitem__top {
|
|
365
|
+
width: 100%;
|
|
366
|
+
display: flex;
|
|
367
|
+
background: #f6faff;
|
|
368
|
+
padding: 15px 13px 15px 30px;
|
|
369
|
+
border-radius: 10px;
|
|
370
|
+
cursor: pointer;
|
|
371
|
+
justify-content: space-between;
|
|
372
|
+
}
|
|
373
|
+
.testitem__icon {
|
|
374
|
+
display: flex;
|
|
375
|
+
align-items: center;
|
|
376
|
+
justify-content: center;
|
|
377
|
+
width: 30px;
|
|
378
|
+
margin-right: 5px;
|
|
379
|
+
}
|
|
380
|
+
.testitem__ico {
|
|
381
|
+
font-size: 18px;
|
|
382
|
+
}
|
|
383
|
+
.testitem__name {
|
|
384
|
+
font-weight: 700;
|
|
385
|
+
color: black;
|
|
386
|
+
font-size: 16px;
|
|
387
|
+
}
|
|
388
|
+
.testitem__body {
|
|
389
|
+
display: flex;
|
|
390
|
+
background-color: #fff;
|
|
391
|
+
margin-top: 10px;
|
|
392
|
+
}
|
|
393
|
+
.testitem__menu {
|
|
394
|
+
display: flex;
|
|
395
|
+
flex-direction: column;
|
|
396
|
+
padding: 21px 51px 21px 51px;
|
|
397
|
+
}
|
|
398
|
+
.testitem__mitem {
|
|
399
|
+
font-size: 15px;
|
|
400
|
+
font-weight: 600;
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
color: #808080;
|
|
403
|
+
width: 170px;
|
|
404
|
+
height: 65px;
|
|
405
|
+
text-align: center;
|
|
406
|
+
padding-top: 20px;
|
|
407
|
+
padding-bottom: 20px;
|
|
408
|
+
}
|
|
409
|
+
.testitem__mitem_active {
|
|
410
|
+
background: #f6faff;
|
|
411
|
+
color: #4d4c4c;
|
|
412
|
+
font-weight: 700;
|
|
413
|
+
}
|
|
414
|
+
.testitem__case {
|
|
415
|
+
display: flex;
|
|
416
|
+
flex-direction: column;
|
|
417
|
+
padding: 10px;
|
|
418
|
+
}
|
|
419
|
+
.testitem__title {
|
|
420
|
+
font-size: 18px;
|
|
421
|
+
color: black;
|
|
422
|
+
font-weight: 700;
|
|
423
|
+
margin-bottom: 15px;
|
|
424
|
+
text-decoration: underline;
|
|
425
|
+
}
|
|
426
|
+
.testitem__block p {
|
|
427
|
+
font-size: 14px;
|
|
428
|
+
white-space: pre-line;
|
|
429
|
+
}
|
|
430
|
+
.test__empty__list {
|
|
431
|
+
margin-bottom: 10px;
|
|
432
|
+
color: grey;
|
|
433
|
+
}
|
|
434
|
+
.testitem__content {
|
|
435
|
+
width: 92%;
|
|
436
|
+
} /* Pagination component styles*/
|
|
437
|
+
.page-link {
|
|
438
|
+
color: black;
|
|
439
|
+
background-color: #f6faff;
|
|
440
|
+
padding: 7px 19px;
|
|
441
|
+
font-weight: 600;
|
|
442
|
+
border-radius: 3px;
|
|
443
|
+
}
|
|
444
|
+
.page-link:hover {
|
|
445
|
+
color: black;
|
|
446
|
+
}
|
|
447
|
+
.form-select {
|
|
448
|
+
background-color: #f6faff;
|
|
449
|
+
}
|
|
450
|
+
.form-select:focus {
|
|
451
|
+
border-color: #adadad;
|
|
452
|
+
box-shadow: 0 0 0 0.25rem rgb(67 71 78 / 25%);
|
|
453
|
+
}
|
|
454
|
+
.page-item:not(:first-child) {
|
|
455
|
+
margin-left: 15px;
|
|
456
|
+
}
|
|
457
|
+
.page-item.active .page-link {
|
|
458
|
+
background: #f6faff;
|
|
459
|
+
border: 2px solid #4384fe;
|
|
460
|
+
color: black;
|
|
461
|
+
}
|
|
462
|
+
.noData {
|
|
463
|
+
display: flex;
|
|
464
|
+
align-items: center;
|
|
465
|
+
flex-direction: column;
|
|
466
|
+
justify-content: center;
|
|
467
|
+
margin-bottom: 150px;
|
|
468
|
+
}
|
|
469
|
+
.noDataText {
|
|
470
|
+
font-weight: 600;
|
|
471
|
+
font-size: 20px;
|
|
472
|
+
color: #a1a1a1;
|
|
473
|
+
}
|
|
99
474
|
</style>
|
|
100
475
|
</head>
|
|
101
476
|
|
package/lib/uploader.js
CHANGED
|
@@ -219,7 +219,7 @@ class S3Uploader {
|
|
|
219
219
|
}
|
|
220
220
|
debug('File:', filePath, 'exists, size:', (0, filesize_1.filesize)(fileSize));
|
|
221
221
|
const fileStream = fs_1.default.createReadStream(filePath);
|
|
222
|
-
const Key = pathInS3.join('/');
|
|
222
|
+
const Key = pathInS3.filter(p => !!p).join('/');
|
|
223
223
|
const link = await this.#uploadToS3(fileStream, Key, { path: filePath, size: fileSize });
|
|
224
224
|
this.storeUploadedFile(filePath, runId, rid, !!link);
|
|
225
225
|
return link;
|
|
@@ -232,7 +232,7 @@ class S3Uploader {
|
|
|
232
232
|
async uploadFileAsBuffer(buffer, pathInS3) {
|
|
233
233
|
if (!this.isEnabled)
|
|
234
234
|
return;
|
|
235
|
-
let Key = pathInS3.join('/');
|
|
235
|
+
let Key = pathInS3.filter(p => !!p).join('/');
|
|
236
236
|
const ext = this.#getFileExtBase64(buffer);
|
|
237
237
|
if (ext) {
|
|
238
238
|
Key = `${Key}.${ext}`;
|
package/lib/utils/utils.d.ts
CHANGED
package/lib/utils/utils.js
CHANGED
|
@@ -15,18 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.testRunnerHelper = exports.specificTestInfo = exports.parseSuite = exports.isValidUrl = exports.humanize = exports.getTestomatIdFromTestTitle = exports.getCurrentDateTime = exports.foundedTestLog = exports.fileSystem = exports.fetchFilesFromStackTrace = exports.fetchIdFromOutput = exports.fetchIdFromCode = exports.fetchSourceCodeFromStackTrace = exports.fetchSourceCode = exports.isSameTest = exports.ansiRegExp = void 0;
|
|
39
|
+
exports.testRunnerHelper = exports.specificTestInfo = exports.parseSuite = exports.isValidUrl = exports.humanize = exports.getTestomatIdFromTestTitle = exports.getCurrentDateTime = exports.foundedTestLog = exports.fileSystem = exports.fetchFilesFromStackTrace = exports.fetchIdFromOutput = exports.fetchIdFromCode = exports.fetchSourceCodeFromStackTrace = exports.fetchSourceCode = exports.isSameTest = exports.ansiRegExp = exports.TEST_ID_REGEX = void 0;
|
|
40
|
+
exports.getPackageVersion = getPackageVersion;
|
|
30
41
|
exports.formatStep = formatStep;
|
|
31
42
|
exports.readLatestRunId = readLatestRunId;
|
|
32
43
|
exports.removeColorCodes = removeColorCodes;
|
|
@@ -38,7 +49,12 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
38
49
|
const is_valid_path_1 = __importDefault(require("is-valid-path"));
|
|
39
50
|
const debug_1 = __importDefault(require("debug"));
|
|
40
51
|
const os_1 = __importDefault(require("os"));
|
|
52
|
+
const url_2 = require("url");
|
|
41
53
|
const debug = (0, debug_1.default)('@testomatio/reporter:util');
|
|
54
|
+
// Use __dirname directly since we're compiling to CommonJS
|
|
55
|
+
// prettier-ignore
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
// eslint-disable-next-line max-len
|
|
42
58
|
/**
|
|
43
59
|
* @param {String} testTitle - Test title
|
|
44
60
|
*
|
|
@@ -77,7 +93,6 @@ const ansiRegExp = () => {
|
|
|
77
93
|
exports.ansiRegExp = ansiRegExp;
|
|
78
94
|
const isValidUrl = s => {
|
|
79
95
|
try {
|
|
80
|
-
// eslint-disable-next-line no-new
|
|
81
96
|
new url_1.URL(s);
|
|
82
97
|
return true;
|
|
83
98
|
}
|
|
@@ -131,7 +146,7 @@ const fetchSourceCodeFromStackTrace = (stack = '') => {
|
|
|
131
146
|
.join('\n');
|
|
132
147
|
};
|
|
133
148
|
exports.fetchSourceCodeFromStackTrace = fetchSourceCodeFromStackTrace;
|
|
134
|
-
|
|
149
|
+
exports.TEST_ID_REGEX = /@T([\w\d]{8})/;
|
|
135
150
|
const fetchIdFromCode = (code, opts = {}) => {
|
|
136
151
|
const comments = code
|
|
137
152
|
.split('\n')
|
|
@@ -145,15 +160,12 @@ const fetchIdFromCode = (code, opts = {}) => {
|
|
|
145
160
|
return l.startsWith('// ');
|
|
146
161
|
}
|
|
147
162
|
});
|
|
148
|
-
return comments.find(c => c.match(TEST_ID_REGEX))?.match(TEST_ID_REGEX)?.[1];
|
|
163
|
+
return comments.find(c => c.match(exports.TEST_ID_REGEX))?.match(exports.TEST_ID_REGEX)?.[1];
|
|
149
164
|
};
|
|
150
165
|
exports.fetchIdFromCode = fetchIdFromCode;
|
|
151
166
|
const fetchIdFromOutput = output => {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
.map(l => l.trim())
|
|
155
|
-
.filter(l => l.startsWith('tid://'));
|
|
156
|
-
return lines.find(c => c.match(TEST_ID_REGEX))?.match(TEST_ID_REGEX)?.[1];
|
|
167
|
+
const TID_FULL_PATTERN = new RegExp(`tid:\\/\\/.*?(${exports.TEST_ID_REGEX.source})`);
|
|
168
|
+
return output.match(TID_FULL_PATTERN)?.[2];
|
|
157
169
|
};
|
|
158
170
|
exports.fetchIdFromOutput = fetchIdFromOutput;
|
|
159
171
|
const fetchSourceCode = (contents, opts = {}) => {
|
|
@@ -177,6 +189,12 @@ const fetchSourceCode = (contents, opts = {}) => {
|
|
|
177
189
|
if (lineIndex === -1)
|
|
178
190
|
lineIndex = lines.findIndex(l => l.includes(`${title}(`));
|
|
179
191
|
}
|
|
192
|
+
else if (opts.lang === 'csharp') {
|
|
193
|
+
if (lineIndex === -1)
|
|
194
|
+
lineIndex = lines.findIndex(l => l.includes(`public void ${title}`));
|
|
195
|
+
if (lineIndex === -1)
|
|
196
|
+
lineIndex = lines.findIndex(l => l.includes(`${title}(`));
|
|
197
|
+
}
|
|
180
198
|
else {
|
|
181
199
|
lineIndex = lines.findIndex(l => l.includes(title));
|
|
182
200
|
}
|
|
@@ -324,7 +342,6 @@ const decamelize = text => {
|
|
|
324
342
|
* @returns
|
|
325
343
|
*/
|
|
326
344
|
function removeColorCodes(input) {
|
|
327
|
-
// eslint-disable-next-line no-control-regex
|
|
328
345
|
return input.replace(/\x1b\[[0-9;]*m/g, '');
|
|
329
346
|
}
|
|
330
347
|
const testRunnerHelper = {
|
|
@@ -337,7 +354,6 @@ const testRunnerHelper = {
|
|
|
337
354
|
try {
|
|
338
355
|
// TODO: expect?.getState()?.testPath + ' ' + expect?.getState()?.currentTestName
|
|
339
356
|
// @ts-expect-error "expect" could only be defined inside Jest environement (forbidden to import it outside)
|
|
340
|
-
// eslint-disable-next-line no-undef
|
|
341
357
|
return expect?.getState()?.currentTestName;
|
|
342
358
|
}
|
|
343
359
|
catch (e) {
|
|
@@ -380,6 +396,13 @@ function formatStep(step, shift = 0) {
|
|
|
380
396
|
}
|
|
381
397
|
return lines;
|
|
382
398
|
}
|
|
399
|
+
function getPackageVersion() {
|
|
400
|
+
const packageJsonPath = path_1.default.resolve(__dirname, '../../package.json');
|
|
401
|
+
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
402
|
+
return packageJson.version;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
module.exports.getPackageVersion = getPackageVersion;
|
|
383
406
|
|
|
384
407
|
module.exports.formatStep = formatStep;
|
|
385
408
|
|