@mablhq/mabl-cli 2.75.2 → 2.75.4
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/commands/mcp/mcp_cmds/tools/{createTest.js → createMablTest.js} +2 -2
- package/commands/mcp/mcp_cmds/tools/{getTestResults.js → getLatestTestRuns.js} +6 -6
- package/commands/mcp/mcp_cmds/tools/{getTest.js → getMablTestDetails.js} +2 -2
- package/commands/mcp/mcp_cmds/tools/{getTests.js → getMablTests.js} +5 -5
- package/commands/mcp/mcp_cmds/tools/index.js +17 -17
- package/commands/mcp/mcp_cmds/tools/{cloudRunTest.js → runMablTestCloud.js} +22 -9
- package/commands/mcp/mcp_cmds/tools/{runTest.js → runMablTestLocal.js} +3 -3
- package/execution/index.js +1 -1
- package/mablscript/steps/DownloadStep.js +2 -2
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ const messaging_1 = require("../../../../core/messaging/messaging");
|
|
|
7
7
|
const mablApi_1 = require("../../../../mablApi");
|
|
8
8
|
const common_1 = require("../utils/common");
|
|
9
9
|
const featureSet_1 = require("../../../../api/featureSet");
|
|
10
|
-
const
|
|
10
|
+
const createMablTest = (0, mcpMablTool_1.defineTool)({
|
|
11
11
|
schema: {
|
|
12
12
|
name: 'create_mabl_test',
|
|
13
13
|
title: 'Create a mabl test',
|
|
@@ -133,4 +133,4 @@ const runTest = (0, mcpMablTool_1.defineTool)({
|
|
|
133
133
|
};
|
|
134
134
|
},
|
|
135
135
|
});
|
|
136
|
-
exports.default = [
|
|
136
|
+
exports.default = [createMablTest];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getLatestTestRunsOutputSchema = void 0;
|
|
4
4
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const mablApi_1 = require("../../../../mablApi");
|
|
7
7
|
const common_1 = require("../utils/common");
|
|
8
|
-
exports.
|
|
8
|
+
exports.getLatestTestRunsOutputSchema = zod_1.z.object({
|
|
9
9
|
testResults: zod_1.z.array(zod_1.z.object({
|
|
10
10
|
testRunId: zod_1.z.string().nullable(),
|
|
11
11
|
environmentId: zod_1.z.string().nullable(),
|
|
@@ -14,9 +14,9 @@ exports.getTestResultsOutputSchema = zod_1.z.object({
|
|
|
14
14
|
errorMessage: zod_1.z.string(),
|
|
15
15
|
})),
|
|
16
16
|
});
|
|
17
|
-
const
|
|
17
|
+
const getLatestTestRuns = (0, mcpMablTool_1.defineTool)({
|
|
18
18
|
schema: {
|
|
19
|
-
name: '
|
|
19
|
+
name: 'get_latest_test_runs',
|
|
20
20
|
title: 'Get recent mabl test run results',
|
|
21
21
|
description: 'Get the recent execution results for a mabl test by testId. Example: Can you fetch the latest results for the test "Mabl login"?',
|
|
22
22
|
inputSchema: zod_1.z.object({
|
|
@@ -25,7 +25,7 @@ const getTestResults = (0, mcpMablTool_1.defineTool)({
|
|
|
25
25
|
.describe('The id of the mabl test to get recent results of'),
|
|
26
26
|
}),
|
|
27
27
|
type: 'readOnly',
|
|
28
|
-
outputSchema: exports.
|
|
28
|
+
outputSchema: exports.getLatestTestRunsOutputSchema,
|
|
29
29
|
},
|
|
30
30
|
handle: async (params, context) => {
|
|
31
31
|
const { mablApiClient, workspaceId } = context.getCurrentContext();
|
|
@@ -83,4 +83,4 @@ const getTestResults = (0, mcpMablTool_1.defineTool)({
|
|
|
83
83
|
};
|
|
84
84
|
},
|
|
85
85
|
});
|
|
86
|
-
exports.default = [
|
|
86
|
+
exports.default = [getLatestTestRuns];
|
|
@@ -4,7 +4,7 @@ const zod_1 = require("zod");
|
|
|
4
4
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
5
5
|
const testUtils_1 = require("../utils/testUtils");
|
|
6
6
|
const common_1 = require("../utils/common");
|
|
7
|
-
const
|
|
7
|
+
const getMablTestDetails = (0, mcpMablTool_1.defineTool)({
|
|
8
8
|
schema: {
|
|
9
9
|
name: 'get_mabl_test_details',
|
|
10
10
|
title: 'Get the details of a mabl test',
|
|
@@ -30,4 +30,4 @@ const getTest = (0, mcpMablTool_1.defineTool)({
|
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
exports.default = [
|
|
33
|
+
exports.default = [getMablTestDetails];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getMablTestsOutputSchema = void 0;
|
|
4
4
|
const common_1 = require("../utils/common");
|
|
5
5
|
const testUtils_1 = require("../utils/testUtils");
|
|
6
6
|
const mcpMablTool_1 = require("./mcpMablTool");
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
|
-
exports.
|
|
8
|
+
exports.getMablTestsOutputSchema = zod_1.z.object({
|
|
9
9
|
tests: zod_1.z.array(zod_1.z.object({
|
|
10
10
|
id: zod_1.z.string().optional(),
|
|
11
11
|
name: zod_1.z.string().optional(),
|
|
@@ -20,7 +20,7 @@ exports.getTestsOutputSchema = zod_1.z.object({
|
|
|
20
20
|
viewTestUrl: zod_1.z.string().optional(),
|
|
21
21
|
})),
|
|
22
22
|
});
|
|
23
|
-
const
|
|
23
|
+
const getMablTests = (0, mcpMablTool_1.defineTool)({
|
|
24
24
|
schema: {
|
|
25
25
|
name: 'get_mabl_tests',
|
|
26
26
|
title: 'Get mabl tests based on a query',
|
|
@@ -33,7 +33,7 @@ const getTests = (0, mcpMablTool_1.defineTool)({
|
|
|
33
33
|
.optional(),
|
|
34
34
|
}),
|
|
35
35
|
type: 'readOnly',
|
|
36
|
-
outputSchema: exports.
|
|
36
|
+
outputSchema: exports.getMablTestsOutputSchema,
|
|
37
37
|
},
|
|
38
38
|
handle: async (params, context) => {
|
|
39
39
|
const limit = 1_000;
|
|
@@ -64,4 +64,4 @@ const getTests = (0, mcpMablTool_1.defineTool)({
|
|
|
64
64
|
};
|
|
65
65
|
},
|
|
66
66
|
});
|
|
67
|
-
exports.default = [
|
|
67
|
+
exports.default = [getMablTests];
|
|
@@ -4,40 +4,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const getEnvironments_1 = __importDefault(require("./getEnvironments"));
|
|
7
|
-
const
|
|
7
|
+
const getMablTests_1 = __importDefault(require("./getMablTests"));
|
|
8
8
|
const getMablDeployment_1 = __importDefault(require("./getMablDeployment"));
|
|
9
|
-
const
|
|
9
|
+
const getLatestTestRuns_1 = __importDefault(require("./getLatestTestRuns"));
|
|
10
10
|
const getApplications_1 = __importDefault(require("./getApplications"));
|
|
11
11
|
const getCredentials_1 = __importDefault(require("./getCredentials"));
|
|
12
12
|
const analyzeFailure_1 = __importDefault(require("./analyzeFailure"));
|
|
13
|
-
const
|
|
13
|
+
const runMablTestLocal_1 = __importDefault(require("./runMablTestLocal"));
|
|
14
14
|
const exportToPlaywright_1 = __importDefault(require("./exportToPlaywright"));
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const runMablTestCloud_1 = __importDefault(require("./runMablTestCloud"));
|
|
16
|
+
const createMablTest_1 = __importDefault(require("./createMablTest"));
|
|
17
17
|
const getPlans_1 = __importDefault(require("./getPlans"));
|
|
18
18
|
const getPlanRunResult_1 = __importDefault(require("./getPlanRunResult"));
|
|
19
19
|
const getLatestPlanRuns_1 = __importDefault(require("./getLatestPlanRuns"));
|
|
20
20
|
const getLatestAuthoredTests_1 = __importDefault(require("./getLatestAuthoredTests"));
|
|
21
21
|
const getWorkspaces_1 = __importDefault(require("./getWorkspaces"));
|
|
22
22
|
const switchWorkspace_1 = __importDefault(require("./switchWorkspace"));
|
|
23
|
-
const
|
|
23
|
+
const getMablTestDetails_1 = __importDefault(require("./getMablTestDetails"));
|
|
24
24
|
exports.default = [
|
|
25
|
-
...
|
|
25
|
+
...analyzeFailure_1.default,
|
|
26
|
+
...createMablTest_1.default,
|
|
27
|
+
...exportToPlaywright_1.default,
|
|
26
28
|
...getApplications_1.default,
|
|
27
29
|
...getCredentials_1.default,
|
|
28
30
|
...getEnvironments_1.default,
|
|
29
|
-
...
|
|
30
|
-
...
|
|
31
|
-
...
|
|
31
|
+
...getLatestAuthoredTests_1.default,
|
|
32
|
+
...getLatestPlanRuns_1.default,
|
|
33
|
+
...getLatestTestRuns_1.default,
|
|
32
34
|
...getMablDeployment_1.default,
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
...runTest_1.default,
|
|
36
|
-
...exportToPlaywright_1.default,
|
|
37
|
-
...createTest_1.default,
|
|
35
|
+
...getMablTestDetails_1.default,
|
|
36
|
+
...getMablTests_1.default,
|
|
38
37
|
...getPlanRunResult_1.default,
|
|
39
|
-
...
|
|
40
|
-
...getLatestAuthoredTests_1.default,
|
|
38
|
+
...getPlans_1.default,
|
|
41
39
|
...getWorkspaces_1.default,
|
|
40
|
+
...runMablTestCloud_1.default,
|
|
41
|
+
...runMablTestLocal_1.default,
|
|
42
42
|
...switchWorkspace_1.default,
|
|
43
43
|
];
|
|
@@ -7,9 +7,9 @@ const run_cloud_1 = require("../../../tests/tests_cmds/run-cloud");
|
|
|
7
7
|
const common_1 = require("../utils/common");
|
|
8
8
|
const testUtils_1 = require("../utils/testUtils");
|
|
9
9
|
const constants_1 = require("../../../constants");
|
|
10
|
-
const
|
|
10
|
+
const runMablTestCloud = (0, mcpMablTool_1.defineTool)({
|
|
11
11
|
schema: {
|
|
12
|
-
name: '
|
|
12
|
+
name: 'run_mabl_test_cloud',
|
|
13
13
|
title: 'Run a mabl test in the mabl cloud',
|
|
14
14
|
description: 'Run a mabl test in the mabl cloud. Example: Run mabl test "Mabl Login" in application MyApplication in environment Development using the "Admin user" credential and the "Chrome" browser',
|
|
15
15
|
inputSchema: zod_1.z.object({
|
|
@@ -30,13 +30,23 @@ const cloudRunTest = (0, mcpMablTool_1.defineTool)({
|
|
|
30
30
|
}),
|
|
31
31
|
type: 'destructive',
|
|
32
32
|
outputSchema: zod_1.z.object({
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
testRuns: zod_1.z.array(zod_1.z.object({
|
|
34
|
+
id: zod_1.z.string().describe('The id of the test run'),
|
|
35
|
+
browser: zod_1.z
|
|
36
|
+
.string()
|
|
37
|
+
.describe('The browser used to run the test')
|
|
38
|
+
.optional(),
|
|
39
|
+
outputUrl: zod_1.z.string().describe('The output URL of the test run'),
|
|
40
|
+
})),
|
|
35
41
|
}),
|
|
36
42
|
},
|
|
37
43
|
handle: async (params, context) => {
|
|
38
44
|
const { mablApiClient, workspaceId } = context.getCurrentContext();
|
|
39
45
|
const test = await mablApiClient.getJourney(params.testId);
|
|
46
|
+
if (test.test_type === mablApi_1.TestTypeEnum.Performance ||
|
|
47
|
+
test.test_type === mablApi_1.TestTypeEnum.Mobile) {
|
|
48
|
+
return (0, common_1.stringToToolResult)('Performance and mobile tests are not currently supported, please use mabl-cli to run these tests.', true);
|
|
49
|
+
}
|
|
40
50
|
if (!params.applicationId) {
|
|
41
51
|
return (0, common_1.stringToToolResult)('applicationId is required when running a test in the cloud. Request the application explicitly.', true);
|
|
42
52
|
}
|
|
@@ -55,17 +65,20 @@ const cloudRunTest = (0, mcpMablTool_1.defineTool)({
|
|
|
55
65
|
if (!test.organization_id || !testRun[0]?.id) {
|
|
56
66
|
return (0, common_1.stringToToolResult)('Failed to retrieve test run output URL due to missing organization_id or test run id.', true);
|
|
57
67
|
}
|
|
58
|
-
const
|
|
59
|
-
|
|
68
|
+
const testRuns = testRun.map((testRun) => ({
|
|
69
|
+
id: testRun.id,
|
|
70
|
+
browser: testRun.browser,
|
|
71
|
+
outputUrl: (0, testUtils_1.getTestOutputUrl)(testRun.organization_id, testRun.id),
|
|
72
|
+
}));
|
|
60
73
|
return {
|
|
61
74
|
content: [
|
|
62
75
|
{
|
|
63
76
|
type: 'text',
|
|
64
|
-
text: JSON.stringify({
|
|
77
|
+
text: JSON.stringify({ testRuns }, undefined, 2),
|
|
65
78
|
},
|
|
66
79
|
],
|
|
67
|
-
structuredContent: {
|
|
80
|
+
structuredContent: { testRuns },
|
|
68
81
|
};
|
|
69
82
|
},
|
|
70
83
|
});
|
|
71
|
-
exports.default = [
|
|
84
|
+
exports.default = [runMablTestCloud];
|
|
@@ -13,9 +13,9 @@ const runTestOutputSchema = zod_1.z.object({
|
|
|
13
13
|
.describe('Error message if the test failed, empty if succeeded'),
|
|
14
14
|
Logs: zod_1.z.array(zod_1.z.string()).describe('All log lines in order'),
|
|
15
15
|
});
|
|
16
|
-
const
|
|
16
|
+
const runMablTestLocal = (0, mcpMablTool_1.defineTool)({
|
|
17
17
|
schema: {
|
|
18
|
-
name: '
|
|
18
|
+
name: 'run_mabl_test_local',
|
|
19
19
|
title: 'Run a mabl test',
|
|
20
20
|
description: 'Locally run a mabl test. Example: Run mabl test "Mabl Login" in environment Development using the "Admin user" credential',
|
|
21
21
|
inputSchema: zod_1.z.object({
|
|
@@ -95,4 +95,4 @@ const runTest = (0, mcpMablTool_1.defineTool)({
|
|
|
95
95
|
};
|
|
96
96
|
},
|
|
97
97
|
});
|
|
98
|
-
exports.default = [
|
|
98
|
+
exports.default = [runMablTestLocal];
|