qase-javascript-commons 2.1.1 → 2.1.3

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.
package/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ # qase-javascript-commons@2.1.3
2
+
3
+ ## What's new
4
+
5
+ Reporters will send all data on the results of the autotests. Including the data of the title, the description, etc.
6
+
7
+
1
8
  # qase-javascript-commons@2.1.1
2
9
 
3
10
  ## What's new
@@ -1,6 +1,6 @@
1
- export { type TestResultType, Relation, Suite, SuiteData } from './test-result';
1
+ export { TestResultType, Relation, Suite, SuiteData } from './test-result';
2
2
  export { TestExecution, TestStatusEnum } from './test-execution';
3
- export { type TestStepType, StepType } from './test-step';
3
+ export { TestStepType, StepType } from './test-step';
4
4
  export { StepStatusEnum } from './step-execution';
5
5
  export { Attachment } from './attachment';
6
6
  export { Report } from './report';
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompoundError = exports.StepStatusEnum = exports.StepType = exports.TestStatusEnum = void 0;
3
+ exports.CompoundError = exports.StepStatusEnum = exports.StepType = exports.TestStepType = exports.TestStatusEnum = exports.TestExecution = exports.TestResultType = void 0;
4
+ var test_result_1 = require("./test-result");
5
+ Object.defineProperty(exports, "TestResultType", { enumerable: true, get: function () { return test_result_1.TestResultType; } });
4
6
  var test_execution_1 = require("./test-execution");
7
+ Object.defineProperty(exports, "TestExecution", { enumerable: true, get: function () { return test_execution_1.TestExecution; } });
5
8
  Object.defineProperty(exports, "TestStatusEnum", { enumerable: true, get: function () { return test_execution_1.TestStatusEnum; } });
6
9
  var test_step_1 = require("./test-step");
10
+ Object.defineProperty(exports, "TestStepType", { enumerable: true, get: function () { return test_step_1.TestStepType; } });
7
11
  Object.defineProperty(exports, "StepType", { enumerable: true, get: function () { return test_step_1.StepType; } });
8
12
  var step_execution_1 = require("./step-execution");
9
13
  Object.defineProperty(exports, "StepStatusEnum", { enumerable: true, get: function () { return step_execution_1.StepStatusEnum; } });
@@ -4,9 +4,10 @@ export declare enum StepStatusEnum {
4
4
  blocked = "blocked",
5
5
  skipped = "skipped"
6
6
  }
7
- export interface StepExecution {
7
+ export declare class StepExecution {
8
8
  start_time: number | null;
9
9
  status: StepStatusEnum;
10
10
  end_time: number | null;
11
11
  duration: number | null;
12
+ constructor();
12
13
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StepStatusEnum = void 0;
3
+ exports.StepExecution = exports.StepStatusEnum = void 0;
4
4
  var StepStatusEnum;
5
5
  (function (StepStatusEnum) {
6
6
  StepStatusEnum["passed"] = "passed";
@@ -8,3 +8,12 @@ var StepStatusEnum;
8
8
  StepStatusEnum["blocked"] = "blocked";
9
9
  StepStatusEnum["skipped"] = "skipped";
10
10
  })(StepStatusEnum || (exports.StepStatusEnum = StepStatusEnum = {}));
11
+ class StepExecution {
12
+ constructor() {
13
+ this.status = StepStatusEnum.passed;
14
+ this.start_time = null;
15
+ this.end_time = null;
16
+ this.duration = null;
17
+ }
18
+ }
19
+ exports.StepExecution = StepExecution;
@@ -9,11 +9,12 @@ export declare enum TestStatusEnum {
9
9
  blocked = "blocked",
10
10
  invalid = "invalid"
11
11
  }
12
- export interface TestExecution {
12
+ export declare class TestExecution {
13
13
  start_time: number | null;
14
14
  status: TestStatusEnum;
15
15
  end_time: number | null;
16
16
  duration: number | null;
17
17
  stacktrace: string | null;
18
18
  thread: string | null;
19
+ constructor();
19
20
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TestStatusEnum = void 0;
3
+ exports.TestExecution = exports.TestStatusEnum = void 0;
4
4
  /**
5
5
  * @enum {string}
6
6
  */
@@ -13,3 +13,14 @@ var TestStatusEnum;
13
13
  TestStatusEnum["blocked"] = "blocked";
14
14
  TestStatusEnum["invalid"] = "invalid";
15
15
  })(TestStatusEnum || (exports.TestStatusEnum = TestStatusEnum = {}));
16
+ class TestExecution {
17
+ constructor() {
18
+ this.status = TestStatusEnum.passed;
19
+ this.start_time = null;
20
+ this.end_time = null;
21
+ this.duration = null;
22
+ this.stacktrace = null;
23
+ this.thread = null;
24
+ }
25
+ }
26
+ exports.TestExecution = TestExecution;
@@ -1,7 +1,7 @@
1
1
  import { TestStepType } from './test-step';
2
2
  import { Attachment } from './attachment';
3
3
  import { TestExecution } from './test-execution';
4
- export type TestResultType = {
4
+ export declare class TestResultType {
5
5
  id: string;
6
6
  title: string;
7
7
  signature: string;
@@ -16,7 +16,8 @@ export type TestResultType = {
16
16
  relations: Relation | null;
17
17
  muted: boolean;
18
18
  message: string | null;
19
- };
19
+ constructor(title: string);
20
+ }
20
21
  export type Relation = {
21
22
  suite?: Suite;
22
23
  };
@@ -1,2 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TestResultType = void 0;
4
+ const test_execution_1 = require("./test-execution");
5
+ class TestResultType {
6
+ constructor(title) {
7
+ this.id = '';
8
+ this.title = title;
9
+ this.signature = '';
10
+ this.run_id = null;
11
+ this.testops_id = null;
12
+ this.execution = new test_execution_1.TestExecution();
13
+ this.fields = {};
14
+ this.attachments = [];
15
+ this.steps = [];
16
+ this.params = {};
17
+ this.author = null;
18
+ this.relations = null;
19
+ this.muted = false;
20
+ this.message = null;
21
+ }
22
+ }
23
+ exports.TestResultType = TestResultType;
@@ -5,7 +5,7 @@ export declare enum StepType {
5
5
  TEXT = "text",
6
6
  GHERKIN = "gherkin"
7
7
  }
8
- export type TestStepType = {
8
+ export declare class TestStepType {
9
9
  id: string;
10
10
  step_type: StepType;
11
11
  data: StepTextData | StepGherkinData;
@@ -13,4 +13,5 @@ export type TestStepType = {
13
13
  execution: StepExecution;
14
14
  attachments: Attachment[];
15
15
  steps: TestStepType[];
16
- };
16
+ constructor(type?: StepType);
17
+ }
@@ -1,8 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StepType = void 0;
3
+ exports.TestStepType = exports.StepType = void 0;
4
+ const step_execution_1 = require("./step-execution");
4
5
  var StepType;
5
6
  (function (StepType) {
6
7
  StepType["TEXT"] = "text";
7
8
  StepType["GHERKIN"] = "gherkin";
8
9
  })(StepType || (exports.StepType = StepType = {}));
10
+ class TestStepType {
11
+ constructor(type = StepType.TEXT) {
12
+ this.id = '';
13
+ this.step_type = type;
14
+ this.parent_id = null;
15
+ this.execution = new step_execution_1.StepExecution();
16
+ this.attachments = [];
17
+ this.steps = [];
18
+ if (type === StepType.TEXT) {
19
+ this.data = {
20
+ action: '',
21
+ expected_result: null,
22
+ };
23
+ }
24
+ else {
25
+ this.data = {
26
+ keyword: '',
27
+ name: '',
28
+ line: 0,
29
+ };
30
+ }
31
+ }
32
+ }
33
+ exports.TestStepType = TestStepType;
@@ -235,13 +235,24 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
235
235
  const id = Array.isArray(result.testops_id) ? null : result.testops_id;
236
236
  if (id) {
237
237
  resultCreate.case_id = id;
238
- return resultCreate;
239
238
  }
240
239
  const rootSuite = this.rootSuite ? `${this.rootSuite}\t` : '';
241
240
  resultCreate.case = {
242
241
  title: result.title,
243
242
  suite_title: result.relations?.suite ? `${rootSuite}${result.relations?.suite?.data.map((suite) => suite.title).join('\t')}` : rootSuite,
243
+ description: result.fields['description'] ?? null,
244
+ postconditions: result.fields['postconditions'] ?? null,
245
+ preconditions: result.fields['preconditions'] ?? null,
244
246
  };
247
+ if (result.fields['severity']) {
248
+ resultCreate.case.severity = result.fields['severity'];
249
+ }
250
+ if (result.fields['priority']) {
251
+ resultCreate.case.priority = result.fields['priority'];
252
+ }
253
+ if (result.fields['layer']) {
254
+ resultCreate.case.layer = result.fields['layer'];
255
+ }
245
256
  this.logger.logDebug(`Transformed result: ${JSON.stringify(resultCreate)}`);
246
257
  return resultCreate;
247
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",