@testomatio/reporter 0.8.2-beta.1 → 0.8.3

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.
@@ -32,8 +32,8 @@ function getConfig() {
32
32
  }
33
33
 
34
34
  function getMaskedConfig() {
35
- const config = getConfig();
36
- return Object.fromEntries(Object.entries(config).map(([key, value]) => [key, key === 'S3_SECRET_ACCESS_KEY' || key === 'S3_ACCESS_KEY_ID' ? '***' : value]));
35
+ return Object.fromEntries(Object.entries(getConfig())
36
+ .map(([key, value]) => [key, key === 'S3_SECRET_ACCESS_KEY' || key === 'S3_ACCESS_KEY_ID' ? '***' : value]));
37
37
  }
38
38
 
39
39
  let isEnabled;
@@ -111,6 +111,7 @@ const fileData = fs.readFileSync(filePath);
111
111
  Bucket: S3_BUCKET,
112
112
  Key,
113
113
  Body: fileData,
114
+ ContentType,
114
115
  ACL,
115
116
  };
116
117
 
@@ -126,7 +127,7 @@ const fileData = fs.readFileSync(filePath);
126
127
  return out.singleUploadResult.Location;
127
128
  } catch (e) {
128
129
  console.log(e);
129
- console.log(APP_PREFIX, chalk.bold.red(`Failed uploading '${Key}'. Please check S3 credentials`), getMaskedConfig());
130
+ console.log(APP_PREFIX, chalk.red(`Failed uploading '${Key}'. Please check S3 credentials`), getMaskedConfig());
130
131
 
131
132
  console.log(APP_PREFIX, `To ${chalk.bold('disable')} artifact uploads set: TESTOMATIO_DISABLE_ARTIFACTS=1`);
132
133
  if (!TESTOMATIO_PRIVATE_ARTIFACTS) {
package/lib/pipe/csv.js CHANGED
@@ -18,11 +18,11 @@ class CsvPipe {
18
18
  constructor(params, store) {
19
19
  this.store = store || {};
20
20
  this.title = params.title || process.env.TESTOMATIO_TITLE;
21
- this.isEnabled = true;
22
21
  this.results = [];
23
22
 
24
23
  this.outputDir = 'export';
25
24
  this.csvFilename = process.env.TESTOMATIO_CSV_FILENAME;
25
+ this.isEnabled = !!this.csvFilename
26
26
  this.isCsvSave = false;
27
27
 
28
28
  if (this.csvFilename !== undefined && this.csvFilename.split('.').length > 0) {
@@ -79,7 +79,9 @@ class GitHubPipe {
79
79
  | Summary | ${statusEmoji('failed')} **${failedCount}** failed; ${statusEmoji(
80
80
  'passed',
81
81
  )} **${passedCount}** passed; **${statusEmoji('skipped')}** ${skippedCount} skipped |
82
- | Duration | 🕐 **${humanizeDuration(parseFloat(this.tests.reduce((a, t) => a + (t.run_time || 0), 0)))}** |
82
+ | Duration | 🕐 **${humanizeDuration(parseInt(this.tests.reduce((a, t) => a + (t.run_time || 0), 0), 10), {
83
+ maxDecimalPoints: 0,
84
+ })}** |
83
85
  `;
84
86
  if (this.store.runUrl) {
85
87
  summary += `| Testomat.io Report | 📊 [Run #${this.store.runId}](${this.store.runUrl}) | `;
@@ -154,7 +156,6 @@ class GitHubPipe {
154
156
  .join('\n');
155
157
  body += '\n</details>';
156
158
  }
157
-
158
159
 
159
160
  await deletePreviousReport(this.octokit, owner, repo, this.issue, this.hiddenCommentData);
160
161
 
@@ -81,7 +81,9 @@ class GitLabPipe {
81
81
  | Summary | ${statusEmoji('failed')} **${failedCount}** failed; ${statusEmoji(
82
82
  'passed',
83
83
  )} **${passedCount}** passed; **${statusEmoji('skipped')}** ${skippedCount} skipped |
84
- | Duration | 🕐 **${humanizeDuration(parseFloat(this.tests.reduce((a, t) => a + (t.run_time || 0), 0)))}** |
84
+ | Duration | 🕐 **${humanizeDuration(parseInt(this.tests.reduce((a, t) => a + (t.run_time || 0), 0), 10), {
85
+ maxDecimalPoints: 0,
86
+ })}** |
85
87
  `;
86
88
 
87
89
  if (this.ENV.CI_JOB_NAME && this.ENV.CI_JOB_ID) {
package/lib/xmlReader.js CHANGED
@@ -144,8 +144,9 @@ class XmlReader {
144
144
  if (!Array.isArray(result)) result = [result].filter(d => !!d);
145
145
 
146
146
  const results = result.map(td => ({
147
- id: td.executionId,
148
- run_time: parseFloat(td.duration),
147
+ id: td.executionId,
148
+ // seconds are used in junit reports, but ms are used by testomatio
149
+ run_time: parseFloat(td.duration) * 1000,
149
150
  status: td.outcome,
150
151
  stack: td.Output.StdOut,
151
152
  files: td?.ResultFiles?.ResultFile?.map(rf => rf.path)
@@ -278,7 +279,7 @@ class XmlReader {
278
279
  async uploadArtifacts() {
279
280
  for (const test of this.tests.filter(t => !!t.stack)) {
280
281
  let files = [];
281
- if (test.files.length) files = test.files.map(f => path.join(process.cwd(), f))
282
+ if (test.files?.length) files = test.files.map(f => path.join(process.cwd(), f))
282
283
  files = [...files, ...fetchFilesFromStackTrace(test.stack)];
283
284
  debug('Uploading files', files)
284
285
  test.artifacts = await Promise.all(files.map(f => upload.uploadFileByPath(f, this.runId)));
@@ -361,7 +362,8 @@ function reduceTestCases(prev, item) {
361
362
  stack,
362
363
  message,
363
364
  line: testCaseItem.lineno,
364
- run_time: parseFloat(testCaseItem.time || testCaseItem.duration),
365
+ // seconds are used in junit reports, but ms are used by testomatio
366
+ run_time: parseFloat(testCaseItem.time || testCaseItem.duration) * 1000,
365
367
  status,
366
368
  title: testCaseItem.name,
367
369
  suite_title: reduceOptions.preferClassname ? testCaseItem.classname : (item.name || testCaseItem.classname),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "0.8.2-beta.1",
3
+ "version": "0.8.3",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",
package/Changelog.md DELETED
@@ -1,251 +0,0 @@
1
- # 0.7.6
2
-
3
- * Updated to use AWS S3 3.0 SDK for uploading
4
-
5
- # 0.7.5
6
-
7
- * Fixed reporting skipped tests in mocha
8
-
9
- # 0.7.4
10
-
11
- * Fixed parsing source code in JUnit files
12
-
13
- # 0.7.3
14
-
15
- * CodeceptJS: Upload all traces and videos from artifacts
16
- * Fixed reporting skipped test in XML
17
- * added `--timelimit` option to `report-xml` command line
18
-
19
- # 0.7.2
20
-
21
- * Fixed uploading non-existing file
22
-
23
- # 0.7.1
24
-
25
- * Support for NUnit XML v3 format
26
-
27
- # 0.7.0
28
-
29
- * Support for `@cucumber/cucumber` (>= 7.0) added
30
- * Initial support for C# and NUnit
31
-
32
- # 0.6.10
33
-
34
- * Fixed uploading multilpe artifacts in Playwright
35
-
36
- # 0.6.9
37
-
38
- * Fixed pending tests reports for Cypress
39
-
40
- # 0.6.8
41
- # 0.6.7
42
-
43
- * Pytest: fixed creating suites from reports
44
-
45
- # 0.6.6
46
-
47
- * JUnit reporter: prefer suite title over testcase classname in a report
48
-
49
- # 0.6.5
50
-
51
- * Fixed test statuses for runs in JUnit reporter
52
-
53
- # 0.6.4
54
-
55
- * Added `TESTOMATIO_PROCEED=1` param to not close current run
56
- * Fixed priority of commands from `npx @testomatio/reporter`
57
-
58
- # 0.6.3
59
-
60
- * Fixed `npx start-test-run` to launch commands
61
-
62
- # 0.6.2
63
-
64
- * Added `--env-file` option to load env variables from env file
65
-
66
- # 0.6.1
67
-
68
- * Fixed creating RunGroup with JUnit reporter
69
-
70
- # 0.6.0
71
-
72
- * JUnit reporter support
73
-
74
- # 0.5.10
75
-
76
- * Fixed reporting Scenario Outline in Cypress-Cucumber
77
- * Fixed error reports for Cypress when running in Chrome
78
-
79
- # 0.5.9
80
-
81
- * Added environment on Cypress report
82
-
83
- # 0.5.8
84
-
85
- * Fixed Cypress.io reporting
86
-
87
- # 0.5.7
88
-
89
- * Fixed webdriverio artifacts
90
-
91
- # 0.5.6
92
-
93
- * Unmark failed CodeceptJS tests as skipped
94
-
95
- # 0.5.5
96
-
97
- * Fixed `BeforeSuite` failures in CodeceptJS
98
-
99
- # 0.5.4
100
-
101
- Added `TESTOMATIO_CREATE=1` option to create unmatched tests on report
102
-
103
- ```
104
- TESTOMATIO_CREATE=1 TESTOMATIO=apiKey npx codeceptjs run
105
- ```
106
-
107
- # 0.5.3
108
-
109
- * Fixed parsing suites
110
-
111
- # 0.5.2
112
-
113
- * Fixed multiple upload of artifacts in Cypress.io
114
-
115
- # 0.5.1
116
-
117
- * Fixed Cypress.io to report tests inside nested suites
118
-
119
- # 0.5.0
120
-
121
- * Added Cypress.io plugin
122
- * Added artifacts upload to webdriverio
123
-
124
- # 0.4.6
125
-
126
- - Fixed CodeceptJS reporter to report tests failed in hooks
127
-
128
- # 0.4.5
129
-
130
- - Fixed "Total XX artifacts publicly uploaded to S3 bucket" when no S3 bucket is configured
131
- - Improved S3 connection error messages
132
-
133
- # 0.4.4
134
-
135
- - Fixed returning 0 exit code when a process fails when running tests in parallel via `start-test-run`. Previously was using the last exit code returned by a process. Currently prefers the highest exit code that was returned by a process.
136
-
137
- # 0.4.3
138
-
139
- - Added `TESTOMATIO_DISABLE_ARTIFACTS` env variable to disable publishing artifacts.
140
-
141
- # 0.4.2
142
-
143
- - print version of reporter
144
- - print number of uploaded artifacts
145
- - print access mode for uploaded artifacts
146
-
147
- # 0.4.1
148
-
149
- Added `global.testomatioArtifacts = []` array which can be used to add arbitrary artifacts to a report.
150
-
151
- ```js
152
- // inside a running test:
153
- global.testomatioArtifacts.push('file/to/upload.png');
154
- ```
155
-
156
- # 0.4.0
157
-
158
- - Playwright: Introduced playwright/test support with screenshots and video artifacts
159
-
160
- > Known issues: reporting using projects configured in Playwright does not work yet
161
-
162
- - CodeceptJS: added video uploads
163
-
164
- # 0.3.16
165
-
166
- - CodeceptJS: fixed reporting tests with empty steps (on retry)
167
-
168
- # 0.3.15
169
-
170
- - Finish Run via API:
171
-
172
- ```
173
- TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --finish
174
- ```
175
-
176
- # 0.3.14
177
-
178
- - Create an empty Run via API:
179
-
180
- ```
181
- TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
182
- ```
183
-
184
- # 0.3.13
185
-
186
- - Checking for a valid report URL
187
- - Sending unlimited data on test report
188
-
189
- # 0.3.12
190
-
191
- - Fixed submitting arbitrary data on a test run
192
- - Jest: fixed sending errors with stack traces
193
- - Cypress: fixed sending reports
194
-
195
- # 0.3.11
196
-
197
- - Fixed circular JSON reference when submitting data to Testomatio
198
-
199
- # 0.3.10
200
-
201
- - Minor fixes
202
-
203
- # 0.3.9
204
-
205
- - Making all reporters to run without API key
206
-
207
- # 0.3.8
208
-
209
- - Fixed `npx start-test-run` to work with empty API keys
210
-
211
- # 0.3.7
212
-
213
- - Fixed release
214
-
215
- # 0.3.6
216
-
217
- - Update title and rungroup on start for scheduled runs.
218
-
219
- # 0.3.5
220
-
221
- - Added `TESTOMATIO_RUN` environment variable to pass id of a specific run to report
222
-
223
- # 0.3.4
224
-
225
- - Minor fixes
226
-
227
- # 0.3.3
228
-
229
- - [CodeceptJS] Fixed stack trace reporting
230
- - [CodeceptJS] Fixed displaying of nested steps
231
- - [CodeceptJS][mocha] Added assertion diff to report
232
-
233
- # 0.3.2
234
-
235
- - Fixed error message for S3 uploading
236
-
237
- # 0.3.1
238
-
239
- - [CodeceptJS] Better formatter for nested structures and BDD tests
240
-
241
- # 0.3.0
242
-
243
- - Added `TESTOMATIO_TITLE` env variable to set a name for Run
244
- - Added `TESTOMATIO_RUNGROUP_TITLE` env variable to attach Run to RunGroup
245
- - Added `TESTOMATIO_ENV` env variable to attach additional env values to report
246
- - [CodeceptJS] **CodeceptJS v3 support**
247
- - [CodeceptJS] Dropped support for CodeceptJS 2
248
- - [CodeceptJS] Added support for before hooks
249
- - [CodeceptJS] Log of steps
250
- - [CodeceptJS] Upload screenshots of failed tests to S3
251
- - [CodeceptJS] Updated to use with parallel execution