qase-javascript-commons 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,19 +2,19 @@ import { QaseApiInterface, ResultStepStatus, TestStepResultCreateStatusEnum } fr
|
|
|
2
2
|
import { AbstractReporter } from './abstract-reporter';
|
|
3
3
|
import { StepStatusEnum, TestResultType, TestStatusEnum } from '../models';
|
|
4
4
|
import { LoggerInterface } from '../utils/logger';
|
|
5
|
-
export
|
|
5
|
+
export interface TestOpsRunType {
|
|
6
6
|
id?: number | undefined;
|
|
7
7
|
title: string;
|
|
8
8
|
description: string;
|
|
9
9
|
complete?: boolean | undefined;
|
|
10
|
-
}
|
|
11
|
-
export
|
|
10
|
+
}
|
|
11
|
+
export interface TestOpsPlanType {
|
|
12
12
|
id?: number | undefined;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
}
|
|
14
|
+
export interface TestOpsBatchType {
|
|
15
15
|
size?: number | undefined;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
}
|
|
17
|
+
export interface TestOpsOptionsType {
|
|
18
18
|
project: string;
|
|
19
19
|
uploadAttachments?: boolean | undefined;
|
|
20
20
|
run: TestOpsRunType;
|
|
@@ -22,7 +22,7 @@ export type TestOpsOptionsType = {
|
|
|
22
22
|
batch?: TestOpsBatchType;
|
|
23
23
|
defect?: boolean | undefined;
|
|
24
24
|
useV2?: boolean | undefined;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
/**
|
|
27
27
|
* @class TestOpsReporter
|
|
28
28
|
* @extends AbstractReporter
|
|
@@ -220,11 +220,32 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
|
|
|
220
220
|
async transformTestResultV1(result) {
|
|
221
221
|
const attachments = await this.uploadAttachments(result.attachments);
|
|
222
222
|
const steps = await this.transformStepsV1(result.steps, result.title);
|
|
223
|
+
const param = {};
|
|
224
|
+
for (const key in result.params) {
|
|
225
|
+
const value = result.params[key];
|
|
226
|
+
if (!value) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
param[key] = value;
|
|
230
|
+
}
|
|
231
|
+
const group_params = [];
|
|
232
|
+
const keys = Object.keys(result.group_params);
|
|
233
|
+
if (keys.length > 0) {
|
|
234
|
+
group_params.push(keys);
|
|
235
|
+
}
|
|
236
|
+
for (const key in result.group_params) {
|
|
237
|
+
const value = result.group_params[key];
|
|
238
|
+
if (!value) {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
param[key] = value;
|
|
242
|
+
}
|
|
223
243
|
const resultCreate = {
|
|
224
244
|
attachments: attachments,
|
|
225
245
|
comment: result.message,
|
|
226
246
|
defect: this.defect,
|
|
227
|
-
param:
|
|
247
|
+
param: param,
|
|
248
|
+
param_groups: group_params,
|
|
228
249
|
stacktrace: result.execution.stacktrace,
|
|
229
250
|
start_time: result.execution.start_time ? result.execution.start_time | 0 : null,
|
|
230
251
|
status: result.execution.status,
|
|
@@ -239,7 +260,7 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
|
|
|
239
260
|
const rootSuite = this.rootSuite ? `${this.rootSuite}\t` : '';
|
|
240
261
|
resultCreate.case = {
|
|
241
262
|
title: result.title,
|
|
242
|
-
suite_title: result.relations?.suite ? `${rootSuite}${result.relations
|
|
263
|
+
suite_title: result.relations?.suite ? `${rootSuite}${result.relations.suite.data.map((suite) => suite.title).join('\t')}` : rootSuite,
|
|
243
264
|
description: result.fields['description'] ?? null,
|
|
244
265
|
postconditions: result.fields['postconditions'] ?? null,
|
|
245
266
|
preconditions: result.fields['preconditions'] ?? null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qase-javascript-commons",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Qase JS Reporters",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"lodash.merge": "^4.6.2",
|
|
34
34
|
"lodash.mergewith": "^4.6.2",
|
|
35
35
|
"mime-types": "^2.1.33",
|
|
36
|
-
"qaseio": "~2.
|
|
36
|
+
"qaseio": "~2.3.0",
|
|
37
37
|
"strip-ansi": "^6.0.1",
|
|
38
38
|
"uuid": "^9.0.0"
|
|
39
39
|
},
|