Skip to content

Commit ed86a6b

Browse files
Udjust json structure
1 parent 4a3e46b commit ed86a6b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

core/util/writeXrayReport.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ module.exports = function (config, reporter) {
2222
'iterations': [],
2323
'testInfo': {}
2424
};
25+
const metadata = testCase[0].pair.metadata;
26+
const projectKey = metadata ? metadata[0].split('-')[0] : '';
2527

2628
testCase.forEach((testedViewport) => {
2729
let { pair: { viewportLabel: name }, status } = testedViewport;
@@ -32,23 +34,26 @@ module.exports = function (config, reporter) {
3234
}
3335
xrayTestResult.iterations.push({ name, status });
3436
});
35-
3637
xrayTestResult.status = testStatus;
37-
xrayTestResult.testInfo.requirementKeys = testCase[0].pair.metadata;
38+
xrayTestResult.testInfo.requirementKeys = metadata;
39+
xrayTestResult.testInfo.projectKey = projectKey;
3840
xrayTestResult.testInfo.summary = testCase[0].pair.label;
3941
xrayTestResult.testInfo.type = "Generic";
4042
transformedTestCases.push(
4143
xrayTestResult
4244
);
4345
}
4446

47+
debugger;
4548
return transformedTestCases;
4649
}
4750

4851
function transformToXrayJson (json) {
4952
const results = {}
5053
const namedTestCases = _.groupBy(json, 'pair.label');
51-
return results.tests = transformTestCases(namedTestCases);
54+
55+
results.tests = transformTestCases(namedTestCases);
56+
return results;
5257
}
5358

5459
logger.log('Writing Xray json report');

0 commit comments

Comments
 (0)