complexqa_frontend_core 1.13.4 → 1.13.5
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/package.json
CHANGED
|
@@ -10,4 +10,26 @@ export class TestRunApi extends ApiAbstractElementClass
|
|
|
10
10
|
super(options);
|
|
11
11
|
this.set_element_class_instance(typeTestRun);
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @version v.1.0 (07/04/2026)
|
|
18
|
+
*
|
|
19
|
+
* @param payload
|
|
20
|
+
* @returns {Promise<{payload, response: Promise<*>}>}
|
|
21
|
+
*/
|
|
22
|
+
async add_test_cases(payload)
|
|
23
|
+
{
|
|
24
|
+
let url = `/${ this.api_prefix }/${ this.module_prefix }/add_test_cases`;
|
|
25
|
+
|
|
26
|
+
payload = this.handle_request_payload(payload);
|
|
27
|
+
let response = this.api_request(url, payload);
|
|
28
|
+
response = this.handle_response(response);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
response: response,
|
|
32
|
+
payload : payload
|
|
33
|
+
};
|
|
34
|
+
}
|
|
13
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { is_object } from "../../utils/utils";
|
|
1
|
+
import { echo, is_object } from "../../utils/utils";
|
|
2
2
|
import { familyTestDocumentation } from "./1_familyTestDocumentation.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -112,7 +112,6 @@ export class typeTestRun extends familyTestDocumentation
|
|
|
112
112
|
|
|
113
113
|
/******************************************************************************************/
|
|
114
114
|
/******************************************************************************************/
|
|
115
|
-
|
|
116
115
|
/******************************************************************************************/
|
|
117
116
|
|
|
118
117
|
/**
|
|
@@ -146,4 +145,62 @@ export class typeTestRun extends familyTestDocumentation
|
|
|
146
145
|
{
|
|
147
146
|
return this.test_run_name;
|
|
148
147
|
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
/******************************************************************************************/
|
|
151
|
+
/******************************************************************************************/
|
|
152
|
+
/******************************************************************************************/
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Добавляет переданные TestCases к существующему TestRun
|
|
157
|
+
*
|
|
158
|
+
* @version v.1.0 (07/04/2026)
|
|
159
|
+
*
|
|
160
|
+
* @param {array<number>} test_case_ids
|
|
161
|
+
* @param {object|typeFunctionCallback} callback
|
|
162
|
+
* @returns {Promise<void>}
|
|
163
|
+
*/
|
|
164
|
+
async add_test_cases(test_case_ids, callback)
|
|
165
|
+
{
|
|
166
|
+
if (!this.test_run_id)
|
|
167
|
+
{
|
|
168
|
+
throw new Error('Error #165-2215 - element has no test_run_id');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
let payload = {
|
|
172
|
+
test_run_id: this.test_run_id,
|
|
173
|
+
test_case_ids: test_case_ids
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
if (typeof callback?.before === 'function')
|
|
178
|
+
{
|
|
179
|
+
callback?.before({ payload });
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* {Api} ApiService
|
|
184
|
+
*/
|
|
185
|
+
return ApiService[ this.api_key ].add_test_cases(payload).then((response) =>
|
|
186
|
+
{
|
|
187
|
+
if (typeof callback?.success === 'function')
|
|
188
|
+
{
|
|
189
|
+
callback?.success({ response, payload })
|
|
190
|
+
}
|
|
191
|
+
}).catch((error) =>
|
|
192
|
+
{
|
|
193
|
+
echo({ error });
|
|
194
|
+
if (typeof callback?.error === 'function')
|
|
195
|
+
{
|
|
196
|
+
callback?.error({ error, payload })
|
|
197
|
+
}
|
|
198
|
+
}).finally((response) =>
|
|
199
|
+
{
|
|
200
|
+
if (typeof callback?.final === 'function')
|
|
201
|
+
{
|
|
202
|
+
callback?.final({ response, payload })
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
149
206
|
}
|