@wdio/allure-reporter 8.2.0 → 8.3.5
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 +16 -2
- package/build/reporter.d.ts +1 -1
- package/build/reporter.d.ts.map +1 -1
- package/build/reporter.js +11 -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
|
|
@@ -125,6 +129,16 @@ Feature: This is a feature with global tags that will be converted to Allure lin
|
|
|
125
129
|
Given I do something
|
|
126
130
|
```
|
|
127
131
|
|
|
132
|
+
Cucumber tags with special names (`feature`) are mapped to Allure labels:
|
|
133
|
+
|
|
134
|
+
```gherkin
|
|
135
|
+
Feature: Test user role
|
|
136
|
+
|
|
137
|
+
@feature=login
|
|
138
|
+
Scenario: Login
|
|
139
|
+
Given I test login
|
|
140
|
+
```
|
|
141
|
+
|
|
128
142
|
## Displaying the report
|
|
129
143
|
|
|
130
144
|
The results can be consumed by any of the [reporting tools](https://docs.qameta.io/allure#_reporting) offered by Allure. For example:
|
package/build/reporter.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
19
19
|
onSuiteStart(suite: SuiteStats): void;
|
|
20
20
|
onSuiteEnd(suite: SuiteStats): any;
|
|
21
21
|
onTestStart(test: TestStats | HookStats): void;
|
|
22
|
-
setCaseParameters(cid: string | undefined, parentUid: string | undefined): void;
|
|
22
|
+
setCaseParameters(cid: string | undefined, parentUid: string | undefined, addFeatureLabel?: boolean): void;
|
|
23
23
|
getParentSuite(uid?: string): SuiteStats | undefined;
|
|
24
24
|
getLabels({ tags }: SuiteStats): {
|
|
25
25
|
name: string;
|
package/build/reporter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,UAAU,EAAO,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EACrE,gBAAgB,EAAE,WAAW,EAChC,MAAM,gBAAgB,CAAA;AACvB,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAGzC,OAAO,EACH,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAChF,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAC1E,MAAM,iBAAiB,CAAA;AAMxB,OAAO,KAAK,EACR,sBAAsB,EAAE,uBAAuB,EAAE,uBAAuB,EACxE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAC/E,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,EAAE,qBAAqB,EACvE,MAAM,YAAY,CAAA;AAWnB,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;IACpD,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;IAC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EACJ,OAAO,EACP,IAAmB,EACtB,EAAE,sBAAsB;IAYzB,SAAS,CAAC,KAAK,EAAE,MAAM;IAOvB,OAAO,CAAC,MAAM,EAAE,MAAM;IAOtB,OAAO,CAAC,EACJ,IAAI,EACP,EAAE,GAAG;IAWN,WAAW,CAAC,EACR,IAAI,EACJ,KAAK,EACR,EAAE,GAAG;IASN,gBAAgB;IAIhB,mBAAmB,CAAC,OAAO,EAAE,WAAW;IAUxC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAMnC,gBAAgB;IAOhB;;;OAGG;IACH,MAAM,CAAC,UAAU,oBAAa;IAC9B,MAAM,CAAC,QAAQ,kBAAW;IAC1B,MAAM,CAAC,WAAW,qBAAc;IAChC,MAAM,CAAC,QAAQ,kBAAW;IAC1B,MAAM,CAAC,SAAS,mBAAY;IAC5B,MAAM,CAAC,QAAQ,kBAAW;IAC1B,MAAM,CAAC,cAAc,wBAAiB;IACtC,MAAM,CAAC,cAAc,wBAAiB;IACtC,MAAM,CAAC,aAAa,uBAAgB;IACpC,MAAM,CAAC,SAAS,mBAAY;IAC5B,MAAM,CAAC,OAAO,iBAAU;IACxB,MAAM,CAAC,OAAO,iBAAU;IACxB,MAAM,CAAC,WAAW,qBAAc;CACnC"}
|
package/build/reporter.js
CHANGED
|
@@ -85,6 +85,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
85
85
|
// handle cucumber scenario as allure "case" instead of "suite"
|
|
86
86
|
this._allure.startCase(suite.title);
|
|
87
87
|
const currentTest = this._allure.getCurrentTest();
|
|
88
|
+
let featureLabelPresent = false;
|
|
88
89
|
this.getLabels(suite).forEach(({ name, value }) => {
|
|
89
90
|
if (name === 'issue') {
|
|
90
91
|
this.addIssue({ issue: value });
|
|
@@ -93,13 +94,16 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
93
94
|
this.addTestId({ testId: value });
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
97
|
+
if (name === 'feature') {
|
|
98
|
+
featureLabelPresent = true;
|
|
99
|
+
}
|
|
96
100
|
currentTest.addLabel(name, value);
|
|
97
101
|
}
|
|
98
102
|
});
|
|
99
103
|
if (suite.description) {
|
|
100
104
|
this.addDescription(suite);
|
|
101
105
|
}
|
|
102
|
-
this.setCaseParameters(suite.cid, suite.parent);
|
|
106
|
+
this.setCaseParameters(suite.cid, suite.parent, !featureLabelPresent);
|
|
103
107
|
}
|
|
104
108
|
onSuiteEnd(suite) {
|
|
105
109
|
// cleanup suites index to prevent resource leaks
|
|
@@ -154,7 +158,7 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
154
158
|
this._allure.startCase(testTitle);
|
|
155
159
|
this.setCaseParameters(test.cid, test.parent);
|
|
156
160
|
}
|
|
157
|
-
setCaseParameters(cid, parentUid) {
|
|
161
|
+
setCaseParameters(cid, parentUid, addFeatureLabel = true) {
|
|
158
162
|
const parentSuite = this.getParentSuite(parentUid);
|
|
159
163
|
const currentTest = this._allure.getCurrentTest();
|
|
160
164
|
if (!this._isMultiremote) {
|
|
@@ -178,8 +182,11 @@ export default class AllureReporter extends WDIOReporter {
|
|
|
178
182
|
currentTest.addLabel('language', 'javascript');
|
|
179
183
|
currentTest.addLabel('framework', 'wdio');
|
|
180
184
|
currentTest.addLabel('thread', cid);
|
|
181
|
-
if (parentSuite
|
|
182
|
-
|
|
185
|
+
if (addFeatureLabel && parentSuite) {
|
|
186
|
+
const labelValue = this.getLabels(parentSuite).find(label => label.name === 'feature')?.value ?? parentSuite.title;
|
|
187
|
+
if (labelValue) {
|
|
188
|
+
currentTest.addLabel('feature', labelValue);
|
|
189
|
+
}
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
192
|
getParentSuite(uid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/allure-reporter",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.5",
|
|
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",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@types/node": "^18.0.0",
|
|
42
|
-
"@wdio/reporter": "8.
|
|
43
|
-
"@wdio/types": "8.
|
|
42
|
+
"@wdio/reporter": "8.3.0",
|
|
43
|
+
"@wdio/types": "8.3.0",
|
|
44
44
|
"allure-js-commons": "^1.3.2",
|
|
45
45
|
"csv-stringify": "^6.0.4",
|
|
46
46
|
"strip-ansi": "^6.0.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "cc6deb72e7c4f064074ca8a2e101da7c08db8b4b"
|
|
52
52
|
}
|