@testomatio/reporter 0.5.5 → 0.5.8

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/Changelog.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 0.5.8
2
+
3
+ * Fixed Cypress.io reporting
4
+
5
+ # 0.5.7
6
+
7
+ * Fixed webdriverio artifacts
8
+
9
+ # 0.5.6
10
+
11
+ * Unmark failed CodeceptJS tests as skipped
12
+
1
13
  # 0.5.5
2
14
 
3
15
  * Fixed `BeforeSuite` failures in CodeceptJS
package/README.md CHANGED
@@ -189,6 +189,16 @@ exports.config = {
189
189
  }
190
190
  ```
191
191
 
192
+ For making screenshots on failed tests add the following hook to `wdio.conf.js`:
193
+
194
+ ```js
195
+ afterTest: function (test, context, { error, result, duration, passed, retries }) {
196
+ if (error) {
197
+ browser.takeScreenshot()
198
+ }
199
+ },
200
+ ```
201
+
192
202
  Run the following command from you project folder:
193
203
 
194
204
  ```bash
@@ -115,7 +115,7 @@ function CodeceptReporter(config) {
115
115
  });
116
116
 
117
117
  event.dispatcher.on(event.hook.failed, (suite, err) => {
118
- const error = err;
118
+ error = err;
119
119
 
120
120
  if (!suite) return;
121
121
  if (!suite.tests) return;
@@ -163,7 +163,9 @@ function CodeceptReporter(config) {
163
163
  });
164
164
 
165
165
  event.dispatcher.on(event.test.skipped, test => {
166
- const { tags, title } = test;
166
+ const { id, tags, title } = test;
167
+ if (failedTests.includes(id || title)) return;
168
+
167
169
  const testId = parseTest(tags);
168
170
  const testObj = getTestAndMessage(title);
169
171
  client.addTestRun(testId, TRConstants.SKIPPED, {
@@ -5,11 +5,14 @@ const TestomatClient = require('../../client');
5
5
  const testomatioReporter = on => {
6
6
  const client = new TestomatClient({ apiKey: process.env.TESTOMATIO });
7
7
 
8
- on('before:run', async () => {
8
+ on('before:run', async (run) => {
9
9
  if (!client.title) {
10
- client.title = `${run.config.projectName} tests @${run.browser.displayName} @${run.system.osName}`
10
+ client.title = `${run.config.projectName} tests`
11
11
  if (client.title.includes('undefined')) delete client.title;
12
12
  }
13
+ if (!client.env) {
14
+ client.env = `${run.browser.displayName},${run.system.osName}`
15
+ }
13
16
  await client.createRun();
14
17
  });
15
18
 
@@ -12,6 +12,8 @@ class WebdriverReporter extends WDIOReporter {
12
12
  this.client = new TestomatClient({ apiKey });
13
13
  options = Object.assign(options, { stdout: true });
14
14
 
15
+ this._addTestPromises = [];
16
+
15
17
  this._isSynchronising = false;
16
18
  }
17
19
 
@@ -19,14 +21,18 @@ class WebdriverReporter extends WDIOReporter {
19
21
  return this._isSynchronising === false;
20
22
  }
21
23
 
22
- async onTestEnd(test) {
24
+ async onRunnerEnd() {
23
25
  this._isSynchronising = true;
24
26
 
25
- await this.addTest(test);
27
+ await Promise.all(this._addTestPromises);
26
28
 
27
29
  this._isSynchronising = false;
28
30
  }
29
31
 
32
+ onTestEnd(test) {
33
+ this._addTestPromises.push(this.addTest(test));
34
+ }
35
+
30
36
  async addTest(test) {
31
37
  if (!this.client) return;
32
38
 
package/lib/client.js CHANGED
@@ -129,7 +129,9 @@ class TestomatClient {
129
129
  }
130
130
 
131
131
  for (const [idx, buffer] of filesBuffers.entries()) {
132
- uploadedFiles.push(upload.uploadFileAsBuffer(buffer, idx + 1, this.runId));
132
+ const fileName = `${idx + 1}-${title.replace(/\s+/g, '-')}`;
133
+
134
+ uploadedFiles.push(upload.uploadFileAsBuffer(buffer, fileName, this.runId));
133
135
  }
134
136
  }
135
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "0.5.5",
3
+ "version": "0.5.8",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "repository": "git@github.com:testomatio/reporter.git",