@testomatio/reporter 0.5.6 → 0.5.7
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 +4 -0
- package/README.md +10 -0
- package/lib/adapter/codecept.js +1 -1
- package/lib/adapter/webdriver.js +8 -2
- package/lib/client.js +3 -1
- package/package.json +1 -1
package/Changelog.md
CHANGED
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
|
package/lib/adapter/codecept.js
CHANGED
package/lib/adapter/webdriver.js
CHANGED
|
@@ -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
|
|
24
|
+
async onRunnerEnd() {
|
|
23
25
|
this._isSynchronising = true;
|
|
24
26
|
|
|
25
|
-
await this.
|
|
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
|
-
|
|
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
|
|