@wdio/allure-reporter 7.30.0 → 7.30.2
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 +15 -2
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +12 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -104,7 +104,9 @@ describe('Suite', () => {
|
|
|
104
104
|
})
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
Cucumber
|
|
107
|
+
#### Cucumber
|
|
108
|
+
|
|
109
|
+
Basic Cucumber example:
|
|
108
110
|
|
|
109
111
|
```js
|
|
110
112
|
Given('I include feature and story name', () => {
|
|
@@ -113,7 +115,9 @@ Given('I include feature and story name', () => {
|
|
|
113
115
|
})
|
|
114
116
|
```
|
|
115
117
|
|
|
116
|
-
Cucumber
|
|
118
|
+
##### Cucumber Tags
|
|
119
|
+
|
|
120
|
+
Cucumber tags with special names (`issue` and `testId`) are converted to the links (the corresponding link templates must be configured before):
|
|
117
121
|
```gherkin
|
|
118
122
|
@issue=BUG-1
|
|
119
123
|
@testId=TST-2
|
|
@@ -124,6 +128,15 @@ Feature: This is a feature with global tags that will be converted to Allure lin
|
|
|
124
128
|
Given I do something
|
|
125
129
|
```
|
|
126
130
|
|
|
131
|
+
Cucumber tags with special names (`feature`) are mapped to Allure labels:
|
|
132
|
+
|
|
133
|
+
```gherkin
|
|
134
|
+
Feature: Test user role
|
|
135
|
+
@feature=login
|
|
136
|
+
Scenario: Login
|
|
137
|
+
Given I test login
|
|
138
|
+
```
|
|
139
|
+
|
|
127
140
|
## Displaying the report
|
|
128
141
|
|
|
129
142
|
The results can be consumed by any of the [reporting tools](https://docs.qameta.io/allure#_reporting) offered by Allure. For example:
|
package/build/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare class AllureReporter extends WDIOReporter {
|
|
|
18
18
|
onSuiteStart(suite: SuiteStats): void;
|
|
19
19
|
onSuiteEnd(suite: SuiteStats): any;
|
|
20
20
|
onTestStart(test: TestStats | HookStats): void;
|
|
21
|
-
setCaseParameters(cid: string | undefined, parentUid: string | undefined): void;
|
|
21
|
+
setCaseParameters(cid: string | undefined, parentUid: string | undefined, addFeatureLabel?: boolean): void;
|
|
22
22
|
getParentSuite(uid?: string): SuiteStats | undefined;
|
|
23
23
|
getLabels({ tags }: SuiteStats): {
|
|
24
24
|
name: string;
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,EAAE,EACjB,UAAU,EAAO,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EACrE,gBAAgB,EAAE,WAAW,EAChC,MAAM,gBAAgB,CAAA;AAQvB,OAAO,EACH,sBAAsB,EAAE,uBAAuB,EAAE,uBAAuB,EACxE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAC/E,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,EACvE,MAAM,SAAS,CAAA;AAUhB,cAAM,cAAe,SAAQ,YAAY;IACrC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,aAAa,CAA+B;IACpD,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,OAAO,CAAC,CAAoB;IACpC,OAAO,CAAC,eAAe,CAAC,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,oBAAoB,CAAU;IACtC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,GAAE,qBAA0B;IA6B/C,iBAAiB;IAgBjB,aAAa,CAAC,MAAM,EAAE,WAAW;IAMjC,YAAY,CAAC,KAAK,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sour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IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,UAAW,MAAM,UAE/B;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,WAAY,MAAM,UAEjC;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,cAAe,MAAM,UAEnC;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAc,SAAU,MAAM,SAAS,MAAM,UAEnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAc,gBAAiB,MAAM,mBAAmB,MAAM,UAEpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,SAAU,MAAM,WAAW,MAAM,GAAG,MAAM,GAAG,MAAM,QAAQ,MAAM,UAKpF;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,UAAW,MAAM,UAEhC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,YAAY,MAAM,UAK/B;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,OAAO,UAAW,MAAM,4BAI5B,GAAG,WAAe,MAAM,UAO1B;IAED;;;;;OAKG;IACH,MAAM,CAAC,WAAW,SAAU,MAAM,SAAS,MAAM,UAEhD;CACJ;AAED,eAAe,cAAc,CAAA;AAE7B,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAChC,cAAc,SAAS,CAAA;AAEvB,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,cAAe,SAAQ,qBAAqB;SAAI;KAC7D;CACJ"}
|
package/build/index.js
CHANGED
|
@@ -92,6 +92,7 @@ class AllureReporter extends reporter_1.default {
|
|
|
92
92
|
// handle cucumber scenario as allure "case" instead of "suite"
|
|
93
93
|
this._allure.startCase(suite.title);
|
|
94
94
|
const currentTest = this._allure.getCurrentTest();
|
|
95
|
+
let featureLabelPresent = false;
|
|
95
96
|
this.getLabels(suite).forEach(({ name, value }) => {
|
|
96
97
|
if (name === 'issue') {
|
|
97
98
|
this.addIssue({ issue: value });
|
|
@@ -100,13 +101,16 @@ class AllureReporter extends reporter_1.default {
|
|
|
100
101
|
this.addTestId({ testId: value });
|
|
101
102
|
}
|
|
102
103
|
else {
|
|
104
|
+
if (name === 'feature') {
|
|
105
|
+
featureLabelPresent = true;
|
|
106
|
+
}
|
|
103
107
|
currentTest.addLabel(name, value);
|
|
104
108
|
}
|
|
105
109
|
});
|
|
106
110
|
if (suite.description) {
|
|
107
111
|
this.addDescription(suite);
|
|
108
112
|
}
|
|
109
|
-
this.setCaseParameters(suite.cid, suite.parent);
|
|
113
|
+
this.setCaseParameters(suite.cid, suite.parent, !featureLabelPresent);
|
|
110
114
|
}
|
|
111
115
|
onSuiteEnd(suite) {
|
|
112
116
|
// cleanup suites index to prevent resource leaks
|
|
@@ -162,7 +166,8 @@ class AllureReporter extends reporter_1.default {
|
|
|
162
166
|
this._allure.startCase(testTitle);
|
|
163
167
|
this.setCaseParameters(test.cid, test.parent);
|
|
164
168
|
}
|
|
165
|
-
setCaseParameters(cid, parentUid) {
|
|
169
|
+
setCaseParameters(cid, parentUid, addFeatureLabel = true) {
|
|
170
|
+
var _a, _b;
|
|
166
171
|
const parentSuite = this.getParentSuite(parentUid);
|
|
167
172
|
const currentTest = this._allure.getCurrentTest();
|
|
168
173
|
if (!this._isMultiremote) {
|
|
@@ -186,8 +191,11 @@ class AllureReporter extends reporter_1.default {
|
|
|
186
191
|
currentTest.addLabel('language', 'javascript');
|
|
187
192
|
currentTest.addLabel('framework', 'wdio');
|
|
188
193
|
currentTest.addLabel('thread', cid);
|
|
189
|
-
if (
|
|
190
|
-
|
|
194
|
+
if (addFeatureLabel && parentSuite) {
|
|
195
|
+
const labelValue = (_b = (_a = this.getLabels(parentSuite).find(label => label.name === 'feature')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : parentSuite.title;
|
|
196
|
+
if (labelValue) {
|
|
197
|
+
currentTest.addLabel('feature', labelValue);
|
|
198
|
+
}
|
|
191
199
|
}
|
|
192
200
|
}
|
|
193
201
|
getParentSuite(uid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/allure-reporter",
|
|
3
|
-
"version": "7.30.
|
|
3
|
+
"version": "7.30.2",
|
|
4
4
|
"description": "A WebdriverIO reporter plugin to create Allure Test Reports",
|
|
5
5
|
"author": "Boris Osipov <osipov.boris@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-allure-reporter",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@types/node": "^18.0.0",
|
|
28
|
-
"@wdio/reporter": "7.
|
|
29
|
-
"@wdio/types": "7.
|
|
28
|
+
"@wdio/reporter": "7.30.2",
|
|
29
|
+
"@wdio/types": "7.30.2",
|
|
30
30
|
"allure-js-commons": "^1.3.2",
|
|
31
31
|
"csv-stringify": "^6.0.4",
|
|
32
32
|
"strip-ansi": "^6.0.0"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f65ff89daa26bb039f4286a5eb466b403d19c715"
|
|
41
41
|
}
|