@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.
Files changed (2) hide show
  1. package/index.js +15 -6
  2. 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.reduce((attachments, step) => {
82
- const attrs = step.attachment
83
- .filter(isAttribute)
84
- .map(attachment => attachment.body.replace(RP_ATTRIBUTE_PREFIX, ''));
85
- return [...new Set([...attachments, ...attrs])]
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qavajs/format-report-portal",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "cucumber formatter for report portal",
5
5
  "main": "index.js",
6
6
  "scripts": {