@muggleai/mcp-qa-gateway 1.0.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.
- package/README.md +185 -0
- package/dist/scripts/phase0-smoke.d.ts +7 -0
- package/dist/scripts/phase0-smoke.d.ts.map +1 -0
- package/dist/scripts/phase0-smoke.js +1712 -0
- package/dist/scripts/phase0-smoke.js.map +1 -0
- package/dist/scripts/types/phase0-smoke-types.d.ts +89 -0
- package/dist/scripts/types/phase0-smoke-types.d.ts.map +1 -0
- package/dist/scripts/types/phase0-smoke-types.js +3 -0
- package/dist/scripts/types/phase0-smoke-types.js.map +1 -0
- package/dist/src/__tests__/helpers/mock-setup.d.ts +28 -0
- package/dist/src/__tests__/helpers/mock-setup.d.ts.map +1 -0
- package/dist/src/__tests__/helpers/mock-setup.js +44 -0
- package/dist/src/__tests__/helpers/mock-setup.js.map +1 -0
- package/dist/src/__tests__/helpers/test-fixtures.d.ts +38 -0
- package/dist/src/__tests__/helpers/test-fixtures.d.ts.map +1 -0
- package/dist/src/__tests__/helpers/test-fixtures.js +62 -0
- package/dist/src/__tests__/helpers/test-fixtures.js.map +1 -0
- package/dist/src/__tests__/tools/artifact-tools.test.d.ts +9 -0
- package/dist/src/__tests__/tools/artifact-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/artifact-tools.test.js +307 -0
- package/dist/src/__tests__/tools/artifact-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/prd-file-tools.test.d.ts +7 -0
- package/dist/src/__tests__/tools/prd-file-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/prd-file-tools.test.js +278 -0
- package/dist/src/__tests__/tools/prd-file-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/project-tools.test.d.ts +7 -0
- package/dist/src/__tests__/tools/project-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/project-tools.test.js +281 -0
- package/dist/src/__tests__/tools/project-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/recommendation-tools.test.d.ts +6 -0
- package/dist/src/__tests__/tools/recommendation-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/recommendation-tools.test.js +193 -0
- package/dist/src/__tests__/tools/recommendation-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/report-tools.test.d.ts +7 -0
- package/dist/src/__tests__/tools/report-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/report-tools.test.js +226 -0
- package/dist/src/__tests__/tools/report-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/secret-tools.test.d.ts +6 -0
- package/dist/src/__tests__/tools/secret-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/secret-tools.test.js +243 -0
- package/dist/src/__tests__/tools/secret-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/test-case-prompt-tools.test.d.ts +6 -0
- package/dist/src/__tests__/tools/test-case-prompt-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/test-case-prompt-tools.test.js +291 -0
- package/dist/src/__tests__/tools/test-case-prompt-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/tool-registry.test.d.ts +7 -0
- package/dist/src/__tests__/tools/tool-registry.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/tool-registry.test.js +205 -0
- package/dist/src/__tests__/tools/tool-registry.test.js.map +1 -0
- package/dist/src/__tests__/tools/use-case-tools.test.d.ts +7 -0
- package/dist/src/__tests__/tools/use-case-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/use-case-tools.test.js +177 -0
- package/dist/src/__tests__/tools/use-case-tools.test.js.map +1 -0
- package/dist/src/__tests__/tools/workflow-tools.test.d.ts +15 -0
- package/dist/src/__tests__/tools/workflow-tools.test.d.ts.map +1 -0
- package/dist/src/__tests__/tools/workflow-tools.test.js +627 -0
- package/dist/src/__tests__/tools/workflow-tools.test.js.map +1 -0
- package/dist/src/config/index.d.ts +18 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +76 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +88 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/caller-credentials.d.ts +10 -0
- package/dist/src/interfaces/caller-credentials.d.ts.map +1 -0
- package/dist/src/interfaces/caller-credentials.js +3 -0
- package/dist/src/interfaces/caller-credentials.js.map +1 -0
- package/dist/src/interfaces/gateway-config.d.ts +28 -0
- package/dist/src/interfaces/gateway-config.d.ts.map +1 -0
- package/dist/src/interfaces/gateway-config.js +3 -0
- package/dist/src/interfaces/gateway-config.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +13 -0
- package/dist/src/interfaces/index.d.ts.map +1 -0
- package/dist/src/interfaces/index.js +7 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/interfaces/mcp-tool-call-protocol.d.ts +61 -0
- package/dist/src/interfaces/mcp-tool-call-protocol.d.ts.map +1 -0
- package/dist/src/interfaces/mcp-tool-call-protocol.js +7 -0
- package/dist/src/interfaces/mcp-tool-call-protocol.js.map +1 -0
- package/dist/src/interfaces/pagination.d.ts +24 -0
- package/dist/src/interfaces/pagination.d.ts.map +1 -0
- package/dist/src/interfaces/pagination.js +6 -0
- package/dist/src/interfaces/pagination.js.map +1 -0
- package/dist/src/interfaces/tool-definition.d.ts +22 -0
- package/dist/src/interfaces/tool-definition.d.ts.map +1 -0
- package/dist/src/interfaces/tool-definition.js +6 -0
- package/dist/src/interfaces/tool-definition.js.map +1 -0
- package/dist/src/interfaces/tool-mapping.d.ts +20 -0
- package/dist/src/interfaces/tool-mapping.d.ts.map +1 -0
- package/dist/src/interfaces/tool-mapping.js +6 -0
- package/dist/src/interfaces/tool-mapping.js.map +1 -0
- package/dist/src/interfaces/upstream-call.d.ts +27 -0
- package/dist/src/interfaces/upstream-call.d.ts.map +1 -0
- package/dist/src/interfaces/upstream-call.js +3 -0
- package/dist/src/interfaces/upstream-call.js.map +1 -0
- package/dist/src/interfaces/upstream-response.d.ts +12 -0
- package/dist/src/interfaces/upstream-response.d.ts.map +1 -0
- package/dist/src/interfaces/upstream-response.js +3 -0
- package/dist/src/interfaces/upstream-response.js.map +1 -0
- package/dist/src/server/http-server.d.ts +13 -0
- package/dist/src/server/http-server.d.ts.map +1 -0
- package/dist/src/server/http-server.js +219 -0
- package/dist/src/server/http-server.js.map +1 -0
- package/dist/src/server/mcp-server.d.ts +11 -0
- package/dist/src/server/mcp-server.d.ts.map +1 -0
- package/dist/src/server/mcp-server.js +363 -0
- package/dist/src/server/mcp-server.js.map +1 -0
- package/dist/src/server/session-credentials.d.ts +8 -0
- package/dist/src/server/session-credentials.d.ts.map +1 -0
- package/dist/src/server/session-credentials.js +24 -0
- package/dist/src/server/session-credentials.js.map +1 -0
- package/dist/src/tools/constants.d.ts +6 -0
- package/dist/src/tools/constants.d.ts.map +1 -0
- package/dist/src/tools/constants.js +9 -0
- package/dist/src/tools/constants.js.map +1 -0
- package/dist/src/tools/index.d.ts +7 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +23 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/schemas.d.ts +906 -0
- package/dist/src/tools/schemas.d.ts.map +1 -0
- package/dist/src/tools/schemas.js +386 -0
- package/dist/src/tools/schemas.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +26 -0
- package/dist/src/tools/tool-registry.d.ts.map +1 -0
- package/dist/src/tools/tool-registry.js +1142 -0
- package/dist/src/tools/tool-registry.js.map +1 -0
- package/dist/src/types/index.d.ts +35 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +55 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/upstream/prompt-service-client.d.ts +62 -0
- package/dist/src/upstream/prompt-service-client.d.ts.map +1 -0
- package/dist/src/upstream/prompt-service-client.js +329 -0
- package/dist/src/upstream/prompt-service-client.js.map +1 -0
- package/dist/src/utils/logger.d.ts +17 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +64 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +21 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tests for Workflow MCP tools.
|
|
4
|
+
* Covers: qa_workflow_start_website_scan, qa_workflow_list_website_scan_runtimes,
|
|
5
|
+
* qa_workflow_get_website_scan_latest_run, qa_workflow_start_test_case_detection,
|
|
6
|
+
* qa_workflow_list_test_case_detection_runtimes, qa_workflow_get_test_case_detection_latest_run,
|
|
7
|
+
* qa_workflow_start_test_script_generation, qa_workflow_get_test_script_generation_latest_run,
|
|
8
|
+
* qa_workflow_get_latest_test_script_generation_runtime_by_test_case,
|
|
9
|
+
* qa_workflow_start_test_script_replay, qa_workflow_get_test_script_replay_latest_run,
|
|
10
|
+
* qa_workflow_start_test_script_replay_bulk, qa_workflow_list_test_script_replay_bulk_runtimes,
|
|
11
|
+
* qa_workflow_get_test_script_replay_bulk_latest_run,
|
|
12
|
+
* qa_workflow_get_replay_bulk_run_batch_summary,
|
|
13
|
+
* qa_workflow_cancel_run, qa_workflow_cancel_runtime
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const vitest_1 = require("vitest");
|
|
17
|
+
const zod_1 = require("zod");
|
|
18
|
+
const schemas_js_1 = require("../../tools/schemas.js");
|
|
19
|
+
const tool_registry_js_1 = require("../../tools/tool-registry.js");
|
|
20
|
+
const test_fixtures_js_1 = require("../helpers/test-fixtures.js");
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// Helper
|
|
23
|
+
// =============================================================================
|
|
24
|
+
/**
|
|
25
|
+
* Find a tool by name from the registry.
|
|
26
|
+
* @param name - Tool name to find.
|
|
27
|
+
* @returns The tool definition.
|
|
28
|
+
*/
|
|
29
|
+
function findTool(name) {
|
|
30
|
+
const tool = tool_registry_js_1.allTools.find((t) => t.name === name);
|
|
31
|
+
if (!tool) {
|
|
32
|
+
throw new Error(`Tool '${name}' not found in registry`);
|
|
33
|
+
}
|
|
34
|
+
return tool;
|
|
35
|
+
}
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// qa_workflow_start_website_scan
|
|
38
|
+
// =============================================================================
|
|
39
|
+
(0, vitest_1.describe)("qa_workflow_start_website_scan", () => {
|
|
40
|
+
const TOOL_NAME = "qa_workflow_start_website_scan";
|
|
41
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
42
|
+
(0, vitest_1.it)("should accept valid input with required fields", () => {
|
|
43
|
+
const input = {
|
|
44
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
45
|
+
url: "https://example.com",
|
|
46
|
+
description: "Scan login and checkout flows",
|
|
47
|
+
};
|
|
48
|
+
const result = schemas_js_1.WorkflowStartWebsiteScanInputSchema.parse(input);
|
|
49
|
+
(0, vitest_1.expect)(result.projectId).toBe(test_fixtures_js_1.TEST_PROJECT_ID);
|
|
50
|
+
(0, vitest_1.expect)(result.url).toBe("https://example.com");
|
|
51
|
+
(0, vitest_1.expect)(result.description).toBe("Scan login and checkout flows");
|
|
52
|
+
});
|
|
53
|
+
(0, vitest_1.it)("should accept valid input with optional archiveUnapproved", () => {
|
|
54
|
+
const input = {
|
|
55
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
56
|
+
url: "https://example.com",
|
|
57
|
+
description: "Scan flows",
|
|
58
|
+
archiveUnapproved: true,
|
|
59
|
+
};
|
|
60
|
+
const result = schemas_js_1.WorkflowStartWebsiteScanInputSchema.parse(input);
|
|
61
|
+
(0, vitest_1.expect)(result.archiveUnapproved).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
(0, vitest_1.it)("should reject input with invalid URL", () => {
|
|
64
|
+
const input = {
|
|
65
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
66
|
+
url: "not-valid",
|
|
67
|
+
description: "Scan",
|
|
68
|
+
};
|
|
69
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartWebsiteScanInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
70
|
+
});
|
|
71
|
+
(0, vitest_1.it)("should reject input with empty description", () => {
|
|
72
|
+
const input = {
|
|
73
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
74
|
+
url: "https://example.com",
|
|
75
|
+
description: "",
|
|
76
|
+
};
|
|
77
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartWebsiteScanInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
81
|
+
(0, vitest_1.it)("should produce correct POST call with body and timeout", () => {
|
|
82
|
+
const tool = findTool(TOOL_NAME);
|
|
83
|
+
const input = {
|
|
84
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
85
|
+
url: "https://example.com",
|
|
86
|
+
description: "Scan flows",
|
|
87
|
+
archiveUnapproved: true,
|
|
88
|
+
};
|
|
89
|
+
const result = tool.mapToUpstream(input);
|
|
90
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
91
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/use-case/website-scan`);
|
|
92
|
+
(0, vitest_1.expect)(result.body).toEqual({
|
|
93
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
94
|
+
url: "https://example.com",
|
|
95
|
+
description: "Scan flows",
|
|
96
|
+
archiveUnapproved: true,
|
|
97
|
+
});
|
|
98
|
+
(0, vitest_1.expect)(result.timeoutMs).toBeDefined();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
// =============================================================================
|
|
103
|
+
// qa_workflow_list_website_scan_runtimes
|
|
104
|
+
// =============================================================================
|
|
105
|
+
(0, vitest_1.describe)("qa_workflow_list_website_scan_runtimes", () => {
|
|
106
|
+
const TOOL_NAME = "qa_workflow_list_website_scan_runtimes";
|
|
107
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
108
|
+
(0, vitest_1.it)("should accept valid input with optional projectId", () => {
|
|
109
|
+
const input = { projectId: test_fixtures_js_1.TEST_PROJECT_ID };
|
|
110
|
+
const result = schemas_js_1.WorkflowListRuntimesInputSchema.parse(input);
|
|
111
|
+
(0, vitest_1.expect)(result.projectId).toBe(test_fixtures_js_1.TEST_PROJECT_ID);
|
|
112
|
+
});
|
|
113
|
+
(0, vitest_1.it)("should accept empty input (projectId is optional)", () => {
|
|
114
|
+
const input = {};
|
|
115
|
+
const result = schemas_js_1.WorkflowListRuntimesInputSchema.parse(input);
|
|
116
|
+
(0, vitest_1.expect)(result.projectId).toBeUndefined();
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
120
|
+
(0, vitest_1.it)("should produce correct GET call with projectId query param", () => {
|
|
121
|
+
const tool = findTool(TOOL_NAME);
|
|
122
|
+
const input = { projectId: test_fixtures_js_1.TEST_PROJECT_ID };
|
|
123
|
+
const result = tool.mapToUpstream(input);
|
|
124
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
125
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/use-case/website-scan/workflowRuntimes`);
|
|
126
|
+
(0, vitest_1.expect)(result.queryParams).toEqual({
|
|
127
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
// =============================================================================
|
|
133
|
+
// qa_workflow_get_website_scan_latest_run
|
|
134
|
+
// =============================================================================
|
|
135
|
+
(0, vitest_1.describe)("qa_workflow_get_website_scan_latest_run", () => {
|
|
136
|
+
const TOOL_NAME = "qa_workflow_get_website_scan_latest_run";
|
|
137
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
138
|
+
(0, vitest_1.it)("should accept valid input with workflowRuntimeId", () => {
|
|
139
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
140
|
+
const result = schemas_js_1.WorkflowGetLatestRunInputSchema.parse(input);
|
|
141
|
+
(0, vitest_1.expect)(result.workflowRuntimeId).toBe(test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID);
|
|
142
|
+
});
|
|
143
|
+
(0, vitest_1.it)("should reject input with empty workflowRuntimeId", () => {
|
|
144
|
+
const input = { workflowRuntimeId: "" };
|
|
145
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowGetLatestRunInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
149
|
+
(0, vitest_1.it)("should produce correct GET call with runtime ID in path", () => {
|
|
150
|
+
const tool = findTool(TOOL_NAME);
|
|
151
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
152
|
+
const result = tool.mapToUpstream(input);
|
|
153
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
154
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/use-case/website-scan/${test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID}/run/latest`);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
// =============================================================================
|
|
159
|
+
// qa_workflow_start_test_case_detection
|
|
160
|
+
// =============================================================================
|
|
161
|
+
(0, vitest_1.describe)("qa_workflow_start_test_case_detection", () => {
|
|
162
|
+
const TOOL_NAME = "qa_workflow_start_test_case_detection";
|
|
163
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
164
|
+
(0, vitest_1.it)("should accept valid input with all required fields", () => {
|
|
165
|
+
const input = {
|
|
166
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
167
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
168
|
+
name: "Detect test cases for login",
|
|
169
|
+
description: "Find test cases for user login flow",
|
|
170
|
+
url: "https://example.com/login",
|
|
171
|
+
};
|
|
172
|
+
const result = schemas_js_1.WorkflowStartTestCaseDetectionInputSchema.parse(input);
|
|
173
|
+
(0, vitest_1.expect)(result.projectId).toBe(test_fixtures_js_1.TEST_PROJECT_ID);
|
|
174
|
+
(0, vitest_1.expect)(result.useCaseId).toBe(test_fixtures_js_1.TEST_USE_CASE_ID);
|
|
175
|
+
(0, vitest_1.expect)(result.name).toBe("Detect test cases for login");
|
|
176
|
+
});
|
|
177
|
+
(0, vitest_1.it)("should reject input with missing useCaseId", () => {
|
|
178
|
+
const input = {
|
|
179
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
180
|
+
name: "Detect",
|
|
181
|
+
description: "Find test cases",
|
|
182
|
+
url: "https://example.com",
|
|
183
|
+
};
|
|
184
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartTestCaseDetectionInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
185
|
+
});
|
|
186
|
+
(0, vitest_1.it)("should reject input with invalid URL", () => {
|
|
187
|
+
const input = {
|
|
188
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
189
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
190
|
+
name: "Detect",
|
|
191
|
+
description: "Find test cases",
|
|
192
|
+
url: "bad-url",
|
|
193
|
+
};
|
|
194
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartTestCaseDetectionInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
198
|
+
(0, vitest_1.it)("should produce correct POST call with body and timeout", () => {
|
|
199
|
+
const tool = findTool(TOOL_NAME);
|
|
200
|
+
const input = {
|
|
201
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
202
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
203
|
+
name: "Detect test cases",
|
|
204
|
+
description: "Detect",
|
|
205
|
+
url: "https://example.com",
|
|
206
|
+
};
|
|
207
|
+
const result = tool.mapToUpstream(input);
|
|
208
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
209
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-case/test-case-detection`);
|
|
210
|
+
(0, vitest_1.expect)(result.body).toEqual({
|
|
211
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
212
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
213
|
+
name: "Detect test cases",
|
|
214
|
+
description: "Detect",
|
|
215
|
+
url: "https://example.com",
|
|
216
|
+
});
|
|
217
|
+
(0, vitest_1.expect)(result.timeoutMs).toBeDefined();
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
// =============================================================================
|
|
222
|
+
// qa_workflow_list_test_case_detection_runtimes
|
|
223
|
+
// =============================================================================
|
|
224
|
+
(0, vitest_1.describe)("qa_workflow_list_test_case_detection_runtimes", () => {
|
|
225
|
+
const TOOL_NAME = "qa_workflow_list_test_case_detection_runtimes";
|
|
226
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
227
|
+
(0, vitest_1.it)("should produce correct GET call for test case detection runtimes", () => {
|
|
228
|
+
const tool = findTool(TOOL_NAME);
|
|
229
|
+
const input = { projectId: test_fixtures_js_1.TEST_PROJECT_ID };
|
|
230
|
+
const result = tool.mapToUpstream(input);
|
|
231
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
232
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-case/test-case-detection/workflowRuntimes`);
|
|
233
|
+
(0, vitest_1.expect)(result.queryParams).toEqual({
|
|
234
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
// =============================================================================
|
|
240
|
+
// qa_workflow_get_test_case_detection_latest_run
|
|
241
|
+
// =============================================================================
|
|
242
|
+
(0, vitest_1.describe)("qa_workflow_get_test_case_detection_latest_run", () => {
|
|
243
|
+
const TOOL_NAME = "qa_workflow_get_test_case_detection_latest_run";
|
|
244
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
245
|
+
(0, vitest_1.it)("should produce correct GET call for test case detection latest run", () => {
|
|
246
|
+
const tool = findTool(TOOL_NAME);
|
|
247
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
248
|
+
const result = tool.mapToUpstream(input);
|
|
249
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
250
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-case/test-case-detection/${test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID}/run/latest`);
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
// =============================================================================
|
|
255
|
+
// qa_workflow_start_test_script_generation
|
|
256
|
+
// =============================================================================
|
|
257
|
+
(0, vitest_1.describe)("qa_workflow_start_test_script_generation", () => {
|
|
258
|
+
const TOOL_NAME = "qa_workflow_start_test_script_generation";
|
|
259
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
260
|
+
(0, vitest_1.it)("should accept valid input with all required fields", () => {
|
|
261
|
+
const input = {
|
|
262
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
263
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
264
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
265
|
+
name: "Generate script for login test",
|
|
266
|
+
url: "https://example.com/login",
|
|
267
|
+
goal: "Verify user can log in",
|
|
268
|
+
precondition: "User exists in the system",
|
|
269
|
+
instructions: "1. Go to login page\n2. Enter credentials\n3. Click login",
|
|
270
|
+
expectedResult: "User sees the dashboard",
|
|
271
|
+
};
|
|
272
|
+
const result = schemas_js_1.WorkflowStartTestScriptGenerationInputSchema.parse(input);
|
|
273
|
+
(0, vitest_1.expect)(result.projectId).toBe(test_fixtures_js_1.TEST_PROJECT_ID);
|
|
274
|
+
(0, vitest_1.expect)(result.testCaseId).toBe(test_fixtures_js_1.TEST_CASE_ID);
|
|
275
|
+
(0, vitest_1.expect)(result.goal).toBe("Verify user can log in");
|
|
276
|
+
});
|
|
277
|
+
(0, vitest_1.it)("should reject input with missing goal", () => {
|
|
278
|
+
const input = {
|
|
279
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
280
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
281
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
282
|
+
name: "Generate script",
|
|
283
|
+
url: "https://example.com",
|
|
284
|
+
precondition: "Pre",
|
|
285
|
+
instructions: "Steps",
|
|
286
|
+
expectedResult: "Result",
|
|
287
|
+
};
|
|
288
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartTestScriptGenerationInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
289
|
+
});
|
|
290
|
+
(0, vitest_1.it)("should reject input with empty instructions", () => {
|
|
291
|
+
const input = {
|
|
292
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
293
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
294
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
295
|
+
name: "Generate",
|
|
296
|
+
url: "https://example.com",
|
|
297
|
+
goal: "Goal",
|
|
298
|
+
precondition: "Pre",
|
|
299
|
+
instructions: "",
|
|
300
|
+
expectedResult: "Result",
|
|
301
|
+
};
|
|
302
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartTestScriptGenerationInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
306
|
+
(0, vitest_1.it)("should produce correct POST call with all fields in body", () => {
|
|
307
|
+
const tool = findTool(TOOL_NAME);
|
|
308
|
+
const input = {
|
|
309
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
310
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
311
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
312
|
+
name: "Generate script",
|
|
313
|
+
url: "https://example.com",
|
|
314
|
+
goal: "Verify login",
|
|
315
|
+
precondition: "User exists",
|
|
316
|
+
instructions: "Enter credentials",
|
|
317
|
+
expectedResult: "Dashboard shows",
|
|
318
|
+
};
|
|
319
|
+
const result = tool.mapToUpstream(input);
|
|
320
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
321
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-generation`);
|
|
322
|
+
(0, vitest_1.expect)(result.body).toEqual({
|
|
323
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
324
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
325
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
326
|
+
name: "Generate script",
|
|
327
|
+
url: "https://example.com",
|
|
328
|
+
goal: "Verify login",
|
|
329
|
+
precondition: "User exists",
|
|
330
|
+
instructions: "Enter credentials",
|
|
331
|
+
expectedResult: "Dashboard shows",
|
|
332
|
+
});
|
|
333
|
+
(0, vitest_1.expect)(result.timeoutMs).toBeDefined();
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
// =============================================================================
|
|
338
|
+
// qa_workflow_get_test_script_generation_latest_run
|
|
339
|
+
// =============================================================================
|
|
340
|
+
(0, vitest_1.describe)("qa_workflow_get_test_script_generation_latest_run", () => {
|
|
341
|
+
const TOOL_NAME = "qa_workflow_get_test_script_generation_latest_run";
|
|
342
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
343
|
+
(0, vitest_1.it)("should produce correct GET call for script generation latest run", () => {
|
|
344
|
+
const tool = findTool(TOOL_NAME);
|
|
345
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
346
|
+
const result = tool.mapToUpstream(input);
|
|
347
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
348
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-generation/${test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID}/run/latest`);
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
// =============================================================================
|
|
353
|
+
// qa_workflow_get_latest_test_script_generation_runtime_by_test_case
|
|
354
|
+
// =============================================================================
|
|
355
|
+
(0, vitest_1.describe)("qa_workflow_get_latest_test_script_generation_runtime_by_test_case", () => {
|
|
356
|
+
const TOOL_NAME = "qa_workflow_get_latest_test_script_generation_runtime_by_test_case";
|
|
357
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
358
|
+
(0, vitest_1.it)("should accept valid input with testCaseId", () => {
|
|
359
|
+
const input = { testCaseId: test_fixtures_js_1.TEST_CASE_ID };
|
|
360
|
+
const result = schemas_js_1.WorkflowGetLatestScriptGenByTestCaseInputSchema.parse(input);
|
|
361
|
+
(0, vitest_1.expect)(result.testCaseId).toBe(test_fixtures_js_1.TEST_CASE_ID);
|
|
362
|
+
});
|
|
363
|
+
(0, vitest_1.it)("should reject input with empty testCaseId", () => {
|
|
364
|
+
const input = { testCaseId: "" };
|
|
365
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowGetLatestScriptGenByTestCaseInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
369
|
+
(0, vitest_1.it)("should produce correct GET call with testCaseId in path", () => {
|
|
370
|
+
const tool = findTool(TOOL_NAME);
|
|
371
|
+
const input = { testCaseId: test_fixtures_js_1.TEST_CASE_ID };
|
|
372
|
+
const result = tool.mapToUpstream(input);
|
|
373
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
374
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-generation/testcases/${test_fixtures_js_1.TEST_CASE_ID}/runtime/latest`);
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
// =============================================================================
|
|
379
|
+
// qa_workflow_start_test_script_replay
|
|
380
|
+
// =============================================================================
|
|
381
|
+
(0, vitest_1.describe)("qa_workflow_start_test_script_replay", () => {
|
|
382
|
+
const TOOL_NAME = "qa_workflow_start_test_script_replay";
|
|
383
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
384
|
+
(0, vitest_1.it)("should accept valid input with all required fields", () => {
|
|
385
|
+
const input = {
|
|
386
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
387
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
388
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
389
|
+
testScriptId: test_fixtures_js_1.TEST_SCRIPT_ID,
|
|
390
|
+
name: "Replay login test",
|
|
391
|
+
};
|
|
392
|
+
const result = schemas_js_1.WorkflowStartTestScriptReplayInputSchema.parse(input);
|
|
393
|
+
(0, vitest_1.expect)(result.projectId).toBe(test_fixtures_js_1.TEST_PROJECT_ID);
|
|
394
|
+
(0, vitest_1.expect)(result.testScriptId).toBe(test_fixtures_js_1.TEST_SCRIPT_ID);
|
|
395
|
+
});
|
|
396
|
+
(0, vitest_1.it)("should reject input with missing testScriptId", () => {
|
|
397
|
+
const input = {
|
|
398
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
399
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
400
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
401
|
+
name: "Replay",
|
|
402
|
+
};
|
|
403
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartTestScriptReplayInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
407
|
+
(0, vitest_1.it)("should produce correct POST call with all IDs in body", () => {
|
|
408
|
+
const tool = findTool(TOOL_NAME);
|
|
409
|
+
const input = {
|
|
410
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
411
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
412
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
413
|
+
testScriptId: test_fixtures_js_1.TEST_SCRIPT_ID,
|
|
414
|
+
name: "Replay login",
|
|
415
|
+
};
|
|
416
|
+
const result = tool.mapToUpstream(input);
|
|
417
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
418
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-replay`);
|
|
419
|
+
(0, vitest_1.expect)(result.body).toEqual({
|
|
420
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
421
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
422
|
+
testCaseId: test_fixtures_js_1.TEST_CASE_ID,
|
|
423
|
+
testScriptId: test_fixtures_js_1.TEST_SCRIPT_ID,
|
|
424
|
+
name: "Replay login",
|
|
425
|
+
});
|
|
426
|
+
(0, vitest_1.expect)(result.timeoutMs).toBeDefined();
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
// =============================================================================
|
|
431
|
+
// qa_workflow_get_test_script_replay_latest_run
|
|
432
|
+
// =============================================================================
|
|
433
|
+
(0, vitest_1.describe)("qa_workflow_get_test_script_replay_latest_run", () => {
|
|
434
|
+
const TOOL_NAME = "qa_workflow_get_test_script_replay_latest_run";
|
|
435
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
436
|
+
(0, vitest_1.it)("should produce correct GET call for replay latest run", () => {
|
|
437
|
+
const tool = findTool(TOOL_NAME);
|
|
438
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
439
|
+
const result = tool.mapToUpstream(input);
|
|
440
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
441
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-replay/${test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID}/run/latest`);
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
// =============================================================================
|
|
446
|
+
// qa_workflow_start_test_script_replay_bulk
|
|
447
|
+
// =============================================================================
|
|
448
|
+
(0, vitest_1.describe)("qa_workflow_start_test_script_replay_bulk", () => {
|
|
449
|
+
const TOOL_NAME = "qa_workflow_start_test_script_replay_bulk";
|
|
450
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
451
|
+
(0, vitest_1.it)("should accept valid input with required fields only", () => {
|
|
452
|
+
const input = {
|
|
453
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
454
|
+
name: "Bulk replay all",
|
|
455
|
+
intervalSec: -1,
|
|
456
|
+
};
|
|
457
|
+
const result = schemas_js_1.WorkflowStartTestScriptReplayBulkInputSchema.parse(input);
|
|
458
|
+
(0, vitest_1.expect)(result.projectId).toBe(test_fixtures_js_1.TEST_PROJECT_ID);
|
|
459
|
+
(0, vitest_1.expect)(result.intervalSec).toBe(-1);
|
|
460
|
+
});
|
|
461
|
+
(0, vitest_1.it)("should accept valid input with all optional fields", () => {
|
|
462
|
+
const input = {
|
|
463
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
464
|
+
name: "Bulk replay",
|
|
465
|
+
intervalSec: 300,
|
|
466
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
467
|
+
namePrefix: "nightly-",
|
|
468
|
+
limit: 10,
|
|
469
|
+
testCaseIds: [test_fixtures_js_1.TEST_CASE_ID, "tc_another"],
|
|
470
|
+
repeatPerTestCase: 3,
|
|
471
|
+
};
|
|
472
|
+
const result = schemas_js_1.WorkflowStartTestScriptReplayBulkInputSchema.parse(input);
|
|
473
|
+
(0, vitest_1.expect)(result.useCaseId).toBe(test_fixtures_js_1.TEST_USE_CASE_ID);
|
|
474
|
+
(0, vitest_1.expect)(result.limit).toBe(10);
|
|
475
|
+
(0, vitest_1.expect)(result.testCaseIds).toHaveLength(2);
|
|
476
|
+
(0, vitest_1.expect)(result.repeatPerTestCase).toBe(3);
|
|
477
|
+
});
|
|
478
|
+
(0, vitest_1.it)("should reject input with missing intervalSec", () => {
|
|
479
|
+
const input = {
|
|
480
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
481
|
+
name: "Bulk",
|
|
482
|
+
};
|
|
483
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowStartTestScriptReplayBulkInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
487
|
+
(0, vitest_1.it)("should produce correct POST call with all fields in body", () => {
|
|
488
|
+
const tool = findTool(TOOL_NAME);
|
|
489
|
+
const input = {
|
|
490
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
491
|
+
name: "Bulk replay",
|
|
492
|
+
intervalSec: -1,
|
|
493
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
494
|
+
namePrefix: "nightly-",
|
|
495
|
+
limit: 5,
|
|
496
|
+
testCaseIds: [test_fixtures_js_1.TEST_CASE_ID],
|
|
497
|
+
repeatPerTestCase: 2,
|
|
498
|
+
};
|
|
499
|
+
const result = tool.mapToUpstream(input);
|
|
500
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
501
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-replay/bulk/workflowRuntimes`);
|
|
502
|
+
(0, vitest_1.expect)(result.body).toEqual({
|
|
503
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
504
|
+
name: "Bulk replay",
|
|
505
|
+
intervalSec: -1,
|
|
506
|
+
useCaseId: test_fixtures_js_1.TEST_USE_CASE_ID,
|
|
507
|
+
namePrefix: "nightly-",
|
|
508
|
+
limit: 5,
|
|
509
|
+
testCaseIds: [test_fixtures_js_1.TEST_CASE_ID],
|
|
510
|
+
repeatPerTestCase: 2,
|
|
511
|
+
});
|
|
512
|
+
(0, vitest_1.expect)(result.timeoutMs).toBeDefined();
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
// =============================================================================
|
|
517
|
+
// qa_workflow_list_test_script_replay_bulk_runtimes
|
|
518
|
+
// =============================================================================
|
|
519
|
+
(0, vitest_1.describe)("qa_workflow_list_test_script_replay_bulk_runtimes", () => {
|
|
520
|
+
const TOOL_NAME = "qa_workflow_list_test_script_replay_bulk_runtimes";
|
|
521
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
522
|
+
(0, vitest_1.it)("should produce correct GET call for bulk replay runtimes", () => {
|
|
523
|
+
const tool = findTool(TOOL_NAME);
|
|
524
|
+
const input = { projectId: test_fixtures_js_1.TEST_PROJECT_ID };
|
|
525
|
+
const result = tool.mapToUpstream(input);
|
|
526
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
527
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-replay/bulk/workflowRuntimes`);
|
|
528
|
+
(0, vitest_1.expect)(result.queryParams).toEqual({
|
|
529
|
+
projectId: test_fixtures_js_1.TEST_PROJECT_ID,
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
});
|
|
534
|
+
// =============================================================================
|
|
535
|
+
// qa_workflow_get_test_script_replay_bulk_latest_run
|
|
536
|
+
// =============================================================================
|
|
537
|
+
(0, vitest_1.describe)("qa_workflow_get_test_script_replay_bulk_latest_run", () => {
|
|
538
|
+
const TOOL_NAME = "qa_workflow_get_test_script_replay_bulk_latest_run";
|
|
539
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
540
|
+
(0, vitest_1.it)("should produce correct GET call for bulk replay latest run", () => {
|
|
541
|
+
const tool = findTool(TOOL_NAME);
|
|
542
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
543
|
+
const result = tool.mapToUpstream(input);
|
|
544
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
545
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-replay/bulk/${test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID}/run/latest`);
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
});
|
|
549
|
+
// =============================================================================
|
|
550
|
+
// qa_workflow_get_replay_bulk_run_batch_summary
|
|
551
|
+
// =============================================================================
|
|
552
|
+
(0, vitest_1.describe)("qa_workflow_get_replay_bulk_run_batch_summary", () => {
|
|
553
|
+
const TOOL_NAME = "qa_workflow_get_replay_bulk_run_batch_summary";
|
|
554
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
555
|
+
(0, vitest_1.it)("should accept valid input with runBatchId", () => {
|
|
556
|
+
const input = { runBatchId: test_fixtures_js_1.TEST_RUN_BATCH_ID };
|
|
557
|
+
const result = schemas_js_1.WorkflowGetReplayBulkBatchSummaryInputSchema.parse(input);
|
|
558
|
+
(0, vitest_1.expect)(result.runBatchId).toBe(test_fixtures_js_1.TEST_RUN_BATCH_ID);
|
|
559
|
+
});
|
|
560
|
+
(0, vitest_1.it)("should reject input with empty runBatchId", () => {
|
|
561
|
+
const input = { runBatchId: "" };
|
|
562
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowGetReplayBulkBatchSummaryInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
566
|
+
(0, vitest_1.it)("should produce correct GET call with runBatchId in path", () => {
|
|
567
|
+
const tool = findTool(TOOL_NAME);
|
|
568
|
+
const input = { runBatchId: test_fixtures_js_1.TEST_RUN_BATCH_ID };
|
|
569
|
+
const result = tool.mapToUpstream(input);
|
|
570
|
+
(0, vitest_1.expect)(result.method).toBe("GET");
|
|
571
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/test-script/test-script-replay/bulk/run-batch/${test_fixtures_js_1.TEST_RUN_BATCH_ID}/summary`);
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
// =============================================================================
|
|
576
|
+
// qa_workflow_cancel_run
|
|
577
|
+
// =============================================================================
|
|
578
|
+
(0, vitest_1.describe)("qa_workflow_cancel_run", () => {
|
|
579
|
+
const TOOL_NAME = "qa_workflow_cancel_run";
|
|
580
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
581
|
+
(0, vitest_1.it)("should accept valid input with workflowRunId", () => {
|
|
582
|
+
const input = { workflowRunId: test_fixtures_js_1.TEST_WORKFLOW_RUN_ID };
|
|
583
|
+
const result = schemas_js_1.WorkflowCancelRunInputSchema.parse(input);
|
|
584
|
+
(0, vitest_1.expect)(result.workflowRunId).toBe(test_fixtures_js_1.TEST_WORKFLOW_RUN_ID);
|
|
585
|
+
});
|
|
586
|
+
(0, vitest_1.it)("should reject input with empty workflowRunId", () => {
|
|
587
|
+
const input = { workflowRunId: "" };
|
|
588
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowCancelRunInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
589
|
+
});
|
|
590
|
+
});
|
|
591
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
592
|
+
(0, vitest_1.it)("should produce correct POST call to cancel run", () => {
|
|
593
|
+
const tool = findTool(TOOL_NAME);
|
|
594
|
+
const input = { workflowRunId: test_fixtures_js_1.TEST_WORKFLOW_RUN_ID };
|
|
595
|
+
const result = tool.mapToUpstream(input);
|
|
596
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
597
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/runs/${test_fixtures_js_1.TEST_WORKFLOW_RUN_ID}/cancel`);
|
|
598
|
+
});
|
|
599
|
+
});
|
|
600
|
+
});
|
|
601
|
+
// =============================================================================
|
|
602
|
+
// qa_workflow_cancel_runtime
|
|
603
|
+
// =============================================================================
|
|
604
|
+
(0, vitest_1.describe)("qa_workflow_cancel_runtime", () => {
|
|
605
|
+
const TOOL_NAME = "qa_workflow_cancel_runtime";
|
|
606
|
+
(0, vitest_1.describe)("schema validation", () => {
|
|
607
|
+
(0, vitest_1.it)("should accept valid input with workflowRuntimeId", () => {
|
|
608
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
609
|
+
const result = schemas_js_1.WorkflowCancelRuntimeInputSchema.parse(input);
|
|
610
|
+
(0, vitest_1.expect)(result.workflowRuntimeId).toBe(test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID);
|
|
611
|
+
});
|
|
612
|
+
(0, vitest_1.it)("should reject input with empty workflowRuntimeId", () => {
|
|
613
|
+
const input = { workflowRuntimeId: "" };
|
|
614
|
+
(0, vitest_1.expect)(() => schemas_js_1.WorkflowCancelRuntimeInputSchema.parse(input)).toThrow(zod_1.ZodError);
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
(0, vitest_1.describe)("mapToUpstream", () => {
|
|
618
|
+
(0, vitest_1.it)("should produce correct POST call to cancel runtime", () => {
|
|
619
|
+
const tool = findTool(TOOL_NAME);
|
|
620
|
+
const input = { workflowRuntimeId: test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID };
|
|
621
|
+
const result = tool.mapToUpstream(input);
|
|
622
|
+
(0, vitest_1.expect)(result.method).toBe("POST");
|
|
623
|
+
(0, vitest_1.expect)(result.path).toBe(`${test_fixtures_js_1.TEST_UPSTREAM_PREFIX}/workflow/runtimes/${test_fixtures_js_1.TEST_WORKFLOW_RUNTIME_ID}/cancel`);
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
});
|
|
627
|
+
//# sourceMappingURL=workflow-tools.test.js.map
|