@testomatio/reporter 1.0.15 β†’ 1.0.16

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
@@ -11,12 +11,12 @@ Testomat.io Reporter (this npm package) supports:
11
11
 
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
- * πŸ”Ž Stack traces and error messages
15
- * πŸ™ [GitHub](./docs/pipes/github.d) & [GitLab](./docs/pipes/gitlab.d) integration
14
+ * πŸ”Ž [Stack traces](./docs/stacktrace.md) and error messages
15
+ * πŸ™ [GitHub](./docs/pipes/github.md) & [GitLab](./docs/pipes/gitlab.md) integration
16
16
  * πŸš… Realtime reports
17
17
  * πŸ—ƒοΈ Other test frameworks supported via [JUNit XML](./docs/junit.md)
18
18
  * πŸšΆβ€β™€οΈ Steps *(work in progress)*
19
- * πŸ“„ Logger *(work in progress, supports Jest for now)*
19
+ * πŸ“„ [Logger](./docs/logger.md) *(work in progress, supports Jest for now)*
20
20
  * ☁️ Custom properties and metadata *(work in progress)*
21
21
  * πŸ’― Free & open-source.
22
22
  * πŸ“Š Public and private Run reports on cloud via [Testomat.io App](https://testomat.io) πŸ‘‡
@@ -128,7 +128,7 @@ Bring this reporter on CI and never lose test results again!
128
128
  * πŸ““ [JUnit](./docs/junit.md)
129
129
  * πŸ—„οΈ [Artifacts](./docs/artifacts.md)
130
130
  * πŸ”‚ [Workflows](./docs/workflows.md)
131
- * πŸ”‚ [Logger](./docs/logger.md)
131
+ * πŸ–ŠοΈ [Logger](./docs/logger.md)
132
132
 
133
133
  ## Development
134
134
 
@@ -42,12 +42,21 @@ class JestReporter {
42
42
  steps = failureMessages[0];
43
43
  }
44
44
  const testId = parseTest(title);
45
+ let suite_title;
46
+ // this is test without a suite
47
+ if (result.fullName === result.title) {
48
+ suite_title = testResult.testFilePath.split('/').pop();
49
+ } else {
50
+ suite_title = result.fullName.replace(result.title, '');
51
+ }
52
+
45
53
  const deducedStatus = status === 'pending' ? 'skipped' : status;
46
54
  // In jest if test is not matched with test name pattern it is considered as skipped.
47
55
  // So adding a check if it is skipped for real or because of test pattern
48
56
  if (!this._globalConfig.testNamePattern || deducedStatus !== 'skipped') {
49
57
  this.client.addTestRun(deducedStatus, {
50
58
  test_id: testId,
59
+ suite_title,
51
60
  error,
52
61
  steps,
53
62
  title,
package/lib/client.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const debug = require('debug')('@testomatio/reporter:client');
2
2
  const createCallsiteRecord = require('callsite-record');
3
3
  const { sep, join } = require('path');
4
+ const { minimatch } = require('minimatch')
4
5
  const fs = require('fs');
5
6
  const chalk = require('chalk');
6
7
  const { randomUUID } = require('crypto');
@@ -270,17 +271,21 @@ class Client {
270
271
  stack += '\n\n';
271
272
  }
272
273
 
274
+ const customFilter = process.env.TESTOMATIO_STACK_FILTER;
275
+
273
276
  try {
277
+ let hasFrame = false;
274
278
  const record = createCallsiteRecord({
275
279
  forError: error,
280
+ isCallsiteFrame: frame => {
281
+ if (customFilter && minimatch(frame.getFileName(), customFilter)) return false;
282
+ if (hasFrame) return false;
283
+ if (isNotInternalFrame(frame)) hasFrame = true;
284
+ return hasFrame;
285
+ }
276
286
  });
277
287
  if (record && !record.filename.startsWith('http')) {
278
- stack += record.renderSync({
279
- stackFilter: frame =>
280
- frame.getFileName().indexOf(sep) > -1 &&
281
- frame.getFileName().indexOf('node_modules') < 0 &&
282
- frame.getFileName().indexOf('internal') < 0,
283
- });
288
+ stack += record.renderSync({ stackFilter: isNotInternalFrame });
284
289
  }
285
290
  return stack;
286
291
  } catch (e) {
@@ -289,4 +294,10 @@ class Client {
289
294
  }
290
295
  }
291
296
 
297
+ function isNotInternalFrame(frame) {
298
+ return frame.getFileName().includes(sep) &&
299
+ !frame.getFileName().includes('node_modules') &&
300
+ !frame.getFileName().includes('internal')
301
+ }
302
+
292
303
  module.exports = Client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",
@@ -20,13 +20,14 @@
20
20
  "debug": "^4.3.4",
21
21
  "dotenv": "^16.0.1",
22
22
  "fast-xml-parser": "^4.0.8",
23
- "glob": "^8.0.3",
23
+ "glob": "^10.3",
24
24
  "has-flag": "^5.0.1",
25
25
  "humanize-duration": "^3.27.3",
26
26
  "is-valid-path": "^0.1.1",
27
27
  "json-cycle": "^1.3.0",
28
28
  "lodash.memoize": "^4.1.2",
29
29
  "lodash.merge": "^4.6.2",
30
+ "minimatch": "^9.0.3",
30
31
  "uuid": "^9.0.0"
31
32
  },
32
33
  "files": [
package/Changelog.md DELETED
@@ -1,342 +0,0 @@
1
- <!-- pending release updates -->
2
- # 1.0.15
3
-
4
- * Attach Run to Jira Issue via `TESTOMATIO_JIRA_ID` env variable:
5
-
6
- ```
7
- TESTOMATIO_JIRA_ID=TST-12 <actual run command>
8
- ```
9
-
10
- * Mocha - removed requirement of TESTOMATIO API Key
11
-
12
- # 1.0.14
13
-
14
- * Execute tests by tag names. Use this filter to select tests associated with specific tags.
15
-
16
- ```bash
17
- TESTOMATIO={API_KEY} npx start-test-run -c 'actual run command' --filter 'testomatio:tag-name=smoke'
18
- ```
19
-
20
- * more instruction you can find in docs/pipes/testomatio.md
21
-
22
- # 1.0.13
23
-
24
- * JUnit improvements
25
- * Match test from source code by adding Test ID as a comment:
26
-
27
- ```java
28
- // @T8acca9eb
29
- ```
30
- * Match test from output by adding Test ID as output:
31
-
32
- ```java
33
- System.out.println("tid://@T8acca9eb");
34
- ```
35
- * Support for suite before and after output
36
- * Improved support for artifacts
37
-
38
- # 1.0.12
39
-
40
- & Logger refactoring by @olexandr13 in #208
41
- * fix undefined logs by @olexandr13 in #210
42
-
43
- # 1.0.11
44
-
45
- * fix steps duplication for codecept report by @olexandr13 in #209
46
-
47
- # 1.0.10
48
-
49
- * Added `TESTOMATIO_PUBLISH=1` variable to automatically publish run report
50
-
51
- # 1.0.9
52
-
53
- * Support XUnit format
54
- * Improved support for parametrized Java tests
55
-
56
- # 1.0.8
57
-
58
- * Fixed `Can't read push of undefined` when logging steps
59
-
60
- # 1.0.6
61
-
62
- * Testomat.io. Auto-detect current build url and report it to Testomat.io. Manually url can be set with `BUILD_URL` variable:
63
-
64
- ```
65
- BUILD_URL=https://.... TESTOMATIO=apiKey <actual test command>
66
- ```
67
-
68
- # 1.0.5
69
-
70
- * Fix "create tests" params processing for testomatio pipe
71
-
72
- # 1.0.4
73
-
74
- * Fixed parallel run
75
-
76
- # 1.0.3
77
-
78
- * Fixed reporting parallel runs
79
-
80
- # 1.0.0
81
-
82
-
83
- * 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
84
- * Reworked [documentation](https://github.com/testomatio/reporter/tree/master#readme).
85
- * Added an option to obtain [S3 configuration](https://github.com/testomatio/reporter/blob/master/docs/artifacts.md#configuration) from Testomat.io
86
- * Introduced [pipes](https://github.com/testomatio/reporter/blob/master/docs/pipes.md):
87
- * GitHub
88
- * GitLab
89
- * CSV Pipe
90
-
91
-
92
- # 0.7.6
93
-
94
- * Updated to use AWS S3 3.0 SDK for uploading
95
-
96
- # 0.7.5
97
-
98
- * Fixed reporting skipped tests in mocha
99
-
100
- # 0.7.4
101
-
102
- * Fixed parsing source code in JUnit files
103
-
104
- # 0.7.3
105
-
106
- * CodeceptJS: Upload all traces and videos from artifacts
107
- * Fixed reporting skipped test in XML
108
- * added `--timelimit` option to `report-xml` command line
109
-
110
- # 0.7.2
111
-
112
- * Fixed uploading non-existing file
113
-
114
- # 0.7.1
115
-
116
- * Support for NUnit XML v3 format
117
-
118
- # 0.7.0
119
-
120
- * Support for `@cucumber/cucumber` (>= 7.0) added
121
- * Initial support for C# and NUnit
122
-
123
- # 0.6.10
124
-
125
- * Fixed uploading multilpe artifacts in Playwright
126
-
127
- # 0.6.9
128
-
129
- * Fixed pending tests reports for Cypress
130
-
131
- # 0.6.8
132
- # 0.6.7
133
-
134
- * Pytest: fixed creating suites from reports
135
-
136
- # 0.6.6
137
-
138
- * JUnit reporter: prefer suite title over testcase classname in a report
139
-
140
- # 0.6.5
141
-
142
- * Fixed test statuses for runs in JUnit reporter
143
-
144
- # 0.6.4
145
-
146
- * Added `TESTOMATIO_PROCEED=1` param to not close current run
147
- * Fixed priority of commands from `npx @testomatio/reporter`
148
-
149
- # 0.6.3
150
-
151
- * Fixed `npx start-test-run` to launch commands
152
-
153
- # 0.6.2
154
-
155
- * Added `--env-file` option to load env variables from env file
156
-
157
- # 0.6.1
158
-
159
- * Fixed creating RunGroup with JUnit reporter
160
-
161
- # 0.6.0
162
-
163
- * JUnit reporter support
164
-
165
- # 0.5.10
166
-
167
- * Fixed reporting Scenario Outline in Cypress-Cucumber
168
- * Fixed error reports for Cypress when running in Chrome
169
-
170
- # 0.5.9
171
-
172
- * Added environment on Cypress report
173
-
174
- # 0.5.8
175
-
176
- * Fixed Cypress.io reporting
177
-
178
- # 0.5.7
179
-
180
- * Fixed webdriverio artifacts
181
-
182
- # 0.5.6
183
-
184
- * Unmark failed CodeceptJS tests as skipped
185
-
186
- # 0.5.5
187
-
188
- * Fixed `BeforeSuite` failures in CodeceptJS
189
-
190
- # 0.5.4
191
-
192
- Added `TESTOMATIO_CREATE=1` option to create unmatched tests on report
193
-
194
- ```
195
- TESTOMATIO_CREATE=1 TESTOMATIO=apiKey npx codeceptjs run
196
- ```
197
-
198
- # 0.5.3
199
-
200
- * Fixed parsing suites
201
-
202
- # 0.5.2
203
-
204
- * Fixed multiple upload of artifacts in Cypress.io
205
-
206
- # 0.5.1
207
-
208
- * Fixed Cypress.io to report tests inside nested suites
209
-
210
- # 0.5.0
211
-
212
- * Added Cypress.io plugin
213
- * Added artifacts upload to webdriverio
214
-
215
- # 0.4.6
216
-
217
- - Fixed CodeceptJS reporter to report tests failed in hooks
218
-
219
- # 0.4.5
220
-
221
- - Fixed "Total XX artifacts publicly uploaded to S3 bucket" when no S3 bucket is configured
222
- - Improved S3 connection error messages
223
-
224
- # 0.4.4
225
-
226
- - 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.
227
-
228
- # 0.4.3
229
-
230
- - Added `TESTOMATIO_DISABLE_ARTIFACTS` env variable to disable publishing artifacts.
231
-
232
- # 0.4.2
233
-
234
- - print version of reporter
235
- - print number of uploaded artifacts
236
- - print access mode for uploaded artifacts
237
-
238
- # 0.4.1
239
-
240
- Added `global.testomatioArtifacts = []` array which can be used to add arbitrary artifacts to a report.
241
-
242
- ```js
243
- // inside a running test:
244
- global.testomatioArtifacts.push('file/to/upload.png');
245
- ```
246
-
247
- # 0.4.0
248
-
249
- - Playwright: Introduced playwright/test support with screenshots and video artifacts
250
-
251
- > Known issues: reporting using projects configured in Playwright does not work yet
252
-
253
- - CodeceptJS: added video uploads
254
-
255
- # 0.3.16
256
-
257
- - CodeceptJS: fixed reporting tests with empty steps (on retry)
258
-
259
- # 0.3.15
260
-
261
- - Finish Run via API:
262
-
263
- ```
264
- TESTOMATIO={apiKey} TESTOMATIO_RUN={runId} npx @testomatio/reporter@latest --finish
265
- ```
266
-
267
- # 0.3.14
268
-
269
- - Create an empty Run via API:
270
-
271
- ```
272
- TESTOMATIO={apiKey} npx @testomatio/reporter@latest --launch
273
- ```
274
-
275
- # 0.3.13
276
-
277
- - Checking for a valid report URL
278
- - Sending unlimited data on test report
279
-
280
- # 0.3.12
281
-
282
- - Fixed submitting arbitrary data on a test run
283
- - Jest: fixed sending errors with stack traces
284
- - Cypress: fixed sending reports
285
-
286
- # 0.3.11
287
-
288
- - Fixed circular JSON reference when submitting data to Testomatio
289
-
290
- # 0.3.10
291
-
292
- - Minor fixes
293
-
294
- # 0.3.9
295
-
296
- - Making all reporters to run without API key
297
-
298
- # 0.3.8
299
-
300
- - Fixed `npx start-test-run` to work with empty API keys
301
-
302
- # 0.3.7
303
-
304
- - Fixed release
305
-
306
- # 0.3.6
307
-
308
- - Update title and rungroup on start for scheduled runs.
309
-
310
- # 0.3.5
311
-
312
- - Added `TESTOMATIO_RUN` environment variable to pass id of a specific run to report
313
-
314
- # 0.3.4
315
-
316
- - Minor fixes
317
-
318
- # 0.3.3
319
-
320
- - [CodeceptJS] Fixed stack trace reporting
321
- - [CodeceptJS] Fixed displaying of nested steps
322
- - [CodeceptJS][mocha] Added assertion diff to report
323
-
324
- # 0.3.2
325
-
326
- - Fixed error message for S3 uploading
327
-
328
- # 0.3.1
329
-
330
- - [CodeceptJS] Better formatter for nested structures and BDD tests
331
-
332
- # 0.3.0
333
-
334
- - Added `TESTOMATIO_TITLE` env variable to set a name for Run
335
- - Added `TESTOMATIO_RUNGROUP_TITLE` env variable to attach Run to RunGroup
336
- - Added `TESTOMATIO_ENV` env variable to attach additional env values to report
337
- - [CodeceptJS] **CodeceptJS v3 support**
338
- - [CodeceptJS] Dropped support for CodeceptJS 2
339
- - [CodeceptJS] Added support for before hooks
340
- - [CodeceptJS] Log of steps
341
- - [CodeceptJS] Upload screenshots of failed tests to S3
342
- - [CodeceptJS] Updated to use with parallel execution