@qavajs/format-report-portal 0.9.0 → 0.9.1
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/index.js +15 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -78,12 +78,20 @@ class RPFormatter extends Formatter {
|
|
|
78
78
|
let startTime = this.rpClient.helpers.now();
|
|
79
79
|
let endTime;
|
|
80
80
|
const steps = this.getStepResults(testCase);
|
|
81
|
-
const attributes = steps
|
|
82
|
-
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
const attributes = steps
|
|
82
|
+
.reduce((attachments, step) => {
|
|
83
|
+
const attrs = step.attachment
|
|
84
|
+
.filter(isAttribute)
|
|
85
|
+
.map(attachment => attachment.body.replace(RP_ATTRIBUTE_PREFIX, ''));
|
|
86
|
+
return [...new Set([...attachments, ...attrs])]
|
|
87
|
+
}, [])
|
|
88
|
+
.map(attachment => {
|
|
89
|
+
const [key, value] = attachment.split(':');
|
|
90
|
+
return key && value
|
|
91
|
+
? { key, value, system: false }
|
|
92
|
+
: { value: key, system: false }
|
|
93
|
+
});
|
|
94
|
+
|
|
87
95
|
// Start test
|
|
88
96
|
const testItem = this.rpClient.startTestItem({
|
|
89
97
|
description: this.formatTags(testCase.pickle.tags),
|
|
@@ -168,6 +176,7 @@ class RPFormatter extends Formatter {
|
|
|
168
176
|
const stepsBefore = steps.slice(0, steps.findIndex((element) => element === step));
|
|
169
177
|
return stepsBefore.every(element => element.pickle === undefined) ? 'Before' : 'After'
|
|
170
178
|
}
|
|
179
|
+
|
|
171
180
|
getMessage(step) {
|
|
172
181
|
return step.result.message
|
|
173
182
|
}
|