Skip to content

Commit 72c4514

Browse files
authored
rpConfig parameter to define a place for tags: attributes or description (#37)
* Added tagsAsAttributes parameter
1 parent 63226a0 commit 72c4514

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

CHANGELOG.MD

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.14.0
2+
- added config parameter for placing tags to attributes or description (default)
3+
14
## 0.13.2
25
- updated version to 0.13.2
36
- pull request template added to reduce human factor

README.MD

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module.exports = {
2626
mode: 'DEFAULT',
2727
retry: 1, // number of retries to send result to report portal (default - 1)
2828
ignoreErrors: false, // ignore RP errors (default: false)
29-
showLaunchURL: true // log report portal launch link
29+
showLaunchURL: true // log report portal launch link,
30+
tagsAsAttributes: true // (default: false → tags go to description)
3031
},
3132
}
3233
}

index.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ class RPFormatter extends Formatter {
8484
if (!this.features[featureName]) {
8585
await retry(async () => {
8686
const featureItem = this.rpClient.startTestItem({
87-
attributes: this.prepareTags(testCase.gherkinDocument.feature.tags),
87+
attributes: this.rpConfig.tagsAsAttributes ? this.prepareTags(testCase.gherkinDocument.feature.tags) : [],
8888
description:
89-
this.formatTags(testCase.gherkinDocument.feature.tags) +
90-
'\n' +
91-
testCase.gherkinDocument.feature.description,
89+
this.rpConfig.tagsAsAttributes ? '' : `${this.formatTags(testCase.gherkinDocument.feature.tags)}\n`
90+
+ testCase.gherkinDocument.feature.description,
9291
name: featureName,
9392
startTime: this.rpClient.helpers.now(),
9493
type: 'SUITE'
@@ -120,11 +119,13 @@ class RPFormatter extends Formatter {
120119
const retryTest = Boolean(testCase.attempt);
121120
const testItem = await retry(async () => {
122121
const testItem = this.rpClient.startTestItem({
123-
description: this.formatTags(testCase.pickle.tags),
122+
description: this.rpConfig.tagsAsAttributes ? '' : this.formatTags(testCase.pickle.tags),
124123
name: testCase.pickle.name,
125124
startTime,
126125
type: 'STEP',
127-
attributes: [...attributes, ...this.prepareTags(testCase.pickle.tags) ],
126+
attributes: [
127+
...attributes,
128+
...(this.rpConfig.tagsAsAttributes ? this.prepareTags(testCase.pickle.tags) : []) ],
128129
retry: retryTest
129130
}, this.launchId, featureTempId);
130131
await testItem.promise;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/format-report-portal",
3-
"version": "0.13.2",
3+
"version": "0.14.0",
44
"description": "cucumber formatter for report portal",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)