Skip to content

Commit dbf9a7a

Browse files
Adjust json structure
1 parent 4a3e46b commit dbf9a7a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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');

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ENV \
99
RUN apt-get update && \
1010
apt-get install -y git sudo software-properties-common
1111

12-
RUN sudo npm install -g --unsafe-perm=true --allow-root https://github.com/justyna-olszak-wttech/BackstopJS.git#5.4.5
12+
RUN sudo npm install -g --unsafe-perm=true --allow-root https://github.com/justyna-olszak-wttech/BackstopJS.git#v5.4.5
1313

1414
RUN wget https://dl-ssl.google.com/linux/linux_signing_key.pub && sudo apt-key add linux_signing_key.pub
1515
RUN sudo add-apt-repository "deb http://dl.google.com/linux/chrome/deb/ stable main"

0 commit comments

Comments
 (0)