@testomatio/reporter 2.1.0-beta-nightwatch → 2.1.0-beta.1-codeceptjs

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.
Files changed (80) hide show
  1. package/README.md +1 -0
  2. package/lib/adapter/codecept.js +288 -202
  3. package/lib/adapter/cypress-plugin/index.js +0 -2
  4. package/lib/adapter/mocha.js +0 -1
  5. package/lib/adapter/nightwatch.js +5 -5
  6. package/lib/adapter/playwright.js +11 -3
  7. package/lib/adapter/webdriver.d.ts +1 -1
  8. package/lib/adapter/webdriver.js +18 -8
  9. package/lib/bin/cli.js +73 -8
  10. package/lib/bin/reportXml.js +4 -2
  11. package/lib/bin/startTest.js +3 -2
  12. package/lib/bin/uploadArtifacts.js +5 -4
  13. package/lib/client.js +30 -10
  14. package/lib/data-storage.d.ts +5 -5
  15. package/lib/data-storage.js +23 -13
  16. package/lib/junit-adapter/csharp.d.ts +1 -0
  17. package/lib/junit-adapter/csharp.js +11 -1
  18. package/lib/pipe/bitbucket.d.ts +2 -0
  19. package/lib/pipe/bitbucket.js +38 -26
  20. package/lib/pipe/debug.js +27 -6
  21. package/lib/pipe/github.d.ts +2 -2
  22. package/lib/pipe/github.js +35 -3
  23. package/lib/pipe/gitlab.d.ts +2 -0
  24. package/lib/pipe/gitlab.js +27 -9
  25. package/lib/pipe/html.js +0 -3
  26. package/lib/pipe/index.js +17 -7
  27. package/lib/pipe/testomatio.d.ts +3 -2
  28. package/lib/pipe/testomatio.js +85 -75
  29. package/lib/replay.d.ts +31 -0
  30. package/lib/replay.js +255 -0
  31. package/lib/reporter-functions.d.ts +7 -0
  32. package/lib/reporter-functions.js +36 -0
  33. package/lib/reporter.d.ts +15 -12
  34. package/lib/reporter.js +4 -1
  35. package/lib/services/artifacts.d.ts +1 -1
  36. package/lib/services/index.d.ts +2 -0
  37. package/lib/services/index.js +2 -0
  38. package/lib/services/key-values.d.ts +1 -1
  39. package/lib/services/labels.d.ts +22 -0
  40. package/lib/services/labels.js +62 -0
  41. package/lib/services/logger.d.ts +1 -1
  42. package/lib/services/logger.js +1 -2
  43. package/lib/template/testomatio.hbs +443 -68
  44. package/lib/uploader.js +10 -6
  45. package/lib/utils/constants.d.ts +12 -0
  46. package/lib/utils/constants.js +15 -0
  47. package/lib/utils/utils.d.ts +10 -1
  48. package/lib/utils/utils.js +70 -22
  49. package/lib/xmlReader.js +54 -19
  50. package/package.json +16 -11
  51. package/src/adapter/codecept.js +320 -214
  52. package/src/adapter/cypress-plugin/index.js +0 -2
  53. package/src/adapter/mocha.js +0 -1
  54. package/src/adapter/nightwatch.js +1 -1
  55. package/src/adapter/playwright.js +10 -7
  56. package/src/adapter/webdriver.js +2 -2
  57. package/src/bin/cli.js +70 -2
  58. package/src/bin/reportXml.js +4 -1
  59. package/src/bin/startTest.js +2 -1
  60. package/src/bin/uploadArtifacts.js +2 -1
  61. package/src/client.js +18 -3
  62. package/src/data-storage.js +6 -6
  63. package/src/junit-adapter/csharp.js +13 -1
  64. package/src/pipe/bitbucket.js +22 -24
  65. package/src/pipe/debug.js +26 -5
  66. package/src/pipe/github.js +1 -2
  67. package/src/pipe/gitlab.js +27 -9
  68. package/src/pipe/html.js +1 -4
  69. package/src/pipe/testomatio.js +106 -105
  70. package/src/replay.js +262 -0
  71. package/src/reporter-functions.js +41 -0
  72. package/src/reporter.js +3 -0
  73. package/src/services/index.js +2 -0
  74. package/src/services/labels.js +59 -0
  75. package/src/services/logger.js +1 -2
  76. package/src/template/testomatio.hbs +443 -68
  77. package/src/uploader.js +11 -6
  78. package/src/utils/constants.js +12 -0
  79. package/src/utils/utils.js +46 -13
  80. package/src/xmlReader.js +70 -18
@@ -0,0 +1,59 @@
1
+ import createDebugMessages from 'debug';
2
+ import { dataStorage } from '../data-storage.js';
3
+
4
+ const debug = createDebugMessages('@testomatio/reporter:services-labels');
5
+ class LabelStorage {
6
+ static #instance;
7
+
8
+ /**
9
+ *
10
+ * @returns {LabelStorage}
11
+ */
12
+ static getInstance() {
13
+ if (!this.#instance) {
14
+ this.#instance = new LabelStorage();
15
+ }
16
+ return this.#instance;
17
+ }
18
+
19
+ /**
20
+ * Stores labels array and passes it to reporter
21
+ * @param {string[]} labels - array of label strings
22
+ * @param {*} context - full test title
23
+ */
24
+ put(labels, context = null) {
25
+ if (!labels || !Array.isArray(labels)) return;
26
+ dataStorage.putData('labels', labels, context);
27
+ }
28
+
29
+ /**
30
+ * Returns labels array for the test
31
+ * @param {*} context testId or test context from test runner
32
+ * @returns {string[]} labels array, e.g. ['smoke', 'severity:high', 'feature:user_account']
33
+ */
34
+ get(context = null) {
35
+ const labelsList = dataStorage.getData('labels', context);
36
+ if (!labelsList || !labelsList?.length) return [];
37
+
38
+ const allLabels = [];
39
+ for (const labels of labelsList) {
40
+ if (Array.isArray(labels)) {
41
+ allLabels.push(...labels);
42
+ } else if (typeof labels === 'string') {
43
+ try {
44
+ const parsedLabels = JSON.parse(labels);
45
+ if (Array.isArray(parsedLabels)) {
46
+ allLabels.push(...parsedLabels);
47
+ }
48
+ } catch (e) {
49
+ debug(`Error parsing labels for test ${context}`, labels);
50
+ }
51
+ }
52
+ }
53
+
54
+ // Remove duplicates
55
+ return [...new Set(allLabels)];
56
+ }
57
+ }
58
+
59
+ export const labelStorage = LabelStorage.getInstance();
@@ -93,7 +93,6 @@ class Logger {
93
93
  logs.push(arg.join(' '));
94
94
  } else {
95
95
  try {
96
- // eslint-disable-next-line no-unused-expressions
97
96
  this.prettyObjects ? logs.push(JSON.stringify(arg, null, 2)) : logs.push(JSON.stringify(arg));
98
97
  } catch (e) {
99
98
  debug('Error while stringify object', e);
@@ -123,7 +122,7 @@ class Logger {
123
122
  current +
124
123
  // strings are splitted by args when use tagged template, thus we add arg after each string
125
124
  // it looks like: `string1 arg1 string2 arg2 string3`
126
- (args[index] !== undefined // eslint-disable-line no-nested-ternary
125
+ (args[index] !== undefined
127
126
  ? typeof args[index] === 'string'
128
127
  ? args[index] // add arg as it is
129
128
  : this.#stringifyLogs(args[index]) // stringify arg
@@ -28,74 +28,449 @@
28
28
  <title>Report Testomat.io</title>
29
29
  {{/if}}
30
30
  <style>
31
- body { padding: 0; margin: 0; font-family: "Inter", sans-serif; } header, div, p, form, input, a, span, button {
32
- box-sizing: border-box; } img { width: 100%; display: block; max-width: 100%; height: auto; } p, span {
33
- font-weight: 400; font-size: 14px; color: grey; margin: 0; } .report { padding-top: 15px; } .level_1 {
34
- margin-bottom: 20px; border-bottom: 2px solid #ABABAB; padding-bottom: 20px; } .header { display: flex;
35
- justify-content: space-between; align-items: center; } .header__point { width: 8px; height: 8px; border-radius:
36
- 50%; margin-right: 15px; } .header__point_red { background: red; } .header__block { display: flex; align-items:
37
- center; } .header__case { display: flex; align-items: center; margin-right: 15px; } .header__case p {
38
- margin-right: 7px; } .header__case span { color: black; } .header__block button { margin-left: 15px; }
39
- .header__type { font-size: 15px; font-weight: 600; background: #CA95FF; color: #FFF; border-radius: 5px; padding:
40
- 5px 35px; margin-right: 15px; } .btn { box-shadow:none!important; } .btn-report { text-decoration: none;
41
- font-weight: 600; background: #CA95FF; color: #FFF!important; border-radius: 5px; padding: 9px 37px; font-size:
42
- 15px; } .run-style { color: #5D5C5D; } .run-span { font-weight: 800!important; color: #5D5C5D!important; }
43
- .btn-report:hover { background: #B468FF; } .border-none { border: none; } .level_4 { height: 53px!important; }
44
- .inputSearch:focus { box-shadow: none; border: 1px solid black!important; background: #FFF!important;
45
- border-radius: 3px; } .btn-all { border: 1px solid #A0CAFF!important; } .btn-passed { border: 1px solid
46
- #75B583!important; } .btn-failed { border: 1px solid #FF6363!important; } .btn-skipped { border: 1px solid
47
- #FFC350!important; } .btn-all:hover, .btn-all:focus { color: #A0CAFF!important; background: #FFF!important;
48
- border: 1px solid #A0CAFF!important; font-weight: 700!important; } .btn-all:hover span, .btn-all:focus span {
49
- color: #A0CAFF!important; font-weight: 700!important; } .allTest:checked + .btn-all span { color:
50
- #A0CAFF!important; } .allTest:checked + .btn-all { color:#A0CAFF!important; background: #FFF!important; border:
51
- 1px solid #A0CAFF!important; font-weight: 700!important; } .btn-passed:hover, .btn-passed:focus { color:
52
- #75B583!important; border: 1px solid #75B583!important; background: #FFF!important; font-weight: 700!important; }
53
- .btn-passed:hover span, .btn-passed:focus span { color: #75B583!important; font-weight: 700!important; }
54
- .passedTest:checked + .btn-passed span { color: #75B583!important; font-weight: 700!important; }
55
- .passedTest:checked + .btn-passed { color: #75B583!important; border: 1px solid #75B583!important; background:
56
- #FFF!important; font-weight: 700!important; } .btn-failed:hover, .btn-failed:focus { color: #FF6363!important;
57
- border: 1px solid #FF6363!important; background: #FFF!important; font-weight: 700!important; } .btn-failed:hover
58
- span, .btn-failed:focus span { color: #FF6363!important; font-weight: 700!important; } .failedTest:checked +
59
- .btn-failed span { color: #FF6363!important; font-weight: 700!important; } .failedTest:checked + .btn-failed {
60
- color: #FF6363!important; border: 1px solid #FF6363!important; background: #FFF!important; font-weight:
61
- 700!important; } .btn-skipped:hover, .btn-skipped:focus { color: #FFC350!important; border: 1px solid
62
- #FFC350!important; background: #FFF!important; font-weight: 700!important; } .btn-skipped:hover span,
63
- .btn-skipped:focus span { color: #FFC350!important; font-weight: 700!important; } .skippedTest:checked +
64
- .btn-skipped span { color: #FFC350!important; font-weight: 700!important; } .skippedTest:checked + .btn-skipped {
65
- color: #FFC350!important; border: 1px solid #FFC350!important; background: #FFF!important; font-weight:
66
- 700!important; } .passed { color: #75B583; } .failed { color: #FF6363; } .skipped { color: #FFC350; } .testWrapp {
67
- margin-top: 45px; } .fa-arrow-right { display: none!important; } .header__type:hover { background: #B468FF; }
68
- .header__case i { color: grey; margin-right: 5px; } .title { display: flex; margin-bottom: 20px; } .title p {
69
- color: #262523; font-size: 15px; font-weight: 500; margin-right: 5px; } .statright { display: flex; } .statdesc {
70
- display: flex; flex-direction: column; } .statdesc__row { padding: 15px 25px; display: flex; border-radius: 5px; }
71
- .statdesc__row_first { width: 150px; } .statdesc__row:nth-child(odd) { background: #F6FAFF; } .statdesc__row p,
72
- .statdesc__row span { font-weight: semi-bold; font-size: 11px; } .statdesc { width: 100%; } .statstatus { display:
73
- flex; align-items: center; } .statstatus p { font-weight: bold; } .statstatus div { font-weight: bold; }
74
- .statstatus_failed div { width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; } .statstatus_failed p
75
- { color: red; text-transform: uppercase; } .statstatus_failed div { background: red; } .statstatus_passed div {
76
- width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; text-transform: uppercase; } .statstatus_passed
77
- div { background: green; } .statstatus_passed p { color: green; text-transform: uppercase; } .statstatus_skipped
78
- div{ width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; text-transform: uppercase; }
79
- .statstatus_skipped div { background: yellow; } .statstatus_skipped p { color: yellow; text-transform: uppercase;
80
- } .fa-magnifying-glass { font-size: 24px; color: gray; } .numTest { font-weight: 500; font-size: 16px; color:
81
- #0D6EFD; } .testitem { border: 1px solid grey; border-radius: 3px; margin-bottom: 15px; } .testitem__top { width:
82
- 100%; display: flex; background: #F6FAFF; padding: 15px 13px 15px 30px; border-radius: 10px; cursor: pointer;
83
- justify-content: space-between; } .testitem__icon { display: flex; align-items: center; justify-content: center;
84
- width: 30px; margin-right: 5px; } .testitem__ico { font-size: 18px; } .testitem__name { font-weight: 700; color:
85
- black; font-size: 16px; } .testitem__body { display: flex; background-color: #FFF; margin-top: 10px; }
86
- .testitem__menu { display: flex; flex-direction: column; padding: 21px 51px 21px 51px; } .testitem__mitem {
87
- font-size: 15px; font-weight: 600; cursor: pointer; color: #808080; width: 170px; height: 65px; text-align:
88
- center; padding-top: 20px; padding-bottom: 20px; } .testitem__mitem_active { background: #F6FAFF; color: #4D4C4C;
89
- font-weight: 700; } .testitem__case { display: flex; flex-direction: column; padding: 10px; } .testitem__title {
90
- font-size: 18px; color: black; font-weight: 700; margin-bottom: 15px; text-decoration: underline; }
91
- .testitem__block p { font-size: 14px; white-space: pre-line; } .test__empty__list { margin-bottom: 10px; color:
92
- grey; } .testitem__content { width: 92%; } /* Pagination component styles*/ .page-link { color: black;
93
- background-color: #F6FAFF; padding: 7px 19px; font-weight: 600; border-radius: 3px; } .page-link:hover { color:
94
- black; } .form-select { background-color:#F6FAFF; } .form-select:focus { border-color: #ADADAD; box-shadow: 0 0 0
95
- 0.25rem rgb(67 71 78 / 25%); } .page-item:not(:first-child) { margin-left: 15px; } .page-item.active .page-link {
96
- background: #F6FAFF; border: 2px solid #4384FE; color: black; } .noData { display: flex; align-items: center;
97
- flex-direction: column; justify-content: center; margin-bottom: 150px; } .noDataText { font-weight: 600;
98
- font-size: 20px; color: #A1A1A1; }
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/src/uploader.js CHANGED
@@ -128,7 +128,7 @@ export class S3Uploader {
128
128
 
129
129
  const link = await this.getS3LocationLink(upload);
130
130
  this.successfulUploads.push({ path: file.path, size: file.size, link });
131
- debug(`📤 Uploaded artifact. File: ${file.path}, size: ${prettyBytes(file.size)}, link: ${link}`);
131
+ debug(`📤 Uploaded artifact. File: ${file.path}, size: ${prettyBytes(file.size || 0)}, link: ${link}`);
132
132
  return link;
133
133
  } catch (e) {
134
134
  this.failedUploads.push({ path: file.path, size: file.size });
@@ -205,7 +205,8 @@ export class S3Uploader {
205
205
  * @returns
206
206
  */
207
207
  async uploadFileByPath(filePath, pathInS3) {
208
- // sometimes artifacts uploading started before createRun function completion
208
+ /* WDIO: some artifacts uploading started before createRun function completion
209
+ probably, the reason is that run is NOT created in adapter (but via cli) */
209
210
  this.isEnabled = this.isEnabled ?? this.checkEnabled();
210
211
 
211
212
  const [runId, rid] = pathInS3;
@@ -217,7 +218,7 @@ export class S3Uploader {
217
218
 
218
219
  try {
219
220
  // file may not exist
220
- fileSize = fs.statSync(filePath).size;
221
+ fileSize = fs.statSync(filePath).size || 0;
221
222
  fileSizeInMb = Number((fileSize / (1024 * 1024)).toFixed(2));
222
223
  } catch (e) {
223
224
  debug(`File ${filePath} does not exist`);
@@ -255,7 +256,7 @@ export class S3Uploader {
255
256
  debug('File:', filePath, 'exists, size:', prettyBytes(fileSize));
256
257
 
257
258
  const fileStream = fs.createReadStream(filePath);
258
- const Key = pathInS3.join('/');
259
+ const Key = pathInS3.filter(p => !!p).join('/');
259
260
 
260
261
  const link = await this.#uploadToS3(fileStream, Key, { path: filePath, size: fileSize });
261
262
 
@@ -270,10 +271,14 @@ export class S3Uploader {
270
271
  * @returns
271
272
  */
272
273
  async uploadFileAsBuffer(buffer, pathInS3) {
274
+ /* WDIO: some artifacts uploading started before createRun function completion
275
+ probably, the reason is that run is NOT created in adapter (but via cli) */
276
+
277
+ this.isEnabled = this.isEnabled ?? this.checkEnabled();
273
278
  if (!this.isEnabled) return;
274
279
 
275
- let Key = pathInS3.join('/');
276
- const ext = this.#getFileExtBase64(buffer);
280
+ let Key = pathInS3.filter(p => !!p).join('/');
281
+ const ext = this.#getFileExtBase64(buffer.toString('base64'));
277
282
 
278
283
  if (ext) {
279
284
  Key = `${Key}.${ext}`;
@@ -0,0 +1,12 @@
1
+ export const extensionMap = {
2
+ 'application/json': 'json',
3
+ 'text/plain': 'txt',
4
+ 'image/jpeg': 'jpg',
5
+ 'image/png': 'png',
6
+ 'text/html': 'html',
7
+ 'text/css': 'css',
8
+ 'text/javascript': 'js',
9
+ 'application/pdf': 'pdf',
10
+ 'application/xml': 'xml',
11
+ 'text/xml': 'xml',
12
+ };