@testomatio/reporter 1.0.2 → 1.0.4

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.
@@ -27,6 +27,7 @@ class TestomatioPipe {
27
27
  return;
28
28
  }
29
29
  debug('Testomatio Pipe: Enabled');
30
+ this.parallel = params.parallel;
30
31
  this.store = store || {};
31
32
  this.title = params.title || process.env.TESTOMATIO_TITLE;
32
33
  this.sharedRun = !!process.env.TESTOMATIO_SHARED_RUN;
@@ -38,6 +39,7 @@ class TestomatioPipe {
38
39
  this.proceed = process.env.TESTOMATIO_PROCEED;
39
40
  this.runId = params.runId || process.env.runId;
40
41
  this.createNewTests = !!process.env.TESTOMATIO_CREATE;
42
+ this.hasUnmatchedTests = false;
41
43
 
42
44
  if (!isValidUrl(this.url.trim())) {
43
45
  this.isEnabled = false;
@@ -53,6 +55,7 @@ class TestomatioPipe {
53
55
 
54
56
  const runParams = Object.fromEntries(
55
57
  Object.entries({
58
+ parallel: this.parallel,
56
59
  api_key: this.apiKey.trim(),
57
60
  group_title: this.groupTitle,
58
61
  env: this.env,
@@ -113,14 +116,17 @@ class TestomatioPipe {
113
116
  const responseData = err.response.data || { message: '' };
114
117
  console.log(
115
118
  APP_PREFIX,
116
- chalk.blue(this.title),
117
- `Report couldn't be processed: (${err.response.status}) ${responseData.message}`,
119
+ chalk.yellow(`Warning: ${responseData.message} (${err.response.status})`),
120
+ chalk.grey(data?.title || ''),
118
121
  );
122
+ if (err.response.data.message.includes('could not be matched')) {
123
+ this.hasUnmatchedTests = true;
124
+ }
119
125
  return;
120
126
  }
121
- 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}`);
122
128
  } else {
123
- 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);
124
130
  }
125
131
  });
126
132
  }
@@ -157,6 +163,17 @@ class TestomatioPipe {
157
163
  console.log(APP_PREFIX, `📊 ${notFinishedMessage}. Report URL: ${chalk.magenta(this.runUrl)}`);
158
164
  console.log(APP_PREFIX, `🛬 Run to finish it: TESTOMATIO_RUN=${this.runId} npx start-test-run --finish`);
159
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
+ }
160
177
  } catch (err) {
161
178
  console.log(APP_PREFIX, 'Error updating status, skipping...', err);
162
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",
@@ -25,6 +25,7 @@
25
25
  "humanize-duration": "^3.27.3",
26
26
  "is-valid-path": "^0.1.1",
27
27
  "json-cycle": "^1.3.0",
28
+ "lodash": "^4.17.21",
28
29
  "lodash.memoize": "^4.1.2",
29
30
  "lodash.merge": "^4.6.2",
30
31
  "uuid": "^9.0.0"
@@ -51,11 +52,12 @@
51
52
  "test:adapter:cucumber:example": "cd ./tests/adapter/examples/cucumber && npx cucumber-js"
52
53
  },
53
54
  "devDependencies": {
54
- "@cucumber/cucumber": "^8.6.0",
55
+ "@cucumber/cucumber": "^9.3.0",
55
56
  "@redocly/cli": "^1.0.0-beta.125",
56
57
  "@wdio/reporter": "^7.16.13",
57
58
  "chai": "^4.3.6",
58
59
  "codeceptjs": "^3.2.3",
60
+ "cucumber": "^6.0.7",
59
61
  "eslint": "^8.7.0",
60
62
  "eslint-config-airbnb-base": "^15.0.0",
61
63
  "eslint-config-prettier": "^8.3.0",