@testomatio/reporter 1.0.12-beta.2 → 1.0.12-beta.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.
Files changed (2) hide show
  1. package/lib/xmlReader.js +8 -4
  2. package/package.json +1 -1
package/lib/xmlReader.js CHANGED
@@ -39,8 +39,8 @@ class XmlReader {
39
39
  if (!this.adapter) throw new Error('XML adapter for this format not found');
40
40
 
41
41
  this.opts = opts || {};
42
- const store = {}
43
- this.pipes = pipesFactory(opts, store);
42
+ this.store = {}
43
+ this.pipes = pipesFactory(opts, this.store);
44
44
 
45
45
  this.parser = new XMLParser(options);
46
46
  this.tests = []
@@ -353,8 +353,12 @@ class XmlReader {
353
353
  let files = [];
354
354
  if (test.files?.length) files = test.files.map(f => path.join(process.cwd(), f))
355
355
  files = [...files, ...fetchFilesFromStackTrace(test.stack)];
356
- console.log(APP_PREFIX, 'Uploading files', files)
357
- test.artifacts = await Promise.all(files.map(f => upload.uploadFileByPath(f, this.runId)));
356
+
357
+ if (!files.length) continue;
358
+
359
+ const runId = this.runId || this.store.runId || Date.now().toString();
360
+ test.artifacts = await Promise.all(files.map(f => upload.uploadFileByPath(f, runId)));
361
+ console.log(APP_PREFIX, `🗄️ Uploaded ${chalk.bold(`${files.length} artifacts`)} for test ${test.title}`);
358
362
  }
359
363
  }
360
364
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.0.12-beta.2",
3
+ "version": "1.0.12-beta.3",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",