testit-js-commons 3.7.0 → 3.7.1
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,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AutoTestApiResult } 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): any;
|
|
6
6
|
toLocalAutotest(autotest: AutoTestApiResult): AutotestGet;
|
|
7
|
-
toLocalAutotestByModel(autotest: AutoTestModelV2GetModel): AutotestGet;
|
|
8
7
|
}
|
|
9
8
|
export declare class AutotestConverter extends BaseConverter implements IAutotestConverter {
|
|
10
9
|
constructor(config: AdapterConfig);
|
|
11
10
|
toOriginAutotest(autotest: AutotestPost): any;
|
|
12
|
-
toLocalAutotestByModel(autotest: AutoTestModelV2GetModel): AutotestGet;
|
|
13
11
|
toLocalAutotest(autotest: AutoTestApiResult): AutotestGet;
|
|
14
12
|
}
|
|
@@ -16,6 +16,7 @@ class AutotestConverter extends common_1.BaseConverter {
|
|
|
16
16
|
setup: autotest.setup,
|
|
17
17
|
teardown: autotest.teardown,
|
|
18
18
|
labels: autotest.labels,
|
|
19
|
+
tags: autotest.tags,
|
|
19
20
|
externalKey: autotest.externalKey,
|
|
20
21
|
title: autotest.title,
|
|
21
22
|
description: autotest.description,
|
|
@@ -25,27 +26,8 @@ class AutotestConverter extends common_1.BaseConverter {
|
|
|
25
26
|
shouldCreateWorkItem: this.config.automaticCreationTestCases,
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
|
-
toLocalAutotestByModel(autotest) {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
30
|
-
return {
|
|
31
|
-
id: autotest.id,
|
|
32
|
-
name: (_a = autotest.name) !== null && _a !== void 0 ? _a : undefined,
|
|
33
|
-
externalId: (_b = autotest.externalId) !== null && _b !== void 0 ? _b : undefined,
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
links: (_c = autotest.links) === null || _c === void 0 ? void 0 : _c.map((link) => this.toLocalLink(link)),
|
|
36
|
-
namespace: (_d = autotest.namespace) !== null && _d !== void 0 ? _d : undefined,
|
|
37
|
-
classname: (_e = autotest.classname) !== null && _e !== void 0 ? _e : undefined,
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
steps: (_f = autotest.steps) === null || _f === void 0 ? void 0 : _f.map((step) => this.toLocalShortStep(step)),
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
setup: (_g = autotest.setup) === null || _g === void 0 ? void 0 : _g.map((step) => this.toLocalShortStep(step)),
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
teardown: (_h = autotest.teardown) === null || _h === void 0 ? void 0 : _h.map((step) => this.toLocalShortStep(step)),
|
|
44
|
-
labels: (_j = autotest.labels) !== null && _j !== void 0 ? _j : undefined,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
29
|
toLocalAutotest(autotest) {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
49
31
|
return {
|
|
50
32
|
id: autotest.id,
|
|
51
33
|
name: (_a = autotest.name) !== null && _a !== void 0 ? _a : undefined,
|
|
@@ -61,6 +43,8 @@ class AutotestConverter extends common_1.BaseConverter {
|
|
|
61
43
|
// @ts-ignore
|
|
62
44
|
teardown: (_h = autotest.teardown) === null || _h === void 0 ? void 0 : _h.map((step) => this.toLocalShortStep(step)),
|
|
63
45
|
labels: (_j = autotest.labels) !== null && _j !== void 0 ? _j : undefined,
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
tags: (_k = autotest.tags) !== null && _k !== void 0 ? _k : undefined,
|
|
64
48
|
};
|
|
65
49
|
}
|
|
66
50
|
}
|
|
@@ -109,7 +109,7 @@ class AutotestsService extends common_1.BaseService {
|
|
|
109
109
|
updateAutotestFromFailed(originAutotest, autotest) {
|
|
110
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
111
|
var _a, _b;
|
|
112
|
-
yield this.updateAutotest(Object.assign(Object.assign({}, originAutotest), { externalId: (_a = originAutotest === null || originAutotest === void 0 ? void 0 : originAutotest.externalId) !== null && _a !== void 0 ? _a : autotest.externalId, name: (_b = originAutotest === null || originAutotest === void 0 ? void 0 : originAutotest.name) !== null && _b !== void 0 ? _b : autotest.name, links: autotest.links, externalKey: autotest.externalKey, steps: autotest.steps, setup: autotest.setup, teardown: autotest.teardown, title: autotest.title, description: autotest.description, namespace: autotest.namespace, classname: autotest.classname, labels: autotest.labels, workItemIds: autotest.workItemIds, isFlaky: autotest.isFlaky, shouldCreateWorkItem: autotest.shouldCreateWorkItem }));
|
|
112
|
+
yield this.updateAutotest(Object.assign(Object.assign({}, originAutotest), { externalId: (_a = originAutotest === null || originAutotest === void 0 ? void 0 : originAutotest.externalId) !== null && _a !== void 0 ? _a : autotest.externalId, name: (_b = originAutotest === null || originAutotest === void 0 ? void 0 : originAutotest.name) !== null && _b !== void 0 ? _b : autotest.name, links: autotest.links, externalKey: autotest.externalKey, steps: autotest.steps, setup: autotest.setup, teardown: autotest.teardown, title: autotest.title, description: autotest.description, namespace: autotest.namespace, classname: autotest.classname, labels: autotest.labels, tags: autotest.tags, workItemIds: autotest.workItemIds, isFlaky: autotest.isFlaky, shouldCreateWorkItem: autotest.shouldCreateWorkItem }));
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
linkToWorkItems(internalId, workItemIds) {
|