@wdio/spec-reporter 7.16.14 → 7.18.0
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 +51 -0
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -4
- package/build/types.d.ts +6 -0
- package/build/types.d.ts.map +1 -1
- package/build/utils.js +5 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -113,3 +113,54 @@ Default: `false`
|
|
|
113
113
|
},
|
|
114
114
|
]
|
|
115
115
|
```
|
|
116
|
+
|
|
117
|
+
### showPreface
|
|
118
|
+
Set to false to disable `[ MutliRemoteBrowser ... ]` preface in the reports.
|
|
119
|
+
|
|
120
|
+
Type: `boolean`
|
|
121
|
+
Default: `true`
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
[
|
|
125
|
+
"spec",
|
|
126
|
+
{
|
|
127
|
+
showPreface: false,
|
|
128
|
+
},
|
|
129
|
+
]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
With it set to `false` you will see output as:
|
|
133
|
+
```
|
|
134
|
+
Running: loremipsum (v50) on Windows 10
|
|
135
|
+
Session ID: foobar
|
|
136
|
+
|
|
137
|
+
» /foo/bar/loo.e2e.js
|
|
138
|
+
Foo test
|
|
139
|
+
green ✓ foo
|
|
140
|
+
green ✓ bar
|
|
141
|
+
|
|
142
|
+
» /bar/foo/loo.e2e.js
|
|
143
|
+
Bar test
|
|
144
|
+
green ✓ some test
|
|
145
|
+
red ✖ a failed test
|
|
146
|
+
red ✖ a failed test with no stack
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
and with `true` (default) each line will be prefixed with the preface:
|
|
150
|
+
```
|
|
151
|
+
[loremipsum 50 Windows 10 #0-0] Running: loremipsum (v50) on Windows 10
|
|
152
|
+
[loremipsum 50 Windows 10 #0-0] Session ID: foobar
|
|
153
|
+
[loremipsum 50 Windows 10 #0-0]
|
|
154
|
+
[loremipsum 50 Windows 10 #0-0] » /foo/bar/loo.e2e.js
|
|
155
|
+
[loremipsum 50 Windows 10 #0-0] Foo test
|
|
156
|
+
[loremipsum 50 Windows 10 #0-0] green ✓ foo
|
|
157
|
+
[loremipsum 50 Windows 10 #0-0] green ✓ bar
|
|
158
|
+
[loremipsum 50 Windows 10 #0-0]
|
|
159
|
+
[loremipsum 50 Windows 10 #0-0] » /bar/foo/loo.e2e.js
|
|
160
|
+
[loremipsum 50 Windows 10 #0-0] Bar test
|
|
161
|
+
[loremipsum 50 Windows 10 #0-0] green ✓ some test
|
|
162
|
+
[loremipsum 50 Windows 10 #0-0] red ✖ a failed test
|
|
163
|
+
[loremipsum 50 Windows 10 #0-0] red ✖ a failed test with no stack
|
|
164
|
+
[loremipsum 50 Windows 10 #0-0]
|
|
165
|
+
```
|
|
166
|
+
|
package/build/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export default class SpecReporter extends WDIOReporter {
|
|
|
13
13
|
private _originalStdoutWrite;
|
|
14
14
|
private _addConsoleLogs;
|
|
15
15
|
private _realtimeReporting;
|
|
16
|
+
private _showPreface;
|
|
16
17
|
private _suiteName;
|
|
17
18
|
private _stateCounts;
|
|
18
19
|
private _symbols;
|
|
@@ -57,7 +58,7 @@ export default class SpecReporter extends WDIOReporter {
|
|
|
57
58
|
* @param {Array} suites Runner suites
|
|
58
59
|
* @return {Array} Display output list
|
|
59
60
|
*/
|
|
60
|
-
getResultDisplay(
|
|
61
|
+
getResultDisplay(prefaceString?: string): string[];
|
|
61
62
|
/**
|
|
62
63
|
* Get the display for passing, failing and skipped
|
|
63
64
|
* @param {String} duration Duration string
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAY,MAAM,gBAAgB,CAAA;AACtG,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EAAE,MAAM;IAKnB;;;;OAIG;IACH,SAAS,CAAE,KAAK,CAAC,EAAE,MAAM,OAAO;IAIhC;;;;OAIG;IACH,QAAQ,CAAE,KAAK,CAAC,EAAE,MAAM;IAoBxB;;;;;OAKG;IACH,kBAAkB,CAAE,UAAU,EAAE,YAAY,CAAC,gBAAgB,EAAE,OAAO,UAAO,EAAE,aAAa,UAAQ;CA6CvG"}
|
package/build/index.js
CHANGED
|
@@ -26,6 +26,7 @@ class SpecReporter extends reporter_1.default {
|
|
|
26
26
|
this._originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
27
27
|
this._addConsoleLogs = false;
|
|
28
28
|
this._realtimeReporting = false;
|
|
29
|
+
this._showPreface = true;
|
|
29
30
|
this._suiteName = '';
|
|
30
31
|
// Keep track of the order that suites were called
|
|
31
32
|
this._stateCounts = {
|
|
@@ -44,6 +45,7 @@ class SpecReporter extends reporter_1.default {
|
|
|
44
45
|
this._symbols = { ...this._symbols, ...this.options.symbols || {} };
|
|
45
46
|
this._onlyFailures = options.onlyFailures || false;
|
|
46
47
|
this._realtimeReporting = options.realtimeReporting || false;
|
|
48
|
+
this._showPreface = options.showPreface !== false;
|
|
47
49
|
this._sauceLabsSharableLinks = 'sauceLabsSharableLinks' in options
|
|
48
50
|
? options.sauceLabsSharableLinks
|
|
49
51
|
: this._sauceLabsSharableLinks;
|
|
@@ -58,7 +60,7 @@ class SpecReporter extends reporter_1.default {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
onRunnerStart(runner) {
|
|
61
|
-
this._preface = `[${this.getEnviromentCombo(runner.capabilities, false, runner.isMultiremote).trim()} #${runner.cid}]
|
|
63
|
+
this._preface = this._showPreface ? `[${this.getEnviromentCombo(runner.capabilities, false, runner.isMultiremote).trim()} #${runner.cid}]` : '';
|
|
62
64
|
}
|
|
63
65
|
onSuiteStart(suite) {
|
|
64
66
|
this._suiteName = suite.file.replace(process.cwd(), '');
|
|
@@ -168,9 +170,9 @@ class SpecReporter extends reporter_1.default {
|
|
|
168
170
|
: [])
|
|
169
171
|
];
|
|
170
172
|
// Prefix all values with the browser information
|
|
171
|
-
const prefacedOutput = output.map((value) => {
|
|
173
|
+
const prefacedOutput = this._showPreface ? output.map((value) => {
|
|
172
174
|
return value ? `${preface} ${value}` : preface;
|
|
173
|
-
});
|
|
175
|
+
}) : output;
|
|
174
176
|
// Output the results
|
|
175
177
|
this.write(`${divider}\n${prefacedOutput.join('\n')}\n`);
|
|
176
178
|
}
|
|
@@ -250,8 +252,9 @@ class SpecReporter extends reporter_1.default {
|
|
|
250
252
|
* @param {Array} suites Runner suites
|
|
251
253
|
* @return {Array} Display output list
|
|
252
254
|
*/
|
|
253
|
-
getResultDisplay(
|
|
255
|
+
getResultDisplay(prefaceString) {
|
|
254
256
|
const output = [];
|
|
257
|
+
const preface = this._showPreface ? prefaceString : '';
|
|
255
258
|
const suites = this.getOrderedSuites();
|
|
256
259
|
const specFileReferences = [];
|
|
257
260
|
for (const suite of suites) {
|
package/build/types.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export interface SpecReporterOptions {
|
|
|
45
45
|
* @default: `false`
|
|
46
46
|
*/
|
|
47
47
|
realtimeReporting?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Ability to show or hide preface on each line of the report ('[MultiRemote ...]')
|
|
50
|
+
*
|
|
51
|
+
* @default: `true`
|
|
52
|
+
*/
|
|
53
|
+
showPreface?: boolean;
|
|
48
54
|
}
|
|
49
55
|
export interface TestLink {
|
|
50
56
|
capabilities: Capabilities.RemoteCapability;
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,M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AAW,QAAQ;IACrB,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
package/build/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/spec-reporter",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.18.0",
|
|
4
4
|
"description": "A WebdriverIO plugin to report in spec style",
|
|
5
5
|
"author": "Christian Bromann <christian@saucelabs.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-spec-reporter",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@types/easy-table": "^0.0.33",
|
|
26
|
-
"@wdio/reporter": "7.
|
|
27
|
-
"@wdio/types": "7.
|
|
26
|
+
"@wdio/reporter": "7.18.0",
|
|
27
|
+
"@wdio/types": "7.18.0",
|
|
28
28
|
"chalk": "^4.0.0",
|
|
29
29
|
"easy-table": "^1.1.1",
|
|
30
30
|
"pretty-ms": "^7.0.0"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "44729cdd585af3ad69f2093f32377f297f5ac344"
|
|
39
39
|
}
|