qase-javascript-commons 2.3.5 → 2.3.6
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/README.md +15 -0
- package/changelog.md +6 -0
- package/dist/client/clientV1.d.ts +28 -0
- package/dist/client/clientV1.js +138 -2
- package/dist/config/config-validation-schema.d.ts +174 -3
- package/dist/config/config-validation-schema.js +28 -0
- package/dist/env/env-enum.d.ts +7 -0
- package/dist/env/env-enum.js +9 -1
- package/dist/env/env-to-config.js +7 -0
- package/dist/env/env-type.d.ts +3 -1
- package/dist/env/env-validation-schema.js +8 -0
- package/dist/models/config/TestOpsOptionsType.d.ts +9 -0
- package/dist/models/configuration.d.ts +12 -0
- package/dist/models/configuration.js +2 -0
- package/dist/models/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,6 +58,8 @@ All configuration options are listed in the table below:
|
|
|
58
58
|
| Size of batch for sending test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | `200` | No | Any integer |
|
|
59
59
|
| Enable defects for failed test cases | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False` | No | `True`, `False` |
|
|
60
60
|
| Enable/disable attachment uploads | `testops.uploadAttachments` | `QASE_TESTOPS_UPLOAD_ATTACHMENTS` | `true` | No | `True`, `False` |
|
|
61
|
+
| Configuration values to create/find in groups (format: `group1=value1,group2=value2`) | `testops.configurations.values` | `QASE_TESTOPS_CONFIGURATIONS_VALUES` | undefined | No | Comma-separated key=value pairs |
|
|
62
|
+
| Create configuration groups if they don't exist | `testops.configurations.createIfNotExists` | `QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS` | `false` | No | `True`, `False` |
|
|
61
63
|
|
|
62
64
|
### Example `qase.config.json` config:
|
|
63
65
|
|
|
@@ -92,6 +94,19 @@ All configuration options are listed in the table below:
|
|
|
92
94
|
"project": "<project_code>",
|
|
93
95
|
"batch": {
|
|
94
96
|
"size": 100
|
|
97
|
+
},
|
|
98
|
+
"configurations": {
|
|
99
|
+
"values": [
|
|
100
|
+
{
|
|
101
|
+
"name": "group1",
|
|
102
|
+
"value": "value1"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "group2",
|
|
106
|
+
"value": "value2"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"createIfNotExists": true
|
|
95
110
|
}
|
|
96
111
|
}
|
|
97
112
|
}
|
package/changelog.md
CHANGED
|
@@ -11,6 +11,7 @@ export declare class ClientV1 implements IClient {
|
|
|
11
11
|
private readonly runClient;
|
|
12
12
|
private readonly environmentClient;
|
|
13
13
|
private readonly attachmentClient;
|
|
14
|
+
private readonly configurationClient;
|
|
14
15
|
constructor(logger: LoggerInterface, config: TestOpsOptionsType, environment: string | undefined);
|
|
15
16
|
private createApiConfig;
|
|
16
17
|
uploadResults(_runId: number, _results: TestResultType[]): Promise<void>;
|
|
@@ -20,6 +21,33 @@ export declare class ClientV1 implements IClient {
|
|
|
20
21
|
private prepareAttachmentData;
|
|
21
22
|
private getEnvironmentId;
|
|
22
23
|
private prepareRunObject;
|
|
24
|
+
/**
|
|
25
|
+
* Get all configuration groups with their configurations
|
|
26
|
+
* @returns Promise<ConfigurationGroup[]> Array of configuration groups
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
private getConfigurations;
|
|
30
|
+
/**
|
|
31
|
+
* Create a configuration group
|
|
32
|
+
* @param title Group title
|
|
33
|
+
* @returns Promise<number | undefined> Created group ID
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
private createConfigurationGroup;
|
|
37
|
+
/**
|
|
38
|
+
* Create a configuration in a group
|
|
39
|
+
* @param title Configuration title
|
|
40
|
+
* @param groupId Group ID
|
|
41
|
+
* @returns Promise<number | undefined> Created configuration ID
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
private createConfiguration;
|
|
45
|
+
/**
|
|
46
|
+
* Handle configuration creation based on config settings
|
|
47
|
+
* @returns Promise<number[]> Array of configuration IDs
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
private handleConfigurations;
|
|
23
51
|
/**
|
|
24
52
|
* Process error and throw QaseError
|
|
25
53
|
* @param {Error | AxiosError} error
|
package/dist/client/clientV1.js
CHANGED
|
@@ -31,6 +31,7 @@ class ClientV1 {
|
|
|
31
31
|
runClient;
|
|
32
32
|
environmentClient;
|
|
33
33
|
attachmentClient;
|
|
34
|
+
configurationClient;
|
|
34
35
|
constructor(logger, config, environment) {
|
|
35
36
|
this.logger = logger;
|
|
36
37
|
this.config = config;
|
|
@@ -40,6 +41,7 @@ class ClientV1 {
|
|
|
40
41
|
this.runClient = new qase_api_client_1.RunsApi(apiConfig);
|
|
41
42
|
this.environmentClient = new qase_api_client_1.EnvironmentsApi(apiConfig);
|
|
42
43
|
this.attachmentClient = new qase_api_client_1.AttachmentsApi(apiConfig);
|
|
44
|
+
this.configurationClient = new qase_api_client_1.ConfigurationsApi(apiConfig);
|
|
43
45
|
}
|
|
44
46
|
createApiConfig() {
|
|
45
47
|
const apiConfig = new qase_api_client_1.Configuration({ apiKey: this.config.api.token, formDataCtor: form_data_1.default });
|
|
@@ -59,8 +61,13 @@ class ClientV1 {
|
|
|
59
61
|
return this.config.run.id;
|
|
60
62
|
}
|
|
61
63
|
try {
|
|
64
|
+
// Handle configurations if provided
|
|
65
|
+
let configurationIds = [];
|
|
66
|
+
if (this.config.configurations) {
|
|
67
|
+
configurationIds = await this.handleConfigurations();
|
|
68
|
+
}
|
|
62
69
|
const environmentId = await this.getEnvironmentId();
|
|
63
|
-
const runObject = this.prepareRunObject(environmentId);
|
|
70
|
+
const runObject = this.prepareRunObject(environmentId, configurationIds);
|
|
64
71
|
this.logger.logDebug(`Creating test run: ${JSON.stringify(runObject)}`);
|
|
65
72
|
const { data } = await this.runClient.createRun(this.config.project, runObject);
|
|
66
73
|
if (!data.result?.id) {
|
|
@@ -129,7 +136,7 @@ class ClientV1 {
|
|
|
129
136
|
const { data } = await this.environmentClient.getEnvironments(this.config.project, undefined, this.environment, 100);
|
|
130
137
|
return data.result?.entities?.find((env) => env.slug === this.environment)?.id;
|
|
131
138
|
}
|
|
132
|
-
prepareRunObject(environmentId) {
|
|
139
|
+
prepareRunObject(environmentId, configurationIds) {
|
|
133
140
|
const runObject = {
|
|
134
141
|
title: this.config.run.title ?? `Automated run ${new Date().toISOString()}`,
|
|
135
142
|
description: this.config.run.description ?? '',
|
|
@@ -144,8 +151,137 @@ class ClientV1 {
|
|
|
144
151
|
if (this.config.plan.id) {
|
|
145
152
|
runObject.plan_id = this.config.plan.id;
|
|
146
153
|
}
|
|
154
|
+
if (configurationIds && configurationIds.length > 0) {
|
|
155
|
+
runObject.configurations = configurationIds;
|
|
156
|
+
}
|
|
147
157
|
return runObject;
|
|
148
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Get all configuration groups with their configurations
|
|
161
|
+
* @returns Promise<ConfigurationGroup[]> Array of configuration groups
|
|
162
|
+
* @private
|
|
163
|
+
*/
|
|
164
|
+
async getConfigurations() {
|
|
165
|
+
try {
|
|
166
|
+
const { data } = await this.configurationClient.getConfigurations(this.config.project);
|
|
167
|
+
const entities = data.result?.entities ?? [];
|
|
168
|
+
// Convert API response to domain model
|
|
169
|
+
return entities.map(group => ({
|
|
170
|
+
id: group.id ?? 0,
|
|
171
|
+
title: group.title ?? '',
|
|
172
|
+
configurations: group.configurations?.map(config => ({
|
|
173
|
+
id: config.id ?? 0,
|
|
174
|
+
title: config.title ?? ''
|
|
175
|
+
})) ?? []
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
throw this.processError(error, 'Error getting configurations');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Create a configuration group
|
|
184
|
+
* @param title Group title
|
|
185
|
+
* @returns Promise<number | undefined> Created group ID
|
|
186
|
+
* @private
|
|
187
|
+
*/
|
|
188
|
+
async createConfigurationGroup(title) {
|
|
189
|
+
try {
|
|
190
|
+
const group = { title };
|
|
191
|
+
const { data } = await this.configurationClient.createConfigurationGroup(this.config.project, group);
|
|
192
|
+
return data.result?.id;
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
throw this.processError(error, 'Error creating configuration group');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Create a configuration in a group
|
|
200
|
+
* @param title Configuration title
|
|
201
|
+
* @param groupId Group ID
|
|
202
|
+
* @returns Promise<number | undefined> Created configuration ID
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
async createConfiguration(title, groupId) {
|
|
206
|
+
try {
|
|
207
|
+
const config = { title, group_id: groupId };
|
|
208
|
+
const { data } = await this.configurationClient.createConfiguration(this.config.project, config);
|
|
209
|
+
return data.result?.id;
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
throw this.processError(error, 'Error creating configuration');
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Handle configuration creation based on config settings
|
|
217
|
+
* @returns Promise<number[]> Array of configuration IDs
|
|
218
|
+
* @private
|
|
219
|
+
*/
|
|
220
|
+
async handleConfigurations() {
|
|
221
|
+
if (!this.config.configurations?.values.length) {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
const configurationIds = [];
|
|
225
|
+
try {
|
|
226
|
+
// Get existing configuration groups
|
|
227
|
+
const existingGroups = await this.getConfigurations();
|
|
228
|
+
for (const configValue of this.config.configurations.values) {
|
|
229
|
+
const { name: groupName, value: configName } = configValue;
|
|
230
|
+
// Find existing group or create new one
|
|
231
|
+
const group = existingGroups.find(g => g.title === groupName);
|
|
232
|
+
let groupId;
|
|
233
|
+
if (group) {
|
|
234
|
+
groupId = group.id;
|
|
235
|
+
this.logger.logDebug(`Found existing configuration group: ${groupName}`);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
if (this.config.configurations.createIfNotExists) {
|
|
239
|
+
const newGroupId = await this.createConfigurationGroup(groupName);
|
|
240
|
+
if (newGroupId) {
|
|
241
|
+
groupId = newGroupId;
|
|
242
|
+
this.logger.logDebug(`Created new configuration group: ${groupName} with ID: ${groupId}`);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.logger.logDebug(`Failed to create configuration group: ${groupName}, skipping`);
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
this.logger.logDebug(`Configuration group not found: ${groupName}, skipping`);
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (groupId) {
|
|
255
|
+
// Check if configuration already exists in the group
|
|
256
|
+
const existingConfig = group?.configurations.find(c => c.title === configName);
|
|
257
|
+
if (!existingConfig) {
|
|
258
|
+
// Check if we should create configuration if it doesn't exist
|
|
259
|
+
if (this.config.configurations.createIfNotExists) {
|
|
260
|
+
const configId = await this.createConfiguration(configName, groupId);
|
|
261
|
+
if (configId) {
|
|
262
|
+
configurationIds.push(configId);
|
|
263
|
+
}
|
|
264
|
+
this.logger.logDebug(`Created configuration: ${configName} in group: ${groupName}`);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
this.logger.logDebug(`Configuration not found: ${configName} in group: ${groupName}, skipping`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
if (existingConfig.id) {
|
|
272
|
+
configurationIds.push(existingConfig.id);
|
|
273
|
+
}
|
|
274
|
+
this.logger.logDebug(`Configuration already exists: ${configName} in group: ${groupName}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
this.logger.logError('Error handling configurations:', error);
|
|
281
|
+
// Don't throw error to avoid blocking test run creation
|
|
282
|
+
}
|
|
283
|
+
return configurationIds;
|
|
284
|
+
}
|
|
149
285
|
/**
|
|
150
286
|
* Process error and throw QaseError
|
|
151
287
|
* @param {Error | AxiosError} error
|
|
@@ -1,6 +1,177 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ModeEnum } from '../options';
|
|
2
|
+
import { DriverEnum, FormatEnum } from '../writer';
|
|
3
3
|
/**
|
|
4
4
|
* @type {JSONSchemaType<ConfigType>}
|
|
5
5
|
*/
|
|
6
|
-
export declare const configValidationSchema:
|
|
6
|
+
export declare const configValidationSchema: {
|
|
7
|
+
type: string;
|
|
8
|
+
properties: {
|
|
9
|
+
mode: {
|
|
10
|
+
type: string;
|
|
11
|
+
enum: ModeEnum[];
|
|
12
|
+
nullable: boolean;
|
|
13
|
+
};
|
|
14
|
+
fallback: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: ModeEnum[];
|
|
17
|
+
nullable: boolean;
|
|
18
|
+
};
|
|
19
|
+
debug: {
|
|
20
|
+
type: string;
|
|
21
|
+
nullable: boolean;
|
|
22
|
+
};
|
|
23
|
+
environment: {
|
|
24
|
+
type: string;
|
|
25
|
+
nullable: boolean;
|
|
26
|
+
};
|
|
27
|
+
captureLogs: {
|
|
28
|
+
type: string;
|
|
29
|
+
nullable: boolean;
|
|
30
|
+
};
|
|
31
|
+
rootSuite: {
|
|
32
|
+
type: string;
|
|
33
|
+
nullable: boolean;
|
|
34
|
+
};
|
|
35
|
+
testops: {
|
|
36
|
+
type: string;
|
|
37
|
+
nullable: boolean;
|
|
38
|
+
properties: {
|
|
39
|
+
api: {
|
|
40
|
+
type: string;
|
|
41
|
+
nullable: boolean;
|
|
42
|
+
properties: {
|
|
43
|
+
token: {
|
|
44
|
+
type: string;
|
|
45
|
+
nullable: boolean;
|
|
46
|
+
};
|
|
47
|
+
host: {
|
|
48
|
+
type: string;
|
|
49
|
+
nullable: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
project: {
|
|
54
|
+
type: string;
|
|
55
|
+
nullable: boolean;
|
|
56
|
+
};
|
|
57
|
+
uploadAttachments: {
|
|
58
|
+
type: string;
|
|
59
|
+
nullable: boolean;
|
|
60
|
+
};
|
|
61
|
+
run: {
|
|
62
|
+
type: string;
|
|
63
|
+
nullable: boolean;
|
|
64
|
+
properties: {
|
|
65
|
+
id: {
|
|
66
|
+
type: string;
|
|
67
|
+
nullable: boolean;
|
|
68
|
+
};
|
|
69
|
+
title: {
|
|
70
|
+
type: string;
|
|
71
|
+
nullable: boolean;
|
|
72
|
+
};
|
|
73
|
+
description: {
|
|
74
|
+
type: string;
|
|
75
|
+
nullable: boolean;
|
|
76
|
+
};
|
|
77
|
+
complete: {
|
|
78
|
+
type: string;
|
|
79
|
+
nullable: boolean;
|
|
80
|
+
};
|
|
81
|
+
tags: {
|
|
82
|
+
type: string;
|
|
83
|
+
items: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
nullable: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
plan: {
|
|
91
|
+
type: string;
|
|
92
|
+
nullable: boolean;
|
|
93
|
+
properties: {
|
|
94
|
+
id: {
|
|
95
|
+
type: string;
|
|
96
|
+
nullable: boolean;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
batch: {
|
|
101
|
+
type: string;
|
|
102
|
+
nullable: boolean;
|
|
103
|
+
properties: {
|
|
104
|
+
size: {
|
|
105
|
+
type: string;
|
|
106
|
+
nullable: boolean;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
defect: {
|
|
111
|
+
type: string;
|
|
112
|
+
nullable: boolean;
|
|
113
|
+
};
|
|
114
|
+
configurations: {
|
|
115
|
+
type: string;
|
|
116
|
+
nullable: boolean;
|
|
117
|
+
properties: {
|
|
118
|
+
values: {
|
|
119
|
+
type: string;
|
|
120
|
+
items: {
|
|
121
|
+
type: string;
|
|
122
|
+
properties: {
|
|
123
|
+
name: {
|
|
124
|
+
type: string;
|
|
125
|
+
nullable: boolean;
|
|
126
|
+
};
|
|
127
|
+
value: {
|
|
128
|
+
type: string;
|
|
129
|
+
nullable: boolean;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
required: string[];
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
createIfNotExists: {
|
|
136
|
+
type: string;
|
|
137
|
+
nullable: boolean;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
required: string[];
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
report: {
|
|
145
|
+
type: string;
|
|
146
|
+
nullable: boolean;
|
|
147
|
+
properties: {
|
|
148
|
+
driver: {
|
|
149
|
+
type: string;
|
|
150
|
+
enum: DriverEnum[];
|
|
151
|
+
nullable: boolean;
|
|
152
|
+
};
|
|
153
|
+
connections: {
|
|
154
|
+
type: string;
|
|
155
|
+
nullable: boolean;
|
|
156
|
+
properties: {
|
|
157
|
+
local: {
|
|
158
|
+
type: string;
|
|
159
|
+
nullable: boolean;
|
|
160
|
+
properties: {
|
|
161
|
+
path: {
|
|
162
|
+
type: string;
|
|
163
|
+
nullable: boolean;
|
|
164
|
+
};
|
|
165
|
+
format: {
|
|
166
|
+
type: string;
|
|
167
|
+
enum: FormatEnum[];
|
|
168
|
+
nullable: boolean;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
};
|
|
@@ -114,6 +114,34 @@ exports.configValidationSchema = {
|
|
|
114
114
|
type: 'boolean',
|
|
115
115
|
nullable: true,
|
|
116
116
|
},
|
|
117
|
+
configurations: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
nullable: true,
|
|
120
|
+
properties: {
|
|
121
|
+
values: {
|
|
122
|
+
type: 'array',
|
|
123
|
+
items: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
name: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
nullable: true,
|
|
129
|
+
},
|
|
130
|
+
value: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
nullable: true,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ['name', 'value'],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
createIfNotExists: {
|
|
139
|
+
type: 'boolean',
|
|
140
|
+
nullable: true,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
required: ['values'],
|
|
144
|
+
},
|
|
117
145
|
},
|
|
118
146
|
},
|
|
119
147
|
report: {
|
package/dist/env/env-enum.d.ts
CHANGED
|
@@ -46,6 +46,13 @@ export declare enum EnvPlanEnum {
|
|
|
46
46
|
export declare enum EnvBatchEnum {
|
|
47
47
|
size = "QASE_TESTOPS_BATCH_SIZE"
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* @enum {string}
|
|
51
|
+
*/
|
|
52
|
+
export declare enum EnvConfigurationsEnum {
|
|
53
|
+
values = "QASE_TESTOPS_CONFIGURATIONS_VALUES",
|
|
54
|
+
createIfNotExists = "QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS"
|
|
55
|
+
}
|
|
49
56
|
/**
|
|
50
57
|
* @enum {string}
|
|
51
58
|
*/
|
package/dist/env/env-enum.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnvLocalEnum = exports.EnvBatchEnum = exports.EnvPlanEnum = exports.EnvRunEnum = exports.EnvApiEnum = exports.EnvTestOpsEnum = exports.EnvEnum = void 0;
|
|
3
|
+
exports.EnvLocalEnum = exports.EnvConfigurationsEnum = exports.EnvBatchEnum = exports.EnvPlanEnum = exports.EnvRunEnum = exports.EnvApiEnum = exports.EnvTestOpsEnum = exports.EnvEnum = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @enum {string}
|
|
6
6
|
*/
|
|
@@ -55,6 +55,14 @@ var EnvBatchEnum;
|
|
|
55
55
|
(function (EnvBatchEnum) {
|
|
56
56
|
EnvBatchEnum["size"] = "QASE_TESTOPS_BATCH_SIZE";
|
|
57
57
|
})(EnvBatchEnum || (exports.EnvBatchEnum = EnvBatchEnum = {}));
|
|
58
|
+
/**
|
|
59
|
+
* @enum {string}
|
|
60
|
+
*/
|
|
61
|
+
var EnvConfigurationsEnum;
|
|
62
|
+
(function (EnvConfigurationsEnum) {
|
|
63
|
+
EnvConfigurationsEnum["values"] = "QASE_TESTOPS_CONFIGURATIONS_VALUES";
|
|
64
|
+
EnvConfigurationsEnum["createIfNotExists"] = "QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS";
|
|
65
|
+
})(EnvConfigurationsEnum || (exports.EnvConfigurationsEnum = EnvConfigurationsEnum = {}));
|
|
58
66
|
/**
|
|
59
67
|
* @enum {string}
|
|
60
68
|
*/
|
|
@@ -34,6 +34,13 @@ const envToConfig = (env) => ({
|
|
|
34
34
|
size: env[env_enum_1.EnvBatchEnum.size],
|
|
35
35
|
},
|
|
36
36
|
defect: env[env_enum_1.EnvTestOpsEnum.defect],
|
|
37
|
+
configurations: env[env_enum_1.EnvConfigurationsEnum.values] ? {
|
|
38
|
+
values: env[env_enum_1.EnvConfigurationsEnum.values].split(',').map(item => {
|
|
39
|
+
const [name, value] = item.split('=');
|
|
40
|
+
return { name: (name ?? '').trim(), value: value ? value.trim() : '' };
|
|
41
|
+
}),
|
|
42
|
+
createIfNotExists: env[env_enum_1.EnvConfigurationsEnum.createIfNotExists],
|
|
43
|
+
} : undefined,
|
|
37
44
|
},
|
|
38
45
|
report: {
|
|
39
46
|
connections: {
|
package/dist/env/env-type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvEnum, EnvTestOpsEnum, EnvApiEnum, EnvRunEnum, EnvLocalEnum, EnvPlanEnum, EnvBatchEnum } from './env-enum';
|
|
1
|
+
import { EnvEnum, EnvTestOpsEnum, EnvApiEnum, EnvRunEnum, EnvLocalEnum, EnvPlanEnum, EnvBatchEnum, EnvConfigurationsEnum } from './env-enum';
|
|
2
2
|
import { ModeEnum } from '../options';
|
|
3
3
|
import { FormatEnum } from '../writer';
|
|
4
4
|
export interface EnvType {
|
|
@@ -20,6 +20,8 @@ export interface EnvType {
|
|
|
20
20
|
[EnvRunEnum.tags]?: string;
|
|
21
21
|
[EnvPlanEnum.id]?: number;
|
|
22
22
|
[EnvBatchEnum.size]?: number;
|
|
23
|
+
[EnvConfigurationsEnum.values]?: string;
|
|
24
|
+
[EnvConfigurationsEnum.createIfNotExists]?: boolean;
|
|
23
25
|
[EnvLocalEnum.path]?: string;
|
|
24
26
|
[EnvLocalEnum.format]?: `${FormatEnum}`;
|
|
25
27
|
}
|
|
@@ -84,6 +84,14 @@ exports.envValidationSchema = {
|
|
|
84
84
|
type: 'number',
|
|
85
85
|
nullable: true,
|
|
86
86
|
},
|
|
87
|
+
[env_enum_1.EnvConfigurationsEnum.values]: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
nullable: true,
|
|
90
|
+
},
|
|
91
|
+
[env_enum_1.EnvConfigurationsEnum.createIfNotExists]: {
|
|
92
|
+
type: 'boolean',
|
|
93
|
+
nullable: true,
|
|
94
|
+
},
|
|
87
95
|
[env_enum_1.EnvLocalEnum.path]: {
|
|
88
96
|
type: 'string',
|
|
89
97
|
nullable: true,
|
|
@@ -6,6 +6,15 @@ export interface TestOpsOptionsType {
|
|
|
6
6
|
plan: TestOpsPlanType;
|
|
7
7
|
batch?: TestOpsBatchType;
|
|
8
8
|
defect?: boolean | undefined;
|
|
9
|
+
configurations?: TestOpsConfigurationType | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface TestOpsConfigurationType {
|
|
12
|
+
values: TestOpsConfigurationValueType[];
|
|
13
|
+
createIfNotExists?: boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface TestOpsConfigurationValueType {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
9
18
|
}
|
|
10
19
|
export interface TestOpsRunType {
|
|
11
20
|
id?: number | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ConfigurationGroup {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
configurations: ConfigurationItem[];
|
|
5
|
+
}
|
|
6
|
+
export interface ConfigurationItem {
|
|
7
|
+
id: number;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ConfigurationGroupResponse {
|
|
11
|
+
groups: ConfigurationGroup[];
|
|
12
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { StepStatusEnum } from './step-execution';
|
|
|
5
5
|
export { Attachment } from './attachment';
|
|
6
6
|
export { Report } from './report';
|
|
7
7
|
export { CompoundError } from './error';
|
|
8
|
+
export { ConfigurationGroup, ConfigurationItem, ConfigurationGroupResponse } from './configuration';
|