Skip to content

Commit

Permalink
Adjust json structure
Browse files Browse the repository at this point in the history
  • Loading branch information
justyna-olszak-wttech committed Jan 11, 2022
1 parent 4a3e46b commit 99ae921
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/util/writeXrayReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module.exports = function (config, reporter) {
'iterations': [],
'testInfo': {}
};
const metadata = testCase[0].pair.metadata;
const projectKey = metadata ? metadata[0].split('-')[0] : '';

testCase.forEach((testedViewport) => {
let { pair: { viewportLabel: name }, status } = testedViewport;
Expand All @@ -32,23 +34,26 @@ module.exports = function (config, reporter) {
}
xrayTestResult.iterations.push({ name, status });
});

xrayTestResult.status = testStatus;
xrayTestResult.testInfo.requirementKeys = testCase[0].pair.metadata;
xrayTestResult.testInfo.requirementKeys = metadata;
xrayTestResult.testInfo.projectKey = projectKey;
xrayTestResult.testInfo.summary = testCase[0].pair.label;
xrayTestResult.testInfo.type = "Generic";
transformedTestCases.push(
xrayTestResult
);
}

debugger;
return transformedTestCases;
}

function transformToXrayJson (json) {
const results = {}
const namedTestCases = _.groupBy(json, 'pair.label');
return results.tests = transformTestCases(namedTestCases);

results.tests = transformTestCases(namedTestCases);
return results;
}

logger.log('Writing Xray json report');
Expand Down

0 comments on commit 99ae921

Please sign in to comment.