From f2f0ef7286f2dfe0826ba51cc6c7943fca38cdb0 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Wed, 7 Aug 2024 13:13:06 +0200 Subject: [PATCH] fix: send all fields Reporters will send all data on the results of the autotest --- qase-javascript-commons/changelog.md | 7 +++++++ qase-javascript-commons/package.json | 2 +- .../src/reporters/testops-reporter.ts | 16 +++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/qase-javascript-commons/changelog.md b/qase-javascript-commons/changelog.md index a04014ca..c58b0500 100644 --- a/qase-javascript-commons/changelog.md +++ b/qase-javascript-commons/changelog.md @@ -1,3 +1,10 @@ +# qase-javascript-commons@2.1.3 + +## What's new + +Reporters will send all data on the results of the autotests. Including the data of the title, the description, etc. + + # qase-javascript-commons@2.1.1 ## What's new diff --git a/qase-javascript-commons/package.json b/qase-javascript-commons/package.json index 0958b3d0..9ab96f5a 100644 --- a/qase-javascript-commons/package.json +++ b/qase-javascript-commons/package.json @@ -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", diff --git a/qase-javascript-commons/src/reporters/testops-reporter.ts b/qase-javascript-commons/src/reporters/testops-reporter.ts index 22e984c3..6e6ad907 100644 --- a/qase-javascript-commons/src/reporters/testops-reporter.ts +++ b/qase-javascript-commons/src/reporters/testops-reporter.ts @@ -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;