@camunda/e2e-test-suite 0.0.1197 → 0.0.1198

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.
@@ -12,7 +12,7 @@ const resourceContainers = new WeakMap();
12
12
  // the resource container -- files, folders and uploads live directly inside it,
13
13
  // there is no separate process-application level to descend into. It is created
14
14
  // from the workspace's projects listing via the "Create project" split button +
15
- // dialog, and the app lands on `/workspaces/{wsId}/projects/{projectId}`.
15
+ // dialog, and the app lands on `/workspace/{wsId}/projects/{projectId}`.
16
16
  //
17
17
  // This page object owns that container's surface (creating a Project, and binding
18
18
  // its development-stage cluster). Entering and leaving it is driven from
@@ -43,7 +43,9 @@
43
43
  <zeebe:input source="tools/call" target="data.connectorMode.operation.type" />
44
44
  <zeebe:input source="searchVariables"
45
45
  target="data.connectorMode.operation.toolName" />
46
- <zeebe:input source="={}" target="data.connectorMode.operation.toolArguments" />
46
+ <zeebe:input
47
+ source="={&#34;filter&#34;:{&#34;variableKey&#34;:string(testVariableKey)}}"
48
+ target="data.connectorMode.operation.toolArguments" />
47
49
  </zeebe:ioMapping>
48
50
  <zeebe:taskHeaders>
49
51
  <zeebe:header key="elementTemplateVersion" value="2" />
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _8_10_1 = require("../../../fixtures/8.10");
4
+ const UtilitiesPage_1 = require("../../../pages/8.10/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_10_1.test.describe.configure({ mode: 'parallel' });
12
+ _8_10_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
+ // Create test instance which will create a user task
25
+ const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(testFileProcessKey, authToken, 'saas', 'agentic_cluster');
26
+ // Get the user task key created by the test instance (with retry logic)
27
+ const testUserTaskKey = await (0, userTaskHelpers_1.getUserTaskKeyByProcessInstanceKey)(testInstanceKey, authToken, 'saas', 'agentic_cluster');
28
+ console.log('Creating tools instance with variables:', {
29
+ testFileProcessKey,
30
+ testUserTaskKey,
31
+ });
32
+ // Create tools instance with required variables
33
+ const toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testUserTaskKey });
34
+ return {
35
+ toolsInstanceKey,
36
+ testFileProcessKey,
37
+ testInstanceKey,
38
+ testUserTaskKey,
39
+ };
40
+ };
41
+ _8_10_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
42
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
43
+ });
44
+ _8_10_1.test.afterEach(async ({ page }, testInfo) => {
45
+ await (0, _setup_1.captureScreenshot)(page, testInfo);
46
+ await (0, _setup_1.captureFailureVideo)(page, testInfo);
47
+ });
48
+ const userTaskToolTests = [
49
+ {
50
+ name: 'searchUserTasks - search user tasks with filters such as processDefinitionKey',
51
+ variable: 'mcpResultSearchUserTasks',
52
+ assertions: (data) => [
53
+ {
54
+ text: 'totalItems',
55
+ description: 'search response contains totalItems field',
56
+ },
57
+ {
58
+ text: () => data.testUserTaskKey,
59
+ description: 'search response contains userTaskKey field',
60
+ },
61
+ {
62
+ text: () => data.testFileProcessKey,
63
+ description: 'search response contains processDefinitionKey field',
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ name: 'getUserTask - retrieve a user task by key',
69
+ variable: 'mcpResultGetUserTask',
70
+ assertions: (data) => [
71
+ {
72
+ text: () => data.testUserTaskKey,
73
+ description: 'response contains userTaskKey field',
74
+ },
75
+ {
76
+ text: () => data.testInstanceKey,
77
+ description: 'response contains processInstanceKey field',
78
+ },
79
+ {
80
+ text: 'assignee',
81
+ description: 'response contains assignee field',
82
+ },
83
+ ],
84
+ },
85
+ {
86
+ name: 'assignUserTask - update the assignment of a user task',
87
+ variable: 'mcpResultAssignUserTask',
88
+ assertions: () => [
89
+ {
90
+ text: 'mcpUser',
91
+ description: 'response reflects the assignee value mcpUser',
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ name: 'searchUserTaskVariables - search variables scoped to a specific user task',
97
+ variable: 'mcpResultSearchUserTaskVariables',
98
+ assertions: (data) => [
99
+ {
100
+ text: 'totalItems',
101
+ description: 'search response contains totalItems field',
102
+ },
103
+ {
104
+ text: () => data.testUserTaskKey,
105
+ description: 'search response contains the created user task',
106
+ },
107
+ ],
108
+ },
109
+ ];
110
+ for (const testCase of userTaskToolTests) {
111
+ (0, _8_10_1.test)(testCase.name, async ({ page, homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
112
+ _8_10_1.test.slow();
113
+ const data = await createTestData();
114
+ const { toolsInstanceKey } = data;
115
+ await _8_10_1.test.step('Navigate to completed process in Operate', async () => {
116
+ await page.goto('/');
117
+ await homePage.clickClusters();
118
+ await appsPage.clickCamundaApps();
119
+ await appsPage.clickOperate(clusterName);
120
+ await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible({
121
+ timeout: 60000,
122
+ });
123
+ await operateHomePage.clickProcessesTab();
124
+ await operateProcessesPage.clickProcessCompletedCheckbox();
125
+ await operateProcessesPage.applyMoreFilters('Process Instance Key(s)', String(toolsInstanceKey));
126
+ await operateProcessesPage.clickProcessInstanceLink('MCP User Task Tools');
127
+ await operateProcessInstancePage.assertProcessCompleteStatusWithRetry();
128
+ });
129
+ for (const assertion of testCase.assertions(data)) {
130
+ await _8_10_1.test.step(assertion.description, async () => {
131
+ await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, typeof assertion.text === 'function'
132
+ ? assertion.text()
133
+ : assertion.text);
134
+ });
135
+ }
136
+ });
137
+ }
138
+ });
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _8_10_1 = require("../../../fixtures/8.10");
4
+ const UtilitiesPage_1 = require("../../../pages/8.10/UtilitiesPage");
5
+ const _setup_1 = require("../../../test-setup.js");
6
+ const apiHelpers_1 = require("../../../utils/apiHelpers");
7
+ const variableHelpers_1 = require("../../../utils/variableHelpers");
8
+ const users_1 = require("../../../utils/users");
9
+ const test_1 = require("@playwright/test");
10
+ const testUser = (0, users_1.getTestUser)('sixteenthUser');
11
+ _8_10_1.test.describe.configure({ mode: 'parallel' });
12
+ _8_10_1.test.describe('Orchestration Cluster MCP Server - Variable 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 [testFileProcessKey, toolsProcessKey] = await Promise.all([
17
+ (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_variable_test_file.bpmn', authToken, 'saas', 'agentic_cluster'),
18
+ (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_variable_tools.bpmn', authToken, 'saas', 'agentic_cluster'),
19
+ ]);
20
+ if (testFileProcessKey == null || toolsProcessKey == null) {
21
+ throw new Error('Failed to deploy variable tools processes');
22
+ }
23
+ // Create test instance which will create variables
24
+ const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(testFileProcessKey), authToken, 'saas', 'agentic_cluster', { testVariable1: 'test_value_1', testVariable2: 'test_value_2' });
25
+ // Get a variable key created by the test instance (with retry logic)
26
+ const testVariableKey = await (0, variableHelpers_1.getVariableKeyByProcessInstanceKey)(testInstanceKey, 'testVariable1', authToken, 'saas', 'agentic_cluster');
27
+ console.log('Creating tools instance with variables:', {
28
+ testFileProcessKey,
29
+ testVariableKey,
30
+ });
31
+ // Create tools instance with required variables
32
+ const toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testVariableKey });
33
+ return { toolsInstanceKey, testInstanceKey, testVariableKey };
34
+ };
35
+ _8_10_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
36
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
37
+ });
38
+ _8_10_1.test.afterEach(async ({ page }, testInfo) => {
39
+ await (0, _setup_1.captureScreenshot)(page, testInfo);
40
+ await (0, _setup_1.captureFailureVideo)(page, testInfo);
41
+ });
42
+ const variableToolTests = [
43
+ {
44
+ name: 'searchVariables - search variables with filters',
45
+ variable: 'mcpResultSearchVariables',
46
+ assertions: (data) => [
47
+ {
48
+ text: 'items',
49
+ description: 'search response contains items field',
50
+ },
51
+ {
52
+ text: () => data.testVariableKey,
53
+ description: 'search response contains the created variable key',
54
+ },
55
+ {
56
+ text: 'testVariable1',
57
+ description: 'search response contains the variable name',
58
+ },
59
+ {
60
+ text: 'test_value_1',
61
+ description: 'search response contains the variable value',
62
+ },
63
+ {
64
+ text: () => data.testInstanceKey,
65
+ description: 'search response contains the process instance key',
66
+ },
67
+ ],
68
+ },
69
+ {
70
+ name: 'getVariable - retrieve a variable by key',
71
+ variable: 'mcpResultGetVariable',
72
+ assertions: (data) => [
73
+ {
74
+ text: () => data.testVariableKey,
75
+ description: 'response contains variableKey field',
76
+ },
77
+ {
78
+ text: 'testVariable1',
79
+ description: 'response contains name field',
80
+ },
81
+ {
82
+ text: 'test_value_1',
83
+ description: 'response contains value field',
84
+ },
85
+ {
86
+ text: () => data.testInstanceKey,
87
+ description: 'response contains processInstanceKey field',
88
+ },
89
+ {
90
+ text: 'scopeKey',
91
+ description: 'response contains scopeKey field',
92
+ },
93
+ ],
94
+ },
95
+ ];
96
+ for (const testCase of variableToolTests) {
97
+ (0, _8_10_1.test)(testCase.name, async ({ homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
98
+ _8_10_1.test.slow();
99
+ const data = await createTestData();
100
+ const { toolsInstanceKey } = data;
101
+ await _8_10_1.test.step('Navigate to completed process in Operate', async () => {
102
+ await homePage.clickClusters();
103
+ await appsPage.clickCamundaApps();
104
+ await appsPage.clickOperate(clusterName);
105
+ await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible({
106
+ timeout: 60000,
107
+ });
108
+ await operateHomePage.clickProcessesTab();
109
+ await operateProcessesPage.clickProcessCompletedCheckbox();
110
+ await operateProcessesPage.applyMoreFilters('Process Instance Key(s)', String(toolsInstanceKey));
111
+ await operateProcessesPage.clickProcessInstanceLink('MCP Variable Tools');
112
+ await operateProcessInstancePage.assertProcessCompleteStatusWithRetry();
113
+ });
114
+ for (const assertion of testCase.assertions(data)) {
115
+ await _8_10_1.test.step(assertion.description, async () => {
116
+ await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, typeof assertion.text === 'function'
117
+ ? assertion.text()
118
+ : assertion.text);
119
+ });
120
+ }
121
+ });
122
+ }
123
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1197",
3
+ "version": "0.0.1198",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,9 @@
43
43
  <zeebe:input source="tools/call" target="data.connectorMode.operation.type" />
44
44
  <zeebe:input source="searchVariables"
45
45
  target="data.connectorMode.operation.toolName" />
46
- <zeebe:input source="={}" target="data.connectorMode.operation.toolArguments" />
46
+ <zeebe:input
47
+ source="={&#34;filter&#34;:{&#34;variableKey&#34;:string(testVariableKey)}}"
48
+ target="data.connectorMode.operation.toolArguments" />
47
49
  </zeebe:ioMapping>
48
50
  <zeebe:taskHeaders>
49
51
  <zeebe:header key="elementTemplateVersion" value="2" />