@mablhq/mabl-cli 2.78.5 → 2.79.7
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/api/mablApiClient.js +24 -13
- package/browserLauncher/index.js +3 -3
- package/commands/mcp/mcp_cmds/tools/assignXrayToMablTest.js +1 -2
- package/commands/mcp/mcp_cmds/tools/createMablTest.js +2 -12
- package/commands/mcp/mcp_cmds/tools/createMablTestFromPlan.js +3 -2
- package/commands/mcp/mcp_cmds/tools/getXrayTestCases.js +27 -4
- package/commands/mcp/mcp_cmds/utils/testUtils.js +6 -0
- package/commands/tests/testsUtil.js +31 -56
- package/core/trainer/openUtils.js +5 -1
- package/execution/index.js +1 -1
- package/http/agentUtil.js +53 -0
- package/http/httpUtil.js +0 -51
- package/package.json +1 -2
- package/util/clickUtil.js +2 -2
- package/util/errorUtil.js +34 -0
package/api/mablApiClient.js
CHANGED
|
@@ -143,7 +143,7 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
143
143
|
}
|
|
144
144
|
async getExternalTcmBindingById(testCaseId) {
|
|
145
145
|
try {
|
|
146
|
-
return await this.makeGetRequest(`${this.baseApiUrl}/
|
|
146
|
+
return await this.makeGetRequest(`${this.baseApiUrl}/tcm/external/bindings/xray/test_case/${testCaseId}`);
|
|
147
147
|
}
|
|
148
148
|
catch (error) {
|
|
149
149
|
throw toApiError(`Failed to query external tcm`, error);
|
|
@@ -312,9 +312,12 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
312
312
|
throw toApiError(`Failed to get integrations`, error);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
async queryXrayTests(xrayProjectId) {
|
|
315
|
+
async queryXrayTests(xrayProjectId, limit, offset) {
|
|
316
316
|
try {
|
|
317
|
-
return await this.makeGetRequest(`${this.baseApiUrl}/integrations/${xrayProjectId}/xray/tests
|
|
317
|
+
return await this.makeGetRequest(`${this.baseApiUrl}/integrations/${xrayProjectId}/xray/tests?${query_string_1.default.stringify({
|
|
318
|
+
limit,
|
|
319
|
+
start: offset,
|
|
320
|
+
})}`);
|
|
318
321
|
}
|
|
319
322
|
catch (error) {
|
|
320
323
|
throw toApiError(`Failed to get xray test cases`, error);
|
|
@@ -1246,25 +1249,33 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
1246
1249
|
throw toApiError(`Failed to terminate mobile training session ${id}`, error);
|
|
1247
1250
|
}
|
|
1248
1251
|
}
|
|
1249
|
-
async
|
|
1252
|
+
async generateElementDescription(workspaceId, request) {
|
|
1253
|
+
try {
|
|
1254
|
+
return await this.makePostRequest(`${this.baseApiUrl}/generate/elementDescription?workspaceId=${workspaceId}`, request);
|
|
1255
|
+
}
|
|
1256
|
+
catch (error) {
|
|
1257
|
+
throw toApiError(`Failed to generate element description`, error);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
async findElementImage(screenshot, findPrompt, workspaceId, includeElementImage, context) {
|
|
1250
1261
|
try {
|
|
1251
|
-
const
|
|
1262
|
+
const response = await this.makePostRequest(`${this.baseApiAgentUrl}/agent/find/findElementImage?workspaceId=${workspaceId}`, {
|
|
1252
1263
|
screenshot,
|
|
1253
1264
|
description: findPrompt,
|
|
1254
1265
|
context,
|
|
1266
|
+
include_element_image: includeElementImage,
|
|
1255
1267
|
});
|
|
1256
|
-
if (!found) {
|
|
1268
|
+
if (!response.found) {
|
|
1257
1269
|
return undefined;
|
|
1258
1270
|
}
|
|
1259
|
-
if (
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
console.debug(`Incomplete bounding box for ${findPrompt}:`,
|
|
1271
|
+
if (response.bounding_box?.x === undefined ||
|
|
1272
|
+
response.bounding_box?.y === undefined ||
|
|
1273
|
+
response.bounding_box?.width === undefined ||
|
|
1274
|
+
response.bounding_box?.height === undefined) {
|
|
1275
|
+
console.debug(`Incomplete bounding box for ${findPrompt}:`, response.bounding_box);
|
|
1264
1276
|
return undefined;
|
|
1265
1277
|
}
|
|
1266
|
-
|
|
1267
|
-
return { x, y, width, height };
|
|
1278
|
+
return response;
|
|
1268
1279
|
}
|
|
1269
1280
|
catch (error) {
|
|
1270
1281
|
throw toApiError(`Failed to find element image ${findPrompt}`, error);
|