@camunda/e2e-test-suite 0.0.1329 → 0.0.1330
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/.github/c8_versions.json +1 -0
- package/README.md +1 -0
- package/dist/fixtures/8.11.d.ts +83 -0
- package/dist/fixtures/8.11.js +203 -0
- package/dist/pages/8.11/AppsPage.d.ts +60 -0
- package/dist/pages/8.11/AppsPage.js +1060 -0
- package/dist/pages/8.11/AuditLogPage.d.ts +14 -0
- package/dist/pages/8.11/AuditLogPage.js +69 -0
- package/dist/pages/8.11/Authorization.d.ts +44 -0
- package/dist/pages/8.11/Authorization.js +409 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.d.ts +12 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.js +36 -0
- package/dist/pages/8.11/ClusterDetailsPage.d.ts +107 -0
- package/dist/pages/8.11/ClusterDetailsPage.js +892 -0
- package/dist/pages/8.11/ClusterPage.d.ts +96 -0
- package/dist/pages/8.11/ClusterPage.js +657 -0
- package/dist/pages/8.11/ClusterSecretsPage.d.ts +48 -0
- package/dist/pages/8.11/ClusterSecretsPage.js +406 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.d.ts +29 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.js +156 -0
- package/dist/pages/8.11/ConnectorSettingsPage.d.ts +39 -0
- package/dist/pages/8.11/ConnectorSettingsPage.js +150 -0
- package/dist/pages/8.11/ConnectorTemplatePage.d.ts +11 -0
- package/dist/pages/8.11/ConnectorTemplatePage.js +34 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.d.ts +77 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.js +457 -0
- package/dist/pages/8.11/DataFiltersPage.d.ts +30 -0
- package/dist/pages/8.11/DataFiltersPage.js +135 -0
- package/dist/pages/8.11/FormJsPage.d.ts +38 -0
- package/dist/pages/8.11/FormJsPage.js +283 -0
- package/dist/pages/8.11/HomePage.d.ts +29 -0
- package/dist/pages/8.11/HomePage.js +176 -0
- package/dist/pages/8.11/IdpCreatePage.d.ts +118 -0
- package/dist/pages/8.11/IdpCreatePage.js +514 -0
- package/dist/pages/8.11/LoginPage.d.ts +45 -0
- package/dist/pages/8.11/LoginPage.js +214 -0
- package/dist/pages/8.11/ModelerCreatePage.d.ts +256 -0
- package/dist/pages/8.11/ModelerCreatePage.js +2272 -0
- package/dist/pages/8.11/ModelerHomePage.d.ts +100 -0
- package/dist/pages/8.11/ModelerHomePage.js +1168 -0
- package/dist/pages/8.11/ModelerUserInvitePage.d.ts +29 -0
- package/dist/pages/8.11/ModelerUserInvitePage.js +136 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.d.ts +11 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.js +25 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.js +128 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.d.ts +38 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.js +176 -0
- package/dist/pages/8.11/OCIdentityHomePage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityHomePage.js +111 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.d.ts +23 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.js +124 -0
- package/dist/pages/8.11/OCIdentityRolesPage.d.ts +43 -0
- package/dist/pages/8.11/OCIdentityRolesPage.js +236 -0
- package/dist/pages/8.11/OperateHomePage.d.ts +28 -0
- package/dist/pages/8.11/OperateHomePage.js +150 -0
- package/dist/pages/8.11/OperateProcessInstancePage.d.ts +43 -0
- package/dist/pages/8.11/OperateProcessInstancePage.js +893 -0
- package/dist/pages/8.11/OperateProcessesPage.d.ts +28 -0
- package/dist/pages/8.11/OperateProcessesPage.js +153 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.d.ts +30 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.js +175 -0
- package/dist/pages/8.11/OptimizeDashboardPage.d.ts +11 -0
- package/dist/pages/8.11/OptimizeDashboardPage.js +71 -0
- package/dist/pages/8.11/OptimizeHomePage.d.ts +17 -0
- package/dist/pages/8.11/OptimizeHomePage.js +171 -0
- package/dist/pages/8.11/OptimizeReportPage.d.ts +49 -0
- package/dist/pages/8.11/OptimizeReportPage.js +184 -0
- package/dist/pages/8.11/OptimizeSharePage.d.ts +16 -0
- package/dist/pages/8.11/OptimizeSharePage.js +100 -0
- package/dist/pages/8.11/PlayPage.d.ts +17 -0
- package/dist/pages/8.11/PlayPage.js +157 -0
- package/dist/pages/8.11/ProcessApplicationPage.d.ts +32 -0
- package/dist/pages/8.11/ProcessApplicationPage.js +496 -0
- package/dist/pages/8.11/SettingsPage.d.ts +10 -0
- package/dist/pages/8.11/SettingsPage.js +53 -0
- package/dist/pages/8.11/SignUpPage.d.ts +42 -0
- package/dist/pages/8.11/SignUpPage.js +134 -0
- package/dist/pages/8.11/TaskDetailsPage.d.ts +77 -0
- package/dist/pages/8.11/TaskDetailsPage.js +324 -0
- package/dist/pages/8.11/TaskPanelPage.d.ts +26 -0
- package/dist/pages/8.11/TaskPanelPage.js +245 -0
- package/dist/pages/8.11/TaskProcessesPage.d.ts +18 -0
- package/dist/pages/8.11/TaskProcessesPage.js +134 -0
- package/dist/pages/8.11/UtilitiesPage.d.ts +56 -0
- package/dist/pages/8.11/UtilitiesPage.js +1024 -0
- package/dist/pages/8.11/WorkspaceMembersPage.d.ts +21 -0
- package/dist/pages/8.11/WorkspaceMembersPage.js +268 -0
- package/dist/tests/8.11/access-user-role-management.spec.d.ts +1 -0
- package/dist/tests/8.11/access-user-role-management.spec.js +487 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.js +209 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.js +188 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.js +167 -0
- package/dist/tests/8.11/cluster-variables.spec.d.ts +1 -0
- package/dist/tests/8.11/cluster-variables.spec.js +202 -0
- package/dist/tests/8.11/connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/connectors-user-flows.spec.js +537 -0
- package/dist/tests/8.11/console-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/console-user-flows.spec.js +199 -0
- package/dist/tests/8.11/hto-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/hto-user-flows.spec.js +358 -0
- package/dist/tests/8.11/idp-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/idp-user-flows.spec.js +316 -0
- package/dist/tests/8.11/login-negative-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/login-negative-tests.spec.js +29 -0
- package/dist/tests/8.11/login.spec.d.ts +1 -0
- package/dist/tests/8.11/login.spec.js +29 -0
- package/dist/tests/8.11/navigation.spec.d.ts +1 -0
- package/dist/tests/8.11/navigation.spec.js +59 -0
- package/dist/tests/8.11/operate-access-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/operate-access-flow.spec.js +136 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.js +96 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.js +69 -0
- package/dist/tests/8.11/optimize-api-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-api-tests.spec.js +1194 -0
- package/dist/tests/8.11/optimize-collections-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-api.spec.js +184 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.js +46 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.js +195 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.js +306 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.js +316 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.js +337 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.js +198 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.js +146 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.js +208 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.js +242 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.js +75 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.js +123 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.js +123 -0
- package/dist/tests/8.11/play.spec.d.ts +1 -0
- package/dist/tests/8.11/play.spec.js +93 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.js +495 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.js +133 -0
- package/dist/tests/8.11/smoke-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/smoke-tests.spec.js +339 -0
- package/dist/tests/8.11/test-setup.spec.d.ts +1 -0
- package/dist/tests/8.11/test-setup.spec.js +256 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.js +523 -0
- package/dist/utils/clusterVersions.d.ts +2 -1
- package/dist/utils/clusterVersions.js +1 -0
- package/dist/utils/consoleApiHelpers.js +1 -0
- package/package.json +1 -1
- package/playwright.config.ts +10 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
|
|
4
|
+
* one or more contributor license agreements. See the NOTICE file distributed
|
|
5
|
+
* with this work for additional information regarding copyright ownership.
|
|
6
|
+
* Licensed under the Camunda License 1.0. You may not use this file
|
|
7
|
+
* except in compliance with the Camunda License 1.0.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
/*
|
|
11
|
+
* Tests for POST /mcp/processes — tools/list endpoint.
|
|
12
|
+
*
|
|
13
|
+
* Direct JSON-RPC 2.0 calls to the /mcp/processes MCP server. No browser
|
|
14
|
+
* interaction; authentication and BPMN deployment use the same helpers as
|
|
15
|
+
* other tests in this folder.
|
|
16
|
+
*/
|
|
17
|
+
const _8_11_1 = require("../../../../fixtures/8.11");
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const apiHelpers_1 = require("../../../../utils/apiHelpers");
|
|
20
|
+
const constants_1 = require("../../../../utils/constants");
|
|
21
|
+
const mcpHelpers_1 = require("../../../../utils/mcpHelpers");
|
|
22
|
+
let authToken;
|
|
23
|
+
let mcpProcessesUrl;
|
|
24
|
+
let messageSubscriptionsSearchUrl;
|
|
25
|
+
let mcpSessionId = null;
|
|
26
|
+
_8_11_1.test.describe
|
|
27
|
+
.parallel('Orchestration Cluster MCP Server — /mcp/processes tools/list', () => {
|
|
28
|
+
_8_11_1.test.beforeAll(async () => {
|
|
29
|
+
authToken = await (0, apiHelpers_1.authSaasAPI)(undefined, 'agentic_cluster');
|
|
30
|
+
mcpProcessesUrl = (0, apiHelpers_1.buildZeebeApiUrl)('/mcp/processes', 'saas', 'agentic_cluster');
|
|
31
|
+
messageSubscriptionsSearchUrl = (0, apiHelpers_1.buildZeebeApiUrl)('/v2/message-subscriptions/search', 'saas', 'agentic_cluster');
|
|
32
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
33
|
+
mcpSessionId = await (0, mcpHelpers_1.initializeMcpSession)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
34
|
+
// Deploy independent processes concurrently to reduce beforeAll runtime.
|
|
35
|
+
// Process definitions are never deleted (the C8 REST API does not expose a
|
|
36
|
+
// deletion endpoint), so each run on the shared agentic cluster accumulates
|
|
37
|
+
// versions. Tests use regex matchers and subscription-key lookups rather
|
|
38
|
+
// than fixed names to stay robust across accumulated versions.
|
|
39
|
+
const [toolProcessKey, withInputsKey, plainKey] = await Promise.all([
|
|
40
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_process.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
41
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_with_inputs.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
42
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_plain_process.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
43
|
+
]);
|
|
44
|
+
if (toolProcessKey == null)
|
|
45
|
+
throw new Error('Failed to deploy mcp_as_tool_process.bpmn');
|
|
46
|
+
if (withInputsKey == null)
|
|
47
|
+
throw new Error('Failed to deploy mcp_as_tool_with_inputs.bpmn');
|
|
48
|
+
if (plainKey == null)
|
|
49
|
+
throw new Error('Failed to deploy mcp_plain_process.bpmn');
|
|
50
|
+
// Deploy v1 then v2 sequentially — order matters so version 2 is the latest.
|
|
51
|
+
// Camunda deduplicates identical BPMN content, so v1 and v2 differ only in
|
|
52
|
+
// their purpose property to force a genuine new version.
|
|
53
|
+
const v1Key = await (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_v1.bpmn', authToken, 'saas', 'agentic_cluster');
|
|
54
|
+
if (v1Key == null)
|
|
55
|
+
throw new Error('Failed to deploy mcp_as_tool_v1.bpmn');
|
|
56
|
+
const v2Key = await (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_v2.bpmn', authToken, 'saas', 'agentic_cluster');
|
|
57
|
+
if (v2Key == null)
|
|
58
|
+
throw new Error('Failed to deploy mcp_as_tool_v2.bpmn');
|
|
59
|
+
});
|
|
60
|
+
(0, _8_11_1.test)('SC-MCP-02 — Static observability tools always present in tools/list', async () => {
|
|
61
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
62
|
+
await (0, test_1.expect)(async () => {
|
|
63
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
64
|
+
const names = tools.map((t) => t.name);
|
|
65
|
+
(0, test_1.expect)(names).toContain('getProcessInstance');
|
|
66
|
+
(0, test_1.expect)(names).toContain('searchVariables');
|
|
67
|
+
(0, test_1.expect)(names).toContain('searchIncidents');
|
|
68
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
69
|
+
});
|
|
70
|
+
(0, _8_11_1.test)('SC-MCP-03 — Deployed MCP process appears as a dynamic tool', async () => {
|
|
71
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
72
|
+
await (0, test_1.expect)(async () => {
|
|
73
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
74
|
+
const hasToolProcess = tools.some((t) => /^mcp-as-tool-process_\d+$/.test(t.name));
|
|
75
|
+
(0, test_1.expect)(hasToolProcess).toBe(true);
|
|
76
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
77
|
+
});
|
|
78
|
+
(0, _8_11_1.test)('SC-MCP-04 — Tool name encodes the messageSubscriptionKey from the search API', async () => {
|
|
79
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
80
|
+
// Resolve the subscription key from the REST API first.
|
|
81
|
+
// Sort by processDefinitionVersion DESC so we always get the latest deployed
|
|
82
|
+
// version's subscription key, not a stale one from a previous CI run.
|
|
83
|
+
let subscriptionKey = null;
|
|
84
|
+
await _8_11_1.test.step('Resolve messageSubscriptionKey via REST API', async () => {
|
|
85
|
+
await (0, test_1.expect)(async () => {
|
|
86
|
+
const res = await apiContext.post(messageSubscriptionsSearchUrl, {
|
|
87
|
+
headers: (0, mcpHelpers_1.buildMcpHeaders)(authToken, mcpSessionId),
|
|
88
|
+
data: {
|
|
89
|
+
filter: {
|
|
90
|
+
processDefinitionId: 'mcpAsToolProcess',
|
|
91
|
+
messageSubscriptionType: 'START_EVENT',
|
|
92
|
+
},
|
|
93
|
+
sort: [{ field: 'processDefinitionVersion', order: 'desc' }],
|
|
94
|
+
page: { limit: 1 },
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
await (0, mcpHelpers_1.assertResponseStatus)(res, 200);
|
|
98
|
+
const json = await res.json();
|
|
99
|
+
(0, test_1.expect)(json.items.length).toBeGreaterThanOrEqual(1);
|
|
100
|
+
subscriptionKey = String(json.items[0].messageSubscriptionKey);
|
|
101
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
102
|
+
});
|
|
103
|
+
await _8_11_1.test.step('Verify tool name in tools/list matches subscriptionKey', async () => {
|
|
104
|
+
const expectedName = `mcp-as-tool-process_${subscriptionKey}`;
|
|
105
|
+
await (0, test_1.expect)(async () => {
|
|
106
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
107
|
+
const names = tools.map((t) => t.name);
|
|
108
|
+
(0, test_1.expect)(names).toContain(expectedName);
|
|
109
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
(0, _8_11_1.test)('SC-MCP-05 — Process with io.camunda.tool:inputs appears as a tool with an object inputSchema', async () => {
|
|
113
|
+
// The server exposes processes as tools regardless of their io.camunda.tool:inputs
|
|
114
|
+
// content. inputSchema is always an empty object schema in this server version
|
|
115
|
+
// (typed JSON Schema generation from extension properties is not yet implemented).
|
|
116
|
+
// extensionProperties are not populated on the entity returned by the internal
|
|
117
|
+
// search service, so description is always empty — not asserted here.
|
|
118
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
119
|
+
await (0, test_1.expect)(async () => {
|
|
120
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
121
|
+
const withInputsTool = tools.find((t) => /^mcp-as-tool-with-inputs_\d+$/.test(t.name));
|
|
122
|
+
(0, test_1.expect)(withInputsTool).toBeDefined();
|
|
123
|
+
const schema = withInputsTool.inputSchema;
|
|
124
|
+
(0, test_1.expect)(schema).toBeDefined();
|
|
125
|
+
(0, test_1.expect)(schema.type).toBe('object');
|
|
126
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
127
|
+
});
|
|
128
|
+
(0, _8_11_1.test)('SC-MCP-06 — Multiple deployed MCP processes each appear as a separate tool', async () => {
|
|
129
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
130
|
+
await (0, test_1.expect)(async () => {
|
|
131
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
132
|
+
const hasToolProcess = tools.some((t) => /^mcp-as-tool-process_\d+$/.test(t.name));
|
|
133
|
+
const hasWithInputs = tools.some((t) => /^mcp-as-tool-with-inputs_\d+$/.test(t.name));
|
|
134
|
+
(0, test_1.expect)(hasToolProcess).toBe(true);
|
|
135
|
+
(0, test_1.expect)(hasWithInputs).toBe(true);
|
|
136
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
137
|
+
});
|
|
138
|
+
(0, _8_11_1.test)('SC-MCP-07 — Message start event without io.camunda.tool:name does not appear as a tool', async () => {
|
|
139
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
140
|
+
// mcp_plain_process.bpmn has a message start event but no io.camunda.tool:* properties.
|
|
141
|
+
// It must not produce a dynamic tool entry in tools/list.
|
|
142
|
+
// Both conditions are checked on the same snapshot inside the retry loop so
|
|
143
|
+
// that eventual consistency cannot produce a false-positive on the negative case.
|
|
144
|
+
await (0, test_1.expect)(async () => {
|
|
145
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
146
|
+
// Positive anchor: wait until the cluster is settled (mcp-as-tool-process present).
|
|
147
|
+
(0, test_1.expect)(tools.some((t) => /^mcp-as-tool-process_\d+$/.test(t.name))).toBe(true);
|
|
148
|
+
// Negative assertion on the same snapshot.
|
|
149
|
+
(0, test_1.expect)(tools.some((t) => /mcp-plain-process/.test(t.name))).toBe(false);
|
|
150
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
151
|
+
});
|
|
152
|
+
(0, _8_11_1.test)('SC-MCP-08 — Tool disappears from tools/list after redeploying without MCP annotation', async () => {
|
|
153
|
+
// Process definition deletion is not available in the C8 REST API.
|
|
154
|
+
// Redeploying the same process with the io.camunda.tool:name property removed
|
|
155
|
+
// creates a new version whose message subscription has no toolName. Camunda
|
|
156
|
+
// marks the old subscription as DELETED, which removes it from tools/list.
|
|
157
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
158
|
+
await _8_11_1.test.step('Deploy temp MCP tool process', async () => {
|
|
159
|
+
const tempKey = await (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_temp.bpmn', authToken, 'saas', 'agentic_cluster');
|
|
160
|
+
if (tempKey == null) {
|
|
161
|
+
throw new Error('Failed to deploy temp tool process');
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
await _8_11_1.test.step('Wait for temp tool to appear in tools/list', async () => {
|
|
165
|
+
await (0, test_1.expect)(async () => {
|
|
166
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
167
|
+
const hasTemp = tools.some((t) => /^mcp-temp-tool_\d+$/.test(t.name));
|
|
168
|
+
(0, test_1.expect)(hasTemp).toBe(true);
|
|
169
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
170
|
+
});
|
|
171
|
+
await _8_11_1.test.step('Redeploy without io.camunda.tool:name annotation', async () => {
|
|
172
|
+
// Old subscription transitions to DELETED, new subscription has no toolName
|
|
173
|
+
// and is excluded from tools/list by the server's filter.
|
|
174
|
+
const disabledKey = await (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_temp_disabled.bpmn', authToken, 'saas', 'agentic_cluster');
|
|
175
|
+
if (disabledKey == null) {
|
|
176
|
+
throw new Error('Failed to deploy temp tool disabled process');
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
await _8_11_1.test.step('Wait for temp tool to disappear from tools/list', async () => {
|
|
180
|
+
await (0, test_1.expect)(async () => {
|
|
181
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
182
|
+
const hasTemp = tools.some((t) => /^mcp-temp-tool_\d+$/.test(t.name));
|
|
183
|
+
(0, test_1.expect)(hasTemp).toBe(false);
|
|
184
|
+
}).toPass(constants_1.deletionAssertionOptions);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
(0, _8_11_1.test)('SC-MCP-09 — Latest version of a versioned process appears as a tool', async () => {
|
|
188
|
+
// The server exposes ALL active message subscriptions that carry the
|
|
189
|
+
// io.camunda.tool:name property, regardless of process definition version.
|
|
190
|
+
// A subscription transitions to DELETED only when the process is redeployed
|
|
191
|
+
// WITHOUT the MCP annotation (tested in SC-MCP-08); redeploying WITH the same
|
|
192
|
+
// annotation keeps both the old and new subscriptions ACTIVE.
|
|
193
|
+
//
|
|
194
|
+
// On a shared cluster, previous CI runs accumulate versions — each deployment
|
|
195
|
+
// adds a new subscription that stays active indefinitely (no deletion API).
|
|
196
|
+
// Therefore we only assert the POSITIVE case: the latest version's subscription
|
|
197
|
+
// key IS present in tools/list. We do not assert that older keys are absent,
|
|
198
|
+
// because the server correctly surfaces all active annotated subscriptions.
|
|
199
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
200
|
+
// Fetch the latest subscription for mcpVersionedTool (version DESC, limit 1).
|
|
201
|
+
let latestSubscriptionKey = null;
|
|
202
|
+
await _8_11_1.test.step('Fetch latest subscription key for mcpVersionedTool', async () => {
|
|
203
|
+
await (0, test_1.expect)(async () => {
|
|
204
|
+
const res = await apiContext.post(messageSubscriptionsSearchUrl, {
|
|
205
|
+
headers: (0, mcpHelpers_1.buildMcpHeaders)(authToken, mcpSessionId),
|
|
206
|
+
data: {
|
|
207
|
+
filter: {
|
|
208
|
+
processDefinitionId: 'mcpVersionedTool',
|
|
209
|
+
messageSubscriptionType: 'START_EVENT',
|
|
210
|
+
},
|
|
211
|
+
sort: [{ field: 'processDefinitionVersion', order: 'desc' }],
|
|
212
|
+
page: { limit: 1 },
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
await (0, mcpHelpers_1.assertResponseStatus)(res, 200);
|
|
216
|
+
const json = await res.json();
|
|
217
|
+
(0, test_1.expect)(json.items.length).toBeGreaterThanOrEqual(1);
|
|
218
|
+
latestSubscriptionKey = String(json.items[0].messageSubscriptionKey);
|
|
219
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
220
|
+
});
|
|
221
|
+
await _8_11_1.test.step('Verify latest subscription key appears as a tool in tools/list', async () => {
|
|
222
|
+
// The latest version's subscription key must appear as a tool in tools/list.
|
|
223
|
+
await (0, test_1.expect)(async () => {
|
|
224
|
+
const tools = await (0, mcpHelpers_1.listTools)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
225
|
+
const toolNames = tools.map((t) => t.name);
|
|
226
|
+
const expectedTool = `mcp-versioned-tool_${latestSubscriptionKey}`;
|
|
227
|
+
(0, test_1.expect)(toolNames).toContain(expectedTool);
|
|
228
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
(0, _8_11_1.test)('SC-MCP-10 — Unauthenticated request to /mcp/processes is rejected', async () => {
|
|
232
|
+
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
233
|
+
const res = await apiContext.post(mcpProcessesUrl, {
|
|
234
|
+
headers: {
|
|
235
|
+
'Content-Type': 'application/json',
|
|
236
|
+
Accept: 'application/json, text/event-stream',
|
|
237
|
+
},
|
|
238
|
+
data: { jsonrpc: '2.0', id: 1, method: 'tools/list', params: {} },
|
|
239
|
+
});
|
|
240
|
+
await (0, mcpHelpers_1.assertResponseStatus)(res, [401, 403]);
|
|
241
|
+
});
|
|
242
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _8_11_1 = require("../../../fixtures/8.11");
|
|
4
|
+
const UtilitiesPage_1 = require("../../../pages/8.11/UtilitiesPage");
|
|
5
|
+
const _setup_1 = require("../../../test-setup.js");
|
|
6
|
+
const apiHelpers_1 = require("../../../utils/apiHelpers");
|
|
7
|
+
const users_1 = require("../../../utils/users");
|
|
8
|
+
const test_1 = require("@playwright/test");
|
|
9
|
+
const testUser = (0, users_1.getTestUser)('fourteenthUser');
|
|
10
|
+
let authToken;
|
|
11
|
+
let instanceKey;
|
|
12
|
+
_8_11_1.test.describe.configure({ mode: 'parallel' });
|
|
13
|
+
_8_11_1.test.describe('Orchestration Cluster MCP Server - Cluster Tools @tasklistV2', () => {
|
|
14
|
+
const clusterName = 'Agentic Orchestration Cluster';
|
|
15
|
+
_8_11_1.test.beforeAll(async () => {
|
|
16
|
+
authToken = await (0, apiHelpers_1.authSaasAPI)(undefined, 'agentic_cluster');
|
|
17
|
+
const processDefinitionKey = await (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_cluster_tools.bpmn', authToken, 'saas', 'agentic_cluster');
|
|
18
|
+
if (processDefinitionKey == null) {
|
|
19
|
+
throw new Error('Failed to deploy cluster tools process');
|
|
20
|
+
}
|
|
21
|
+
instanceKey = await (0, apiHelpers_1.createProcessInstance)(String(processDefinitionKey), authToken, 'saas', 'agentic_cluster');
|
|
22
|
+
});
|
|
23
|
+
_8_11_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
24
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
25
|
+
});
|
|
26
|
+
_8_11_1.test.afterEach(async ({ page }, testInfo) => {
|
|
27
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
28
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
29
|
+
});
|
|
30
|
+
const clusterToolTests = [
|
|
31
|
+
{
|
|
32
|
+
name: 'getClusterStatus - returns cluster health status',
|
|
33
|
+
variable: 'mcpResultClusterStatus',
|
|
34
|
+
assertions: [
|
|
35
|
+
{
|
|
36
|
+
text: 'HEALTHY',
|
|
37
|
+
description: 'cluster status response contains healthy field',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'getTopology - returns cluster topology information',
|
|
43
|
+
variable: 'mcpResultTopology',
|
|
44
|
+
assertions: [
|
|
45
|
+
{ text: 'brokers', description: 'topology response contains brokers' },
|
|
46
|
+
{
|
|
47
|
+
text: 'partitionsCount',
|
|
48
|
+
description: 'topology response contains partitions count',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
for (const testCase of clusterToolTests) {
|
|
54
|
+
(0, _8_11_1.test)(testCase.name, async ({ homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
|
|
55
|
+
_8_11_1.test.slow();
|
|
56
|
+
await _8_11_1.test.step('Navigate to completed process in Operate', async () => {
|
|
57
|
+
await homePage.clickClusters();
|
|
58
|
+
await appsPage.clickOperate(clusterName);
|
|
59
|
+
await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible({
|
|
60
|
+
timeout: 60000,
|
|
61
|
+
});
|
|
62
|
+
await operateHomePage.clickProcessesTab();
|
|
63
|
+
await operateProcessesPage.clickProcessCompletedCheckbox();
|
|
64
|
+
await operateProcessesPage.applyMoreFilters('Process Instance Key(s)', String(instanceKey));
|
|
65
|
+
await operateProcessesPage.clickProcessInstanceLink('MCP Cluster tools');
|
|
66
|
+
await operateProcessInstancePage.assertProcessCompleteStatusWithRetry();
|
|
67
|
+
});
|
|
68
|
+
for (const assertion of testCase.assertions) {
|
|
69
|
+
await _8_11_1.test.step(`Verify ${assertion.description}`, async () => {
|
|
70
|
+
await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, assertion.text);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _8_11_1 = require("../../../fixtures/8.11");
|
|
4
|
+
const UtilitiesPage_1 = require("../../../pages/8.11/UtilitiesPage");
|
|
5
|
+
const _setup_1 = require("../../../test-setup.js");
|
|
6
|
+
const apiHelpers_1 = require("../../../utils/apiHelpers");
|
|
7
|
+
const incidentHelpers_1 = require("../../../utils/incidentHelpers");
|
|
8
|
+
const users_1 = require("../../../utils/users");
|
|
9
|
+
const test_1 = require("@playwright/test");
|
|
10
|
+
const testUser = (0, users_1.getTestUser)('fifteenthUser');
|
|
11
|
+
let authToken;
|
|
12
|
+
let toolsInstanceKey;
|
|
13
|
+
_8_11_1.test.describe.configure({ mode: 'parallel' });
|
|
14
|
+
_8_11_1.test.describe('Orchestration Cluster MCP Server - Incident Tools @tasklistV2', () => {
|
|
15
|
+
const clusterName = 'Agentic Orchestration Cluster';
|
|
16
|
+
_8_11_1.test.beforeAll(async () => {
|
|
17
|
+
authToken = await (0, apiHelpers_1.authSaasAPI)(undefined, 'agentic_cluster');
|
|
18
|
+
const [testFileProcessKey, toolsProcessKey] = await Promise.all([
|
|
19
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_incident_test_file.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
20
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_incident_tools.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
21
|
+
]);
|
|
22
|
+
if (testFileProcessKey == null || toolsProcessKey == null) {
|
|
23
|
+
throw new Error('Failed to deploy incident tools processes');
|
|
24
|
+
}
|
|
25
|
+
// Create test instance — the call activity in the BPMN references a
|
|
26
|
+
// non-existent process, so Zeebe raises a CALLED_ELEMENT_ERROR incident
|
|
27
|
+
// immediately without needing a worker.
|
|
28
|
+
const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(testFileProcessKey), authToken, 'saas', 'agentic_cluster');
|
|
29
|
+
// Get the incident key created by the test instance (with retry logic)
|
|
30
|
+
const testIncidentKey = await (0, incidentHelpers_1.getIncidentKeyByProcessInstanceKey)(testInstanceKey, authToken, 'saas', 'agentic_cluster');
|
|
31
|
+
console.log('Creating tools instance with variables:', {
|
|
32
|
+
testFileProcessKey,
|
|
33
|
+
testIncidentKey,
|
|
34
|
+
});
|
|
35
|
+
// Create tools instance with required variables
|
|
36
|
+
toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testIncidentKey });
|
|
37
|
+
});
|
|
38
|
+
_8_11_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
39
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
40
|
+
});
|
|
41
|
+
_8_11_1.test.afterEach(async ({ page }, testInfo) => {
|
|
42
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
43
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
44
|
+
});
|
|
45
|
+
const incidentToolTests = [
|
|
46
|
+
{
|
|
47
|
+
name: 'searchIncidents - search incidents with filters such as processDefinitionKey',
|
|
48
|
+
variable: 'mcpResultSearchIncidents',
|
|
49
|
+
assertions: [
|
|
50
|
+
{
|
|
51
|
+
text: 'totalItems',
|
|
52
|
+
description: 'search response contains totalItems field',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
text: 'incidentKey',
|
|
56
|
+
description: 'search response contains incidentKey field',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
text: 'processDefinitionKey',
|
|
60
|
+
description: 'search response contains processDefinitionKey field',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
text: 'state',
|
|
64
|
+
description: 'search response contains state field',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'getIncident - retrieve an incident by key',
|
|
70
|
+
variable: 'mcpResultGetIncident',
|
|
71
|
+
assertions: [
|
|
72
|
+
{
|
|
73
|
+
text: 'incidentKey',
|
|
74
|
+
description: 'response contains incidentKey field',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
text: 'processInstanceKey',
|
|
78
|
+
description: 'response contains processInstanceKey field',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
text: 'errorType',
|
|
82
|
+
description: 'response contains errorType field',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
text: 'state',
|
|
86
|
+
description: 'response contains state field',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'resolveIncident - resolve an incident by key',
|
|
92
|
+
variable: 'mcpResultResolveIncident',
|
|
93
|
+
assertions: [
|
|
94
|
+
{
|
|
95
|
+
text: 'resolved',
|
|
96
|
+
description: 'response confirms incident was resolved',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
for (const testCase of incidentToolTests) {
|
|
102
|
+
(0, _8_11_1.test)(testCase.name, async ({ homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
|
|
103
|
+
_8_11_1.test.slow();
|
|
104
|
+
await _8_11_1.test.step('Navigate to completed process in Operate', async () => {
|
|
105
|
+
await homePage.clickClusters();
|
|
106
|
+
await appsPage.clickOperate(clusterName);
|
|
107
|
+
await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible({
|
|
108
|
+
timeout: 60000,
|
|
109
|
+
});
|
|
110
|
+
await operateHomePage.clickProcessesTab();
|
|
111
|
+
await operateProcessesPage.clickProcessCompletedCheckbox();
|
|
112
|
+
await operateProcessesPage.applyMoreFilters('Process Instance Key(s)', String(toolsInstanceKey));
|
|
113
|
+
await operateProcessesPage.clickProcessInstanceLink('MCP Incident Tools');
|
|
114
|
+
await operateProcessInstancePage.assertProcessCompleteStatusWithRetry();
|
|
115
|
+
});
|
|
116
|
+
for (const assertion of testCase.assertions) {
|
|
117
|
+
await _8_11_1.test.step(assertion.description, async () => {
|
|
118
|
+
await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, assertion.text);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _8_11_1 = require("../../../fixtures/8.11");
|
|
4
|
+
const UtilitiesPage_1 = require("../../../pages/8.11/UtilitiesPage");
|
|
5
|
+
const _setup_1 = require("../../../test-setup.js");
|
|
6
|
+
const apiHelpers_1 = require("../../../utils/apiHelpers");
|
|
7
|
+
const userTaskHelpers_1 = require("../../../utils/userTaskHelpers");
|
|
8
|
+
const users_1 = require("../../../utils/users");
|
|
9
|
+
const test_1 = require("@playwright/test");
|
|
10
|
+
const testUser = (0, users_1.getTestUser)('fourteenthUser');
|
|
11
|
+
_8_11_1.test.describe.configure({ mode: 'parallel' });
|
|
12
|
+
_8_11_1.test.describe('Orchestration Cluster MCP Server - User Task Tools @tasklistV2', () => {
|
|
13
|
+
const clusterName = 'Agentic Orchestration Cluster';
|
|
14
|
+
const createTestData = async () => {
|
|
15
|
+
const authToken = await (0, apiHelpers_1.authSaasAPI)(undefined, 'agentic_cluster');
|
|
16
|
+
const [deployedTestFileProcessKey, toolsProcessKey] = await Promise.all([
|
|
17
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_user_task_test_file.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
18
|
+
(0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_user_task_tools.bpmn', authToken, 'saas', 'agentic_cluster'),
|
|
19
|
+
]);
|
|
20
|
+
if (deployedTestFileProcessKey == null || toolsProcessKey == null) {
|
|
21
|
+
throw new Error('Failed to deploy user task tools processes');
|
|
22
|
+
}
|
|
23
|
+
const testFileProcessKey = String(deployedTestFileProcessKey);
|
|
24
|
+
// searchUserTaskVariables (below) returns the task's own VARIABLES
|
|
25
|
+
// (name/value pairs), not fields of the task entity itself -- unlike
|
|
26
|
+
// searchUserTasks/getUserTask, whose responses do carry the task's own
|
|
27
|
+
// userTaskKey. mcp_user_task_test_file.bpmn's user task has no input
|
|
28
|
+
// variables and only writes its output on completion (which this test
|
|
29
|
+
// never reaches), so a process instance started with no variables would
|
|
30
|
+
// have nothing for that call to find, and no amount of retrying or
|
|
31
|
+
// waiting could ever make its response contain testUserTaskKey (run
|
|
32
|
+
// 35340608406 and its retry both failed identically on exactly this).
|
|
33
|
+
// Start the process instance with a marker variable instead, so there is
|
|
34
|
+
// a real value in the task's scope to search for.
|
|
35
|
+
const taskVariableMarker = await (0, _setup_1.generateRandomStringAsync)(10);
|
|
36
|
+
// Create test instance which will create a user task
|
|
37
|
+
const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(testFileProcessKey, authToken, 'saas', 'agentic_cluster', { taskVariableMarker });
|
|
38
|
+
// Get the user task key created by the test instance (with retry logic)
|
|
39
|
+
const testUserTaskKey = await (0, userTaskHelpers_1.getUserTaskKeyByProcessInstanceKey)(testInstanceKey, authToken, 'saas', 'agentic_cluster');
|
|
40
|
+
console.log('Creating tools instance with variables:', {
|
|
41
|
+
testFileProcessKey,
|
|
42
|
+
testUserTaskKey,
|
|
43
|
+
});
|
|
44
|
+
// Create tools instance with required variables
|
|
45
|
+
const toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testUserTaskKey });
|
|
46
|
+
return {
|
|
47
|
+
toolsInstanceKey,
|
|
48
|
+
testFileProcessKey,
|
|
49
|
+
testInstanceKey,
|
|
50
|
+
testUserTaskKey,
|
|
51
|
+
taskVariableMarker,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
_8_11_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
55
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
56
|
+
});
|
|
57
|
+
_8_11_1.test.afterEach(async ({ page }, testInfo) => {
|
|
58
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
59
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
60
|
+
});
|
|
61
|
+
const userTaskToolTests = [
|
|
62
|
+
{
|
|
63
|
+
name: 'searchUserTasks - search user tasks with filters such as processDefinitionKey',
|
|
64
|
+
variable: 'mcpResultSearchUserTasks',
|
|
65
|
+
assertions: (data) => [
|
|
66
|
+
{
|
|
67
|
+
text: 'totalItems',
|
|
68
|
+
description: 'search response contains totalItems field',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
text: () => data.testUserTaskKey,
|
|
72
|
+
description: 'search response contains userTaskKey field',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
text: () => data.testFileProcessKey,
|
|
76
|
+
description: 'search response contains processDefinitionKey field',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'getUserTask - retrieve a user task by key',
|
|
82
|
+
variable: 'mcpResultGetUserTask',
|
|
83
|
+
assertions: (data) => [
|
|
84
|
+
{
|
|
85
|
+
text: () => data.testUserTaskKey,
|
|
86
|
+
description: 'response contains userTaskKey field',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
text: () => data.testInstanceKey,
|
|
90
|
+
description: 'response contains processInstanceKey field',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
text: 'assignee',
|
|
94
|
+
description: 'response contains assignee field',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'assignUserTask - update the assignment of a user task',
|
|
100
|
+
variable: 'mcpResultAssignUserTask',
|
|
101
|
+
assertions: () => [
|
|
102
|
+
{
|
|
103
|
+
text: 'mcpUser',
|
|
104
|
+
description: 'response reflects the assignee value mcpUser',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'searchUserTaskVariables - search variables scoped to a specific user task',
|
|
110
|
+
variable: 'mcpResultSearchUserTaskVariables',
|
|
111
|
+
assertions: (data) => [
|
|
112
|
+
{
|
|
113
|
+
text: 'totalItems',
|
|
114
|
+
description: 'search response contains totalItems field',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
text: () => data.taskVariableMarker,
|
|
118
|
+
description: 'search response contains the variable set on the task',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
for (const testCase of userTaskToolTests) {
|
|
124
|
+
(0, _8_11_1.test)(testCase.name, async ({ page, homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
|
|
125
|
+
_8_11_1.test.slow();
|
|
126
|
+
const data = await createTestData();
|
|
127
|
+
const { toolsInstanceKey } = data;
|
|
128
|
+
await _8_11_1.test.step('Navigate to completed process in Operate', async () => {
|
|
129
|
+
await page.goto('/');
|
|
130
|
+
await homePage.clickClusters();
|
|
131
|
+
await appsPage.clickCamundaApps();
|
|
132
|
+
await appsPage.clickOperate(clusterName);
|
|
133
|
+
await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible({
|
|
134
|
+
timeout: 60000,
|
|
135
|
+
});
|
|
136
|
+
await operateHomePage.clickProcessesTab();
|
|
137
|
+
await operateProcessesPage.clickProcessCompletedCheckbox();
|
|
138
|
+
await operateProcessesPage.applyMoreFilters('Process Instance Key(s)', String(toolsInstanceKey));
|
|
139
|
+
await operateProcessesPage.clickProcessInstanceLink('MCP User Task Tools');
|
|
140
|
+
await operateProcessInstancePage.assertProcessCompleteStatusWithRetry();
|
|
141
|
+
});
|
|
142
|
+
for (const assertion of testCase.assertions(data)) {
|
|
143
|
+
await _8_11_1.test.step(assertion.description, async () => {
|
|
144
|
+
await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, typeof assertion.text === 'function'
|
|
145
|
+
? assertion.text()
|
|
146
|
+
: assertion.text);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|