@testomatio/reporter 1.0.3 β†’ 1.0.5

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 CHANGED
@@ -12,7 +12,7 @@ Testomat.io Reporter (this npm package) supports:
12
12
  * πŸ„ Integarion with all popular [JavaScript/TypeScript frameworks](./docs/frameworks.md)
13
13
  * πŸ—„οΈ Screenshots, videos, traces [uploaded into S3 bucket](./docs/artifacts.md)
14
14
  * πŸ”Ž Stack traces and error messages
15
- * πŸ™ [GitHub](./docs/pipes.md#github-pipe) & [GitLab](./docs/pipes.md#gitlab-pipe) integration
15
+ * πŸ™ [GitHub](./docs/pipes/github.d) & [GitLab](./docs/pipes/gitlab.d) integration
16
16
  * πŸš… Realtime reports
17
17
  * πŸ—ƒοΈ Other test frameworks supported via [JUNit XML](./docs/junit.md)
18
18
  * πŸšΆβ€β™€οΈ Steps *(work in progress)*
@@ -85,13 +85,13 @@ or any [other via JUnit](./docs/junit.md) report....
85
85
 
86
86
  ### 2️⃣ Configure Reports
87
87
 
88
- * [Create report on Testomat.io](./docs/pipes.md#testomatio-pipe).
89
- * [Create brief summary report for GitHub Pull Request](./docs/pipes.md#github-pipe) πŸ‘‡
90
- * [Create brief summary report for GitLab Merge Request](./docs/pipes.md#gitlab-pipe).
91
- * [Configure other pipes](./docs/pipes.md) for other ways to process test results output.
88
+ * [Create report on Testomat.io](./docs/pipes/testomatio.md).
89
+ * [Create brief summary report for GitHub Pull Request](./docs/pipes/github.md) πŸ‘‡
90
+ * [Create brief summary report for GitLab Merge Request](./docs/pipes/gitlab.md).
91
+ * [Configure other pipes](./docs/pipes/md) for other ways to process test results output.
92
92
 
93
93
 
94
- ![GitHub report](./docs/images/github.png)
94
+ ![GitHub report](./docs/pipes/images/github.png)
95
95
 
96
96
  GitHub report published as a comment to Pull Request:
97
97
 
@@ -121,6 +121,10 @@ Bring this reporter on CI and never lose test results again!
121
121
 
122
122
  * πŸ› οΈ [Frameworks](./docs/frameworks.md)
123
123
  * β›² [Pipes](./docs/pipes.md)
124
+ * [Testomat.io](./docs/pipes/testomatio.md)
125
+ * [GitHub](./docs/pipes/github.md)
126
+ * [Gitlab](./docs/pipes/gitlab.md)
127
+ * [CSV](./docs/pipes/csv.md)
124
128
  * πŸ““ [JUnit](./docs/junit.md)
125
129
  * πŸ—„οΈ [Artifacts](./docs/artifacts.md)
126
130
  * πŸ”‚ [Workflows](./docs/workflows.md)
@@ -21,7 +21,8 @@ class GitHubPipe {
21
21
  this.token = params.GH_PAT || process.env.GH_PAT;
22
22
  this.ref = process.env.GITHUB_REF;
23
23
  this.repo = process.env.GITHUB_REPOSITORY;
24
- this.hiddenCommentData = `<!--- testomat.io report ${process.env.GITHUB_WORKFLOW || ''} -->`;
24
+ this.jobKey = `${process.env.GITHUB_WORKFLOW || ''} / ${process.env.GITHUB_JOB || ''}`;
25
+ this.hiddenCommentData = `<!--- testomat.io report ${this.jobKey} -->`;
25
26
 
26
27
  debug('GitHub Pipe: ', this.token ? 'TOKEN' : '*no token*', 'Ref:', this.ref, 'Repo:', this.repo);
27
28
 
@@ -73,35 +74,32 @@ class GitHubPipe {
73
74
  let summary = `${this.hiddenCommentData}
74
75
 
75
76
  | [![Testomat.io Report](https://avatars.githubusercontent.com/u/59105116?s=36&v=4)](https://testomat.io) | ${
76
- statusEmoji(runParams.status,)} ${runParams.status.toUpperCase()} ${statusEmoji(runParams.status)} |
77
+ statusEmoji(runParams.status,)} ${`${process.env.GITHUB_JOB} ${runParams.status}`.toUpperCase()} |
77
78
  | --- | --- |
78
79
  | Tests | βœ”οΈ **${this.tests.length}** tests run |
79
- | Summary | ${statusEmoji('failed')} **${failedCount}** failed; ${statusEmoji(
80
+ | Summary | ${failedCount ? `${statusEmoji('failed')} **${failedCount}** failed; ` : ''} ${statusEmoji(
80
81
  'passed',
81
82
  )} **${passedCount}** passed; **${statusEmoji('skipped')}** ${skippedCount} skipped |
82
- | Duration | πŸ• **${humanizeDuration(parseInt(this.tests.reduce((a, t) => a + (t.run_time || 0), 0), 10), {
83
- maxDecimalPoints: 0,
84
- })}** |
85
- `;
83
+ | Duration | πŸ• **${humanizeDuration(
84
+ parseInt(
85
+ this.tests.reduce((a, t) => a + (t.run_time || 0), 0),
86
+ 10,
87
+ ),
88
+ {
89
+ maxDecimalPoints: 0,
90
+ },
91
+ )}** |`;
92
+
86
93
  if (this.store.runUrl) {
87
- summary += `| Testomat.io Report | πŸ“Š [Run #${this.store.runId}](${this.store.runUrl}) | `;
94
+ summary += `\n| Testomat.io Report | πŸ“Š [Run #${this.store.runId}](${this.store.runUrl}) | `;
88
95
  }
89
96
  if (process.env.GITHUB_WORKFLOW) {
90
- summary += `| Workflow | πŸ—‚οΈ ${process.env.GITHUB_WORKFLOW} | `;
97
+ summary += `\n| Job | πŸ—‚οΈ [${this.jobKey}](${process.env.GITHUB_SERVER_URL || 'https://github.com'}/${
98
+ this.repo
99
+ }/actions/runs/${process.env.GITHUB_RUN_ID}) | `;
91
100
  }
92
101
  if (process.env.RUNNER_OS) {
93
- summary += `| Operating System | πŸ–₯️ \`${process.env.RUNNER_OS}\` ${process.env.RUNNER_ARCH || ''} | `;
94
- }
95
- if (process.env.GITHUB_HEAD_REF) {
96
- summary += `| Branch | 🌳 \`${process.env.GITHUB_HEAD_REF}\` | `;
97
- }
98
- if (process.env.GITHUB_RUN_ATTEMPT) {
99
- summary += `| Run Attempt | πŸŒ’ \`${process.env.GITHUB_RUN_ATTEMPT}\` | `;
100
- }
101
- if (process.env.GITHUB_RUN_ID) {
102
- summary += `| Build Log | βœ’οΈ ${process.env.GITHUB_SERVER_URL || 'https://github.com'}/${
103
- this.repo
104
- }/actions/runs/${process.env.GITHUB_RUN_ID} | `;
102
+ summary += `\n| Operating System | πŸ–₯️ \`${process.env.RUNNER_OS}\` ${process.env.RUNNER_ARCH || ''} | `;
105
103
  }
106
104
 
107
105
  const failures = this.tests
@@ -38,7 +38,8 @@ class TestomatioPipe {
38
38
  // do not finish this run (for parallel testing)
39
39
  this.proceed = process.env.TESTOMATIO_PROCEED;
40
40
  this.runId = params.runId || process.env.runId;
41
- this.createNewTests = !!process.env.TESTOMATIO_CREATE;
41
+ this.createNewTests = params.createNewTests ?? !!process.env.TESTOMATIO_CREATE;
42
+ this.hasUnmatchedTests = false;
42
43
 
43
44
  if (!isValidUrl(this.url.trim())) {
44
45
  this.isEnabled = false;
@@ -115,14 +116,17 @@ class TestomatioPipe {
115
116
  const responseData = err.response.data || { message: '' };
116
117
  console.log(
117
118
  APP_PREFIX,
118
- chalk.blue(this.title),
119
- `Report couldn't be processed: (${err.response.status}) ${responseData.message}`,
119
+ chalk.yellow(`Warning: ${responseData.message} (${err.response.status})`),
120
+ chalk.grey(data?.title || ''),
120
121
  );
122
+ if (err.response.data.message.includes('could not be matched')) {
123
+ this.hasUnmatchedTests = true;
124
+ }
121
125
  return;
122
126
  }
123
- console.log(APP_PREFIX, chalk.blue(this.title), `Report couldn't be processed: ${err.response.data.message}`);
127
+ console.log(APP_PREFIX, chalk.blue(data?.title || ''), `Report couldn't be processed: ${err.response.data.message}`);
124
128
  } else {
125
- console.log(APP_PREFIX, chalk.blue(this.title), "Report couldn't be processed", err);
129
+ console.log(APP_PREFIX, chalk.blue(data?.title || ''), "Report couldn't be processed", err);
126
130
  }
127
131
  });
128
132
  }
@@ -159,6 +163,17 @@ class TestomatioPipe {
159
163
  console.log(APP_PREFIX, `πŸ“Š ${notFinishedMessage}. Report URL: ${chalk.magenta(this.runUrl)}`);
160
164
  console.log(APP_PREFIX, `πŸ›¬ Run to finish it: TESTOMATIO_RUN=${this.runId} npx start-test-run --finish`);
161
165
  }
166
+ if (this.hasUnmatchedTests) {
167
+ console.log('');
168
+ console.log(APP_PREFIX, chalk.yellow.bold('⚠️ Some reported tests were not found in Testomat.io project'));
169
+ console.log(APP_PREFIX, `If you use Testomat.io as a reporter only, please re-run tests using ${chalk.bold('TESTOMATIO_CREATE=1')}`);
170
+ console.log(APP_PREFIX, `But to keep your tests consistent it is recommended to ${chalk.bold('import tests first')}`);
171
+ console.log(APP_PREFIX, 'If tests were imported but still not matched, assign test IDs to your tests.');
172
+ console.log(APP_PREFIX, 'You can do that automatically via command line tools:');
173
+ console.log(APP_PREFIX, chalk.bold('npx check-tests ... --update-ids'), 'See: https://bit.ly/js-update-ids');
174
+ console.log(APP_PREFIX, 'or for Cucumber:');
175
+ console.log(APP_PREFIX, chalk.bold('npx check-cucumber ... --update-ids'), 'See: https://bit.ly/bdd-update-ids');
176
+ }
162
177
  } catch (err) {
163
178
  console.log(APP_PREFIX, 'Error updating status, skipping...', err);
164
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",
package/Changelog.md DELETED
@@ -1,269 +0,0 @@
1
- <!-- pending release updates -->
2
-
3
- # 1.0.3
4
-
5
- * Fixed reporting parallel runs
6
-
7
- # 1.0.0
8
-
9
-
10
- * Added [`TESTOMATIO_SHARED_RUN` option](https://github.com/testomatio/reporter/blob/master/docs/pipes.md#reporting-parallel-execution-to-to-same-run) to use a shared run for parallel executions
11
- * Reworked [documentation](https://github.com/testomatio/reporter/tree/master#readme).
12
- * Added an option to obtain [S3 configuration](https://github.com/testomatio/reporter/blob/master/docs/artifacts.md#configuration) from Testomat.io
13
- * Introduced [pipes](https://github.com/testomatio/reporter/blob/master/docs/pipes.md):
14
- * GitHub
15
- * GitLab
16
- * CSV Pipe
17
-
18
-
19
- # 0.7.6
20
-
21
- * Updated to use AWS S3 3.0 SDK for uploading
22
-
23
- # 0.7.5
24
-
25
- * Fixed reporting skipped tests in mocha
26
-
27
- # 0.7.4
28
-
29
- * Fixed parsing source code in JUnit files
30
-
31
- # 0.7.3
32
-
33
- * CodeceptJS: Upload all traces and videos from artifacts
34
- * Fixed reporting skipped test in XML
35
- * added `--timelimit` option to `report-xml` command line
36
-
37
- # 0.7.2
38
-
39
- * Fixed uploading non-existing file
40
-
41
- # 0.7.1
42
-
43
- * Support for NUnit XML v3 format
44
-
45
- # 0.7.0
46
-
47
- * Support for `@cucumber/cucumber` (>= 7.0) added
48
- * Initial support for C# and NUnit
49
-
50
- # 0.6.10
51
-
52
- * Fixed uploading multilpe artifacts in Playwright
53
-
54
- # 0.6.9
55
-
56
- * Fixed pending tests reports for Cypress
57
-
58
- # 0.6.8
59
- # 0.6.7
60
-
61
- * Pytest: fixed creating suites from reports
62
-
63
- # 0.6.6
64
-
65
- * JUnit reporter: prefer suite title over testcase classname in a report
66
-
67
- # 0.6.5
68
-
69
- * Fixed test statuses for runs in JUnit reporter
70
-
71
- # 0.6.4
72
-
73
- * Added `TESTOMATIO_PROCEED=1` param to not close current run
74
- * Fixed priority of commands from `npx @testomatio/reporter`
75
-
76
- # 0.6.3
77
-
78
- * Fixed `npx start-test-run` to launch commands
79
-
80
- # 0.6.2
81
-
82
- * Added `--env-file` option to load env variables from env file
83
-
84
- # 0.6.1
85
-
86
- * Fixed creating RunGroup with JUnit reporter
87
-
88
- # 0.6.0
89
-
90
- * JUnit reporter support
91
-
92
- # 0.5.10
93
-
94
- * Fixed reporting Scenario Outline in Cypress-Cucumber
95
- * Fixed error reports for Cypress when running in Chrome
96
-
97
- # 0.5.9
98
-
99
- * Added environment on Cypress report
100
-
101
- # 0.5.8
102
-
103
- * Fixed Cypress.io reporting
104
-
105
- # 0.5.7
106
-
107
- * Fixed webdriverio artifacts
108
-
109
- # 0.5.6
110
-
111
- * Unmark failed CodeceptJS tests as skipped
112
-
113
- # 0.5.5
114
-
115
- * Fixed `BeforeSuite` failures in CodeceptJS
116
-
117
- # 0.5.4
118
-
119
- Added `TESTOMATIO_CREATE=1` option to create unmatched tests on report
120
-
121
- ```
122
- TESTOMATIO_CREATE=1 TESTOMATIO=apiKey npx codeceptjs run
123
- ```
124
-
125
- # 0.5.3
126
-
127
- * Fixed parsing suites
128
-
129
- # 0.5.2
130
-
131
- * Fixed multiple upload of artifacts in Cypress.io
132
-
133
- # 0.5.1
134
-
135
- * Fixed Cypress.io to report tests inside nested suites
136
-
137
- # 0.5.0
138
-
139
- * Added Cypress.io plugin
140
- * Added artifacts upload to webdriverio
141
-
142
- # 0.4.6
143
-
144
- - Fixed CodeceptJS reporter to report tests failed in hooks
145
-
146
- # 0.4.5
147
-
148
- - Fixed "Total XX artifacts publicly uploaded to S3 bucket" when no S3 bucket is configured
149
- - Improved S3 connection error messages
150
-
151
- # 0.4.4
152
-
153
- - 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.
154
-
155
- # 0.4.3
156
-
157
- - Added `TESTOMATIO_DISABLE_ARTIFACTS` env variable to disable publishing artifacts.
158
-
159
- # 0.4.2
160
-
161
- - print version of reporter
162
- - print number of uploaded artifacts
163
- - print access mode for uploaded artifacts
164
-
165
- # 0.4.1
166
-
167
- Added `global.testomatioArtifacts = []` array which can be used to add arbitrary artifacts to a report.
168
-
169
- ```js
170
- // inside a running test:
171
- global.testomatioArtifacts.push('file/to/upload.png');
172
- ```
173
-
174
- # 0.4.0
175
-
176
- - Playwright: Introduced playwright/test support with screenshots and video artifacts
177
-
178
- > Known issues: reporting using projects configured in Playwright does not work yet
179
-
180
- - CodeceptJS: added video uploads
181
-
182
- # 0.3.16
183
-
184
- - CodeceptJS: fixed reporting tests with empty steps (on retry)
185
-
186
- # 0.3.15
187
-
188
- - Finish Run via API:
189
-
190
- ```
191
- TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --finish
192
- ```
193
-
194
- # 0.3.14
195
-
196
- - Create an empty Run via API:
197
-
198
- ```
199
- TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
200
- ```
201
-
202
- # 0.3.13
203
-
204
- - Checking for a valid report URL
205
- - Sending unlimited data on test report
206
-
207
- # 0.3.12
208
-
209
- - Fixed submitting arbitrary data on a test run
210
- - Jest: fixed sending errors with stack traces
211
- - Cypress: fixed sending reports
212
-
213
- # 0.3.11
214
-
215
- - Fixed circular JSON reference when submitting data to Testomatio
216
-
217
- # 0.3.10
218
-
219
- - Minor fixes
220
-
221
- # 0.3.9
222
-
223
- - Making all reporters to run without API key
224
-
225
- # 0.3.8
226
-
227
- - Fixed `npx start-test-run` to work with empty API keys
228
-
229
- # 0.3.7
230
-
231
- - Fixed release
232
-
233
- # 0.3.6
234
-
235
- - Update title and rungroup on start for scheduled runs.
236
-
237
- # 0.3.5
238
-
239
- - Added `TESTOMATIO_RUN` environment variable to pass id of a specific run to report
240
-
241
- # 0.3.4
242
-
243
- - Minor fixes
244
-
245
- # 0.3.3
246
-
247
- - [CodeceptJS] Fixed stack trace reporting
248
- - [CodeceptJS] Fixed displaying of nested steps
249
- - [CodeceptJS][mocha] Added assertion diff to report
250
-
251
- # 0.3.2
252
-
253
- - Fixed error message for S3 uploading
254
-
255
- # 0.3.1
256
-
257
- - [CodeceptJS] Better formatter for nested structures and BDD tests
258
-
259
- # 0.3.0
260
-
261
- - Added `TESTOMATIO_TITLE` env variable to set a name for Run
262
- - Added `TESTOMATIO_RUNGROUP_TITLE` env variable to attach Run to RunGroup
263
- - Added `TESTOMATIO_ENV` env variable to attach additional env values to report
264
- - [CodeceptJS] **CodeceptJS v3 support**
265
- - [CodeceptJS] Dropped support for CodeceptJS 2
266
- - [CodeceptJS] Added support for before hooks
267
- - [CodeceptJS] Log of steps
268
- - [CodeceptJS] Upload screenshots of failed tests to S3
269
- - [CodeceptJS] Updated to use with parallel execution