@wdio/spec-reporter 8.16.3 → 8.16.9
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/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +24 -6
- package/package.json +4 -4
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SuiteStats, HookStats, RunnerStats
|
|
2
|
-
import WDIOReporter from '@wdio/reporter';
|
|
1
|
+
import type { SuiteStats, HookStats, RunnerStats } from '@wdio/reporter';
|
|
2
|
+
import WDIOReporter, { TestStats } from '@wdio/reporter';
|
|
3
3
|
import type { Capabilities } from '@wdio/types';
|
|
4
4
|
import type { Symbols, SpecReporterOptions, TestLink } from './types.js';
|
|
5
5
|
export default class SpecReporter extends WDIOReporter {
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAY,MAAM,gBAAgB,CAAA;AAClF,OAAO,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,OAAO,KAAK,EAAc,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAQpF,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,YAAY;IAClD,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,cAAc,CAAmB;IACzC,O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;IAmCjB;;;OAGG;IACH,gBAAgB;IA2ChB;;;;OAIG;IACH,MAAM,CAAE,GAAG,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;CA+CvG"}
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { format } from 'node:util';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import prettyMs from 'pretty-ms';
|
|
4
|
-
import WDIOReporter from '@wdio/reporter';
|
|
4
|
+
import WDIOReporter, { TestStats } from '@wdio/reporter';
|
|
5
5
|
import { buildTableData, printTable, getFormattedRows, sauceAuthenticationToken } from './utils.js';
|
|
6
6
|
const DEFAULT_INDENT = ' ';
|
|
7
7
|
export default class SpecReporter extends WDIOReporter {
|
|
@@ -237,10 +237,28 @@ export default class SpecReporter extends WDIOReporter {
|
|
|
237
237
|
getEventsToReport(suite) {
|
|
238
238
|
return [
|
|
239
239
|
/**
|
|
240
|
-
* report all tests and only
|
|
240
|
+
* Generate a report that shows all tests except those that failed but passed on retry, and only display failed hooks.
|
|
241
241
|
*/
|
|
242
|
-
...suite.hooksAndTests
|
|
243
|
-
|
|
242
|
+
...suite.hooksAndTests.reduce((accumulator, currentItem) => {
|
|
243
|
+
if (currentItem instanceof TestStats) {
|
|
244
|
+
const existingTestIndex = accumulator.findIndex((test) => test instanceof TestStats && test.fullTitle === currentItem.fullTitle);
|
|
245
|
+
if (existingTestIndex === -1) {
|
|
246
|
+
accumulator.push(currentItem);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
const existingTest = accumulator[existingTestIndex];
|
|
250
|
+
if (currentItem.retries !== undefined && existingTest.retries !== undefined) {
|
|
251
|
+
if (currentItem.retries > existingTest.retries) {
|
|
252
|
+
accumulator.splice(existingTestIndex, 1, currentItem);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
accumulator.push(currentItem);
|
|
259
|
+
}
|
|
260
|
+
return accumulator;
|
|
261
|
+
}, []).filter((item) => Object.keys(item).length > 0).filter((item) => {
|
|
244
262
|
return item.type === 'test' || Boolean(item.error);
|
|
245
263
|
})
|
|
246
264
|
];
|
|
@@ -282,11 +300,11 @@ export default class SpecReporter extends WDIOReporter {
|
|
|
282
300
|
}
|
|
283
301
|
const eventsToReport = this.getEventsToReport(suite);
|
|
284
302
|
for (const test of eventsToReport) {
|
|
285
|
-
const testTitle = test.title
|
|
303
|
+
const testTitle = `${test.title} ${(test instanceof TestStats && test.retries && test.retries > 0) ? `(${test.retries} retries)` : ''}`;
|
|
286
304
|
const state = test.state;
|
|
287
305
|
const testIndent = `${DEFAULT_INDENT}${suiteIndent}`;
|
|
288
306
|
// Output for a single test
|
|
289
|
-
output.push(`${testIndent}${chalk[this.getColor(state)](this.getSymbol(state))} ${testTitle}`);
|
|
307
|
+
output.push(`${testIndent}${chalk[this.getColor(state)](this.getSymbol(state))} ${testTitle.trim()}`);
|
|
290
308
|
// print cucumber data table cells and docstring
|
|
291
309
|
const arg = test.argument;
|
|
292
310
|
if (typeof (arg) === 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/spec-reporter",
|
|
3
|
-
"version": "8.16.
|
|
3
|
+
"version": "8.16.9",
|
|
4
4
|
"description": "A WebdriverIO plugin to report in spec style",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-spec-reporter",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"typeScriptVersion": "3.8.3",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@wdio/reporter": "8.16.
|
|
33
|
-
"@wdio/types": "8.16.
|
|
32
|
+
"@wdio/reporter": "8.16.7",
|
|
33
|
+
"@wdio/types": "8.16.7",
|
|
34
34
|
"chalk": "^5.1.2",
|
|
35
35
|
"easy-table": "^1.2.0",
|
|
36
36
|
"pretty-ms": "^7.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a94335c7a66b9d4c792f0ae55a854f2c8b68e26d"
|
|
42
42
|
}
|