@testomatio/reporter 0.5.4-beta.1 → 0.5.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.
package/README.md CHANGED
@@ -59,12 +59,15 @@ TESTOMATIO={API_KEY} npx start-test-run -c 'npx codeceptjs run-workers 2'
59
59
  Add a reporter to Playwright config:
60
60
 
61
61
  ```javascript
62
- reporter: [
63
- ['list'],
64
- ['@testomatio/reporter/lib/adapter/playwright.js', {
62
+ reporter: [
63
+ ['list'],
64
+ [
65
+ '@testomatio/reporter/lib/adapter/playwright.js',
66
+ {
65
67
  apiKey: process.env.TESTOMATIO,
66
- }]
67
- ]
68
+ },
69
+ ],
70
+ ];
68
71
  ```
69
72
 
70
73
  Run the following command from you project folder:
@@ -90,7 +93,7 @@ Load the test using using `check-test`. Add the test id to your tests like in th
90
93
  Add the following line to [jest.config.js](https://github.com/testomatio/reporter/blob/master/example/jest/jest.config.js#L100):
91
94
 
92
95
  ```javascript
93
- reporters: ['default', ['../../lib/adapter/jest.js', { apiKey: {API_KEY} }]],
96
+ reporters: ['default', ['@testomatio/reporter/lib/adapter/jest.js', { apiKey: process.env.TESTOMATIO }]],
94
97
  ```
95
98
 
96
99
  Run your tests.
@@ -147,7 +150,7 @@ TESTOMATIO={API_KEY} npx cypress run
147
150
 
148
151
  Load the test using using `check-test`.
149
152
 
150
- Add the following line to [conf.js](https://github.com/angular/protractor/blob/5.4.1/example/conf.js):
153
+ Add the following lines to [conf.js](https://github.com/angular/protractor/blob/5.4.1/example/conf.js):
151
154
 
152
155
  ```javascript
153
156
  const JasmineReporter = require('@testomatio/reporter/lib/adapter/jasmine');
@@ -165,8 +168,44 @@ Run the following command from you project folder:
165
168
  TESTOMATIO={API_KEY} npx @testomatio/reporter@latest -c 'npx protractor conf.js'
166
169
  ```
167
170
 
171
+ ### WebdriverIO
172
+
173
+ Load the test using using `check-test`.
174
+
175
+ Add the following lines to [wdio.conf.js](https://webdriver.io/docs/configurationfile/):
176
+
177
+ ```javascript
178
+ const testomatio = require('@testomatio/reporter/lib/adapter/webdriver');
179
+
180
+ exports.config = {
181
+ // ...
182
+ reporters: [
183
+ [testomatio, {
184
+ apiKey: $ {
185
+ process.env.TESTOMATIO
186
+ }
187
+ }]
188
+ ]
189
+ }
190
+ ```
191
+
192
+ Run the following command from you project folder:
193
+
194
+ ```bash
195
+ TESTOMATIO={API_KEY} npx @testomatio/reporter -c 'npx wdio wdio.conf.js'
196
+ ```
197
+
168
198
  ## Advanced Usage
169
199
 
200
+ ### Create Unmatched Tests
201
+
202
+ Testomat.io will not create tests from the report if they have not been previously imported. To create tests during the report `TESTOMATIO_CREATE` option can be used:
203
+
204
+ ```bash
205
+ TESTOMATIO={API_KEY} TESTOMATIO_CREATE=1 <actual run command>
206
+ ```
207
+
208
+
170
209
  ### Adding Report to Run by ID
171
210
 
172
211
  This feature is widely used when a run is executed on CI.
@@ -267,6 +306,8 @@ Test artifacts are automatically uploaded for these test runners:
267
306
 
268
307
  - CodeceptJS
269
308
  - Playwright
309
+ - Cypress
310
+ - WebdriverIO
270
311
 
271
312
  To manually attach an artifact and upload it for a test use `global.testomatioArtifacts` array:
272
313
 
@@ -102,6 +102,7 @@ function CodeceptReporter(config) {
102
102
  const testObj = getTestAndMessage(title);
103
103
  client.addTestRun(testId, TRConstants.PASSED, {
104
104
  ...stripExampleFromTitle(title),
105
+ suite_title: test.parent && test.parent.title,
105
106
  message: testObj.message,
106
107
  time: getDuration(test),
107
108
  steps: output.text(),
@@ -131,6 +132,7 @@ function CodeceptReporter(config) {
131
132
 
132
133
  client.addTestRun(testId, TRConstants.FAILED, {
133
134
  ...stripExampleFromTitle(title),
135
+ suite_title: test.parent && test.parent.title,
134
136
  error,
135
137
  message: testObj.message,
136
138
  time: getDuration(test),
@@ -146,6 +148,7 @@ function CodeceptReporter(config) {
146
148
  const testObj = getTestAndMessage(title);
147
149
  client.addTestRun(testId, TRConstants.SKIPPED, {
148
150
  ...stripExampleFromTitle(title),
151
+ suite_title: test.parent && test.parent.title,
149
152
  message: testObj.message,
150
153
  time: getDuration(test),
151
154
  });
@@ -36,10 +36,12 @@ class JestReporter {
36
36
  const testId = parseTest(title);
37
37
  const deducedStatus = status === 'pending' ? 'skipped' : status;
38
38
 
39
+ const suite_title = result.ancestorTitles && result.ancestorTitles[result.ancestorTitles.length - 1];
39
40
  // In jest if test is not matched with test name pattern it is considered as skipped.
40
41
  // So adding a check if it is skipped for real or because of test pattern
41
42
  if (!this._globalConfig.testNamePattern || deducedStatus !== 'skipped') {
42
43
  this.client.addTestRun(testId, deducedStatus, {
44
+ suite_title,
43
45
  error,
44
46
  steps,
45
47
  title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "0.5.4-beta.1",
3
+ "version": "0.5.4",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "repository": "git@github.com:testomatio/reporter.git",