@wdio/cucumber-framework 8.41.0 → 8.45.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/build/cucumberFormatter.d.ts.map +1 -1
- package/build/cucumberFormatter.js +7 -21
- package/build/utils.d.ts +7 -0
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +18 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cucumberFormatter.d.ts","sourceRoot":"","sources":["../src/cucumberFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAU,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"cucumberFormatter.d.ts","sourceRoot":"","sources":["../src/cucumberFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAU,MAAM,oBAAoB,CAAA;AAStD,OAAO,KAAK,EAER,eAAe,EAEf,OAAO,EACP,MAAM,EAEN,UAAU,EACV,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,cAAc,EAEd,IAAI,EACP,MAAM,oBAAoB,CAAA;AAY3B,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,YAAY,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS;IACpD,OAAO,CAAC,iBAAiB,CAAwB;IACjD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAe;IACjC,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,gBAAgB,CAAC,CAAiB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,C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AoB,EAAE,eAAe;IAiDvD,kBAAkB,CAAC,qBAAqB,EAAE,gBAAgB;IAkD1D,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE;IAyC5C,iBAAiB;CA2CpB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Formatter, Status } from '@cucumber/cucumber';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import logger from '@wdio/logger';
|
|
4
|
+
import { convertStatus } from './utils.js';
|
|
4
5
|
const log = logger('CucumberFormatter');
|
|
5
6
|
import { addKeywordToStep, getFeatureId, formatMessage, getRule, getStepType, buildStepPayload, getScenarioDescription } from './utils.js';
|
|
6
7
|
export default class CucumberFormatter extends Formatter {
|
|
@@ -127,25 +128,7 @@ export default class CucumberFormatter extends Formatter {
|
|
|
127
128
|
this.emit('hook:end', payload);
|
|
128
129
|
}
|
|
129
130
|
afterTest(uri, feature, scenario, step, result) {
|
|
130
|
-
let state =
|
|
131
|
-
switch (result.status) {
|
|
132
|
-
case Status.FAILED:
|
|
133
|
-
case Status.UNDEFINED:
|
|
134
|
-
state = 'fail';
|
|
135
|
-
break;
|
|
136
|
-
case Status.PASSED:
|
|
137
|
-
state = 'pass';
|
|
138
|
-
break;
|
|
139
|
-
case Status.PENDING:
|
|
140
|
-
state = 'pending';
|
|
141
|
-
break;
|
|
142
|
-
case Status.SKIPPED:
|
|
143
|
-
state = 'skip';
|
|
144
|
-
break;
|
|
145
|
-
case Status.AMBIGUOUS:
|
|
146
|
-
state = 'pending';
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
131
|
+
let state = convertStatus(result.status);
|
|
149
132
|
let error = result.message ? new Error(result.message) : undefined;
|
|
150
133
|
let title = step ? step?.text : this.getTitle(scenario);
|
|
151
134
|
if (result.status === Status.UNDEFINED) {
|
|
@@ -160,6 +143,7 @@ export default class CucumberFormatter extends Formatter {
|
|
|
160
143
|
/**
|
|
161
144
|
* mark test as failed
|
|
162
145
|
*/
|
|
146
|
+
state = 'fail';
|
|
163
147
|
this.failedCount++;
|
|
164
148
|
const err = new Error((step ? `Step "${title}" is not defined. ` : `Scenario ${title} has undefined steps. `) +
|
|
165
149
|
'You can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true.');
|
|
@@ -176,9 +160,10 @@ export default class CucumberFormatter extends Formatter {
|
|
|
176
160
|
}
|
|
177
161
|
}
|
|
178
162
|
else if (result.status === Status.FAILED && !result.willBeRetried) {
|
|
163
|
+
state = 'fail';
|
|
164
|
+
this.failedCount++;
|
|
179
165
|
error = new Error(result.message?.split('\n')[0]);
|
|
180
166
|
error.stack = result.message;
|
|
181
|
-
this.failedCount++;
|
|
182
167
|
}
|
|
183
168
|
else if (result.status === Status.AMBIGUOUS && this.failAmbiguousDefinitions) {
|
|
184
169
|
state = 'fail';
|
|
@@ -187,7 +172,8 @@ export default class CucumberFormatter extends Formatter {
|
|
|
187
172
|
error.stack = result.message;
|
|
188
173
|
}
|
|
189
174
|
else if (result.willBeRetried) {
|
|
190
|
-
|
|
175
|
+
// Mark as 'fail' instead of 'retry' since WebdriverIO retries internally
|
|
176
|
+
state = 'fail'; // Will be retried, not emitted as 'retry'
|
|
191
177
|
}
|
|
192
178
|
const common = {
|
|
193
179
|
title: title,
|
package/build/utils.d.ts
CHANGED
|
@@ -92,5 +92,12 @@ export declare function getScenarioDescription(feature: Feature, scenarioId: str
|
|
|
92
92
|
* @param {object} options `Cucumber.supportCodeLibraryBuilder.options`
|
|
93
93
|
*/
|
|
94
94
|
export declare function setUserHookNames(options: typeof supportCodeLibraryBuilder): void;
|
|
95
|
+
/**
|
|
96
|
+
* Convert Cucumber status to WebdriverIO test status for reporting.
|
|
97
|
+
* Maps statuses like PASSED, PENDING, etc., to WebdriverIO's shorthand test status values.
|
|
98
|
+
* @param {TestStepResultStatus} status - The Cucumber status (e.g., 'PENDING')
|
|
99
|
+
* @returns {'pass' | 'fail' | 'skip' | 'pending'} - The corresponding WebdriverIO test status
|
|
100
|
+
*/
|
|
101
|
+
export declare function convertStatus(status: TestStepResultStatus): 'pass' | 'fail' | 'skip' | 'pending';
|
|
95
102
|
export {};
|
|
96
103
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAS,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAS,MAAM,oBAAoB,CAAA;AAG1E,OAAO,KAAK,EAGR,UAAU,EACV,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,YAAY,CAAA;AAIxE;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,EAAE,QAAQ,EAAE,EAAE,UAAU;;;;cAoB3D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAE,EAAE,OAAY,EAAE,EAAE,GAAG,OAgBnD;AAED,aAAK,QAAQ;IACT,IAAI,SAAS;IACb,IAAI,SAAS;CAChB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAE,IAAI,EAAE,QAAQ,YAE1C;AAED,wBAAgB,YAAY,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,UAE1D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAAC,MAAM,YAAK,EAAE,IAAI,EAAC,MAAM,YAAK,EAAE,IAAI,EAAC,MAAM,UAGnF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE;IACJ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5C,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;;;;;;;;;;;;;UAPS,MAAM;YACJ,oBAAoB,GAAG,MAAM,GAAG,IAAI;YACpC,KAAK;eACF,MAAM;aAER,OAAO;EAgBvB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAS3D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,kBA4BvE;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,YAAY,CAAC,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CA6CxH;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAG1E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,OAAO,yBAAyB,QAe1E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAUhG"}
|
package/build/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import logger from '@wdio/logger';
|
|
3
3
|
import { isFunctionAsync } from '@wdio/utils';
|
|
4
|
+
import { Status } from '@cucumber/cucumber';
|
|
4
5
|
import { CUCUMBER_HOOK_DEFINITION_TYPES } from './constants.js';
|
|
5
6
|
const log = logger('@wdio/cucumber-framework:utils');
|
|
6
7
|
/**
|
|
@@ -201,3 +202,20 @@ export function setUserHookNames(options) {
|
|
|
201
202
|
});
|
|
202
203
|
});
|
|
203
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Convert Cucumber status to WebdriverIO test status for reporting.
|
|
207
|
+
* Maps statuses like PASSED, PENDING, etc., to WebdriverIO's shorthand test status values.
|
|
208
|
+
* @param {TestStepResultStatus} status - The Cucumber status (e.g., 'PENDING')
|
|
209
|
+
* @returns {'pass' | 'fail' | 'skip' | 'pending'} - The corresponding WebdriverIO test status
|
|
210
|
+
*/
|
|
211
|
+
export function convertStatus(status) {
|
|
212
|
+
switch (status) {
|
|
213
|
+
case Status.PASSED: return 'pass';
|
|
214
|
+
case Status.PENDING: return 'pending';
|
|
215
|
+
case Status.SKIPPED: return 'skip';
|
|
216
|
+
case Status.AMBIGUOUS: return 'skip';
|
|
217
|
+
case Status.FAILED: return 'fail';
|
|
218
|
+
case Status.UNDEFINED: return 'pass';
|
|
219
|
+
default: return 'fail';
|
|
220
|
+
}
|
|
221
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cucumber-framework",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.45.0",
|
|
4
4
|
"description": "A WebdriverIO plugin. Adapter for Cucumber.js testing framework.",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cucumber-framework",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/node": "^22.2.0",
|
|
45
45
|
"@wdio/logger": "8.38.0",
|
|
46
46
|
"@wdio/types": "8.41.0",
|
|
47
|
-
"@wdio/utils": "8.
|
|
47
|
+
"@wdio/utils": "8.45.0",
|
|
48
48
|
"glob": "^10.2.2",
|
|
49
49
|
"got": "^12.6.1",
|
|
50
50
|
"is-glob": "^4.0.0"
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "7836fbee7a85a16f2b7faa592969f914c504ba8a"
|
|
59
59
|
}
|