Skip to content

Commit

Permalink
fix: send all fields
Browse files Browse the repository at this point in the history
Reporters will send all data on the results of the autotest
  • Loading branch information
gibiw committed Aug 20, 2024
1 parent a4207cc commit f2f0ef7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions qase-javascript-commons/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [email protected]

## What's new

Reporters will send all data on the results of the autotests. Including the data of the title, the description, etc.


# [email protected]

## What's new
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qase-javascript-commons",
"version": "2.1.2",
"version": "2.1.3",
"description": "Qase JS Reporters",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
16 changes: 15 additions & 1 deletion qase-javascript-commons/src/reporters/testops-reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,29 @@ export class TestOpsReporter extends AbstractReporter {
const id = Array.isArray(result.testops_id) ? null : result.testops_id;
if (id) {
resultCreate.case_id = id;
return resultCreate;
}

const rootSuite = this.rootSuite ? `${this.rootSuite}\t` : '';
resultCreate.case = {
title: result.title,
suite_title: result.relations?.suite ? `${rootSuite}${result.relations?.suite?.data.map((suite) => suite.title).join('\t')}` : rootSuite,
description: result.fields['description'] ?? null,
postconditions: result.fields['postconditions'] ?? null,
preconditions: result.fields['preconditions'] ?? null,
};

if (result.fields['severity']) {
resultCreate.case.severity = result.fields['severity'];
}

if (result.fields['priority']) {
resultCreate.case.priority = result.fields['priority'];
}

if (result.fields['layer']) {
resultCreate.case.layer = result.fields['layer'];
}

this.logger.logDebug(`Transformed result: ${JSON.stringify(resultCreate)}`);

return resultCreate;
Expand Down

0 comments on commit f2f0ef7

Please sign in to comment.