testit-js-commons 3.0.0 → 3.2.0-TMS-CLOUD
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.
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { AutoTestModelV2GetModel, AutoTestPostModel } from "testit-api-client";
|
|
1
|
+
import { AutoTestModelV2GetModel, AutoTestApiResult, AutoTestPostModel } from "testit-api-client";
|
|
2
2
|
import { BaseConverter, AdapterConfig } from "../../common";
|
|
3
3
|
import { AutotestGet, AutotestPost } from "./autotests.type";
|
|
4
4
|
export interface IAutotestConverter {
|
|
5
5
|
toOriginAutotest(autotest: AutotestPost): AutoTestPostModel;
|
|
6
|
-
toLocalAutotest(autotest:
|
|
6
|
+
toLocalAutotest(autotest: AutoTestApiResult): AutotestGet;
|
|
7
|
+
toLocalAutotestByModel(autotest: AutoTestModelV2GetModel): AutotestGet;
|
|
7
8
|
}
|
|
8
9
|
export declare class AutotestConverter extends BaseConverter implements IAutotestConverter {
|
|
9
10
|
constructor(config: AdapterConfig);
|
|
10
11
|
toOriginAutotest(autotest: AutotestPost): AutoTestPostModel;
|
|
11
|
-
|
|
12
|
+
toLocalAutotestByModel(autotest: AutoTestModelV2GetModel): AutotestGet;
|
|
13
|
+
toLocalAutotest(autotest: AutoTestApiResult): AutotestGet;
|
|
12
14
|
}
|
|
@@ -9,6 +9,21 @@ class AutotestConverter extends common_1.BaseConverter {
|
|
|
9
9
|
toOriginAutotest(autotest) {
|
|
10
10
|
return Object.assign(Object.assign({}, autotest), { projectId: this.config.projectId, links: Array.isArray(autotest.links) ? autotest.links.map((link) => this.toOriginLink(link)) : undefined, shouldCreateWorkItem: this.config.automaticCreationTestCases });
|
|
11
11
|
}
|
|
12
|
+
toLocalAutotestByModel(autotest) {
|
|
13
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
14
|
+
return {
|
|
15
|
+
id: autotest.id,
|
|
16
|
+
name: (_a = autotest.name) !== null && _a !== void 0 ? _a : undefined,
|
|
17
|
+
externalId: (_b = autotest.externalId) !== null && _b !== void 0 ? _b : undefined,
|
|
18
|
+
links: (_c = autotest.links) === null || _c === void 0 ? void 0 : _c.map((link) => this.toLocalLink(link)),
|
|
19
|
+
namespace: (_d = autotest.namespace) !== null && _d !== void 0 ? _d : undefined,
|
|
20
|
+
classname: (_e = autotest.classname) !== null && _e !== void 0 ? _e : undefined,
|
|
21
|
+
steps: (_f = autotest.steps) === null || _f === void 0 ? void 0 : _f.map((step) => this.toLocalShortStep(step)),
|
|
22
|
+
setup: (_g = autotest.setup) === null || _g === void 0 ? void 0 : _g.map((step) => this.toLocalShortStep(step)),
|
|
23
|
+
teardown: (_h = autotest.teardown) === null || _h === void 0 ? void 0 : _h.map((step) => this.toLocalShortStep(step)),
|
|
24
|
+
labels: (_j = autotest.labels) !== null && _j !== void 0 ? _j : undefined,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
12
27
|
toLocalAutotest(autotest) {
|
|
13
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
14
29
|
return {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AutoTestResultsForTestRunModel, TestResultV2GetModel, TestRunState,
|
|
1
|
+
import { AutoTestResultsForTestRunModel, TestResultV2GetModel, TestRunState, TestRunV2ApiResult } from "testit-api-client";
|
|
2
2
|
import { BaseConverter, AdapterConfig } from "../../common";
|
|
3
3
|
import { AutotestResult, AutotestResultGet, RunState, TestRunGet } from "./testruns.type";
|
|
4
4
|
export interface ITestRunConverter {
|
|
5
5
|
toOriginState(state: RunState): TestRunState;
|
|
6
6
|
toLocalState(state: TestRunState): RunState;
|
|
7
|
-
toLocalTestRun(testRun:
|
|
7
|
+
toLocalTestRun(testRun: TestRunV2ApiResult): TestRunGet;
|
|
8
8
|
toOriginAutotestResult(autotest: AutotestResult): AutoTestResultsForTestRunModel;
|
|
9
9
|
toLocalAutotestResult(autotest: TestResultV2GetModel): AutotestResultGet;
|
|
10
10
|
}
|
|
@@ -15,5 +15,5 @@ export declare class TestRunConverter extends BaseConverter implements ITestRunC
|
|
|
15
15
|
toOriginState(state: RunState): TestRunState;
|
|
16
16
|
toOriginAutotestResult(autotest: AutotestResult): AutoTestResultsForTestRunModel;
|
|
17
17
|
toLocalAutotestResult(test: TestResultV2GetModel): AutotestResultGet;
|
|
18
|
-
toLocalTestRun(testRun:
|
|
18
|
+
toLocalTestRun(testRun: TestRunV2ApiResult): TestRunGet;
|
|
19
19
|
}
|
|
@@ -36,7 +36,7 @@ class TestRunConverter extends common_1.BaseConverter {
|
|
|
36
36
|
message: (_j = test.message) !== null && _j !== void 0 ? _j : undefined,
|
|
37
37
|
traces: (_k = test.traces) !== null && _k !== void 0 ? _k : undefined,
|
|
38
38
|
startedOn: (_l = test.startedOn) !== null && _l !== void 0 ? _l : undefined,
|
|
39
|
-
autoTest: test.autoTest ? this.autotestConverter.
|
|
39
|
+
autoTest: test.autoTest ? this.autotestConverter.toLocalAutotestByModel(test.autoTest) : undefined,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
toLocalTestRun(testRun) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testit-js-commons",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-TMS-CLOUD",
|
|
4
4
|
"description": "JavaScript commons for Test IT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"dotenv": "^16.0.3",
|
|
28
|
-
"testit-api-client": "
|
|
28
|
+
"testit-api-client": "6.0.0-TMS-CLOUD"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"lib"
|