@camunda/e2e-test-suite 0.0.440 → 0.0.442

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.
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _8_9_1 = require("../../../fixtures/8.9");
4
+ const UtilitiesPage_1 = require("../../../pages/8.9/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
+ let authToken;
12
+ let toolsInstanceKey;
13
+ _8_9_1.test.describe.configure({ mode: 'parallel' });
14
+ _8_9_1.test.describe('Orchestration Cluster MCP Server - Variable Tools @tasklistV2', () => {
15
+ const clusterName = 'Agentic Orchestration Cluster';
16
+ _8_9_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_variable_test_file.bpmn', authToken, 'saas', 'agentic_cluster'),
20
+ (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_variable_tools.bpmn', authToken, 'saas', 'agentic_cluster'),
21
+ ]);
22
+ if (testFileProcessKey == null || toolsProcessKey == null) {
23
+ throw new Error('Failed to deploy variable tools processes');
24
+ }
25
+ // Create test instance which will create variables
26
+ const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(testFileProcessKey), authToken, 'saas', 'agentic_cluster', { testVariable1: 'test_value_1', testVariable2: 'test_value_2' });
27
+ // Get a variable key created by the test instance (with retry logic)
28
+ const testVariableKey = await (0, variableHelpers_1.getVariableKeyByProcessInstanceKey)(testInstanceKey, 'testVariable1', authToken, 'saas', 'agentic_cluster');
29
+ console.log('Creating tools instance with variables:', {
30
+ testFileProcessKey,
31
+ testVariableKey,
32
+ });
33
+ // Create tools instance with required variables
34
+ toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testVariableKey });
35
+ });
36
+ _8_9_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
37
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
38
+ });
39
+ _8_9_1.test.afterEach(async ({ page }, testInfo) => {
40
+ await (0, _setup_1.captureScreenshot)(page, testInfo);
41
+ await (0, _setup_1.captureFailureVideo)(page, testInfo);
42
+ });
43
+ const variableToolTests = [
44
+ {
45
+ name: 'searchVariables - search variables with filters',
46
+ variable: 'mcpResultSearchVariables',
47
+ assertions: [
48
+ {
49
+ text: 'items',
50
+ description: 'search response contains items field',
51
+ },
52
+ {
53
+ text: 'variableKey',
54
+ description: 'search response contains variableKey field',
55
+ },
56
+ {
57
+ text: 'name',
58
+ description: 'search response contains name field',
59
+ },
60
+ {
61
+ text: 'value',
62
+ description: 'search response contains value field',
63
+ },
64
+ {
65
+ text: 'processInstanceKey',
66
+ description: 'search response contains processInstanceKey field',
67
+ },
68
+ ],
69
+ },
70
+ {
71
+ name: 'getVariable - retrieve a variable by key',
72
+ variable: 'mcpResultGetVariable',
73
+ assertions: [
74
+ {
75
+ text: 'variableKey',
76
+ description: 'response contains variableKey field',
77
+ },
78
+ {
79
+ text: 'name',
80
+ description: 'response contains name field',
81
+ },
82
+ {
83
+ text: 'value',
84
+ description: 'response contains value field',
85
+ },
86
+ {
87
+ text: 'processInstanceKey',
88
+ description: 'response contains processInstanceKey field',
89
+ },
90
+ {
91
+ text: 'scopeKey',
92
+ description: 'response contains scopeKey field',
93
+ },
94
+ ],
95
+ },
96
+ ];
97
+ for (const testCase of variableToolTests) {
98
+ (0, _8_9_1.test)(testCase.name, async ({ homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
99
+ _8_9_1.test.slow();
100
+ await _8_9_1.test.step('Navigate to completed process in Operate', async () => {
101
+ await homePage.clickClusters();
102
+ await appsPage.clickOperate(clusterName);
103
+ await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible({
104
+ timeout: 60000,
105
+ });
106
+ await operateHomePage.clickProcessesTab();
107
+ await operateProcessesPage.clickProcessCompletedCheckbox();
108
+ await operateProcessesPage.applyMoreFilters('Process Instance Key(s)', String(toolsInstanceKey));
109
+ await operateProcessesPage.clickProcessInstanceLink('MCP Variable Tools');
110
+ await operateProcessInstancePage.assertProcessCompleteStatusWithRetry();
111
+ });
112
+ for (const assertion of testCase.assertions) {
113
+ await _8_9_1.test.step(assertion.description, async () => {
114
+ await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, assertion.text);
115
+ });
116
+ }
117
+ });
118
+ }
119
+ });
@@ -35,7 +35,8 @@ if (process.env.IS_MIGRATION === 'true') {
35
35
  await navigationPage.goToOCIdentity();
36
36
  });
37
37
  });
38
- (0, SM_8_8_1.test)('Assert Most Common Flow User Flow With All Apps Process Migration', async ({ page, navigationPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, optimizeHomePage, optimizeCollectionsPage, optimizeReportPage, taskPanelPage, }) => {
38
+ // Skipped due to 320: https://github.com/camunda/marketplace-api/issues/320
39
+ SM_8_8_1.test.skip('Assert Most Common Flow User Flow With All Apps Process Migration', async ({ page, navigationPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, optimizeHomePage, optimizeCollectionsPage, optimizeReportPage, taskPanelPage, }) => {
39
40
  SM_8_8_1.test.slow();
40
41
  const processName = 'Zeebe_User_Task_Process';
41
42
  await SM_8_8_1.test.step('View Process Instance in Operate', async () => {
@@ -0,0 +1 @@
1
+ export declare function getVariableKeyByProcessInstanceKey(processInstanceKey: string, variableName: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, maxRetries?: number, retryDelayMs?: number): Promise<string>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVariableKeyByProcessInstanceKey = void 0;
4
+ const test_1 = require("@playwright/test");
5
+ const apiHelpers_1 = require("./apiHelpers");
6
+ const sleep_1 = require("./sleep");
7
+ async function getVariableKeyByProcessInstanceKey(processInstanceKey, variableName, authToken, environment, clusterType, maxRetries = 10, retryDelayMs = 2000) {
8
+ const apiRequestContext = await (0, apiHelpers_1.getApiRequestContext)();
9
+ const url = (0, apiHelpers_1.buildZeebeApiUrl)('/v2/variables/search', environment, clusterType);
10
+ let lastError = null;
11
+ // Retry logic to wait for variable to be created and indexed
12
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
13
+ try {
14
+ const response = await apiRequestContext.post(url, {
15
+ headers: { Authorization: authToken ?? '' },
16
+ data: {
17
+ filter: {
18
+ processInstanceKey: String(processInstanceKey),
19
+ name: variableName,
20
+ },
21
+ },
22
+ });
23
+ (0, test_1.expect)(response.status()).toBe(200);
24
+ const responseBody = await response.json();
25
+ if (responseBody?.items && responseBody.items.length > 0) {
26
+ const variableKey = responseBody.items[0]?.variableKey;
27
+ if (variableKey != null) {
28
+ console.log(`Found variable key ${variableKey} for ${variableName} on attempt ${attempt}`);
29
+ return String(variableKey);
30
+ }
31
+ }
32
+ lastError = new Error(`No variable ${variableName} found for processInstanceKey: ${processInstanceKey}`);
33
+ }
34
+ catch (error) {
35
+ lastError = error;
36
+ }
37
+ if (attempt < maxRetries) {
38
+ console.log(`Variable ${variableName} not found yet, retrying in ${retryDelayMs}ms (${attempt}/${maxRetries})...`);
39
+ await (0, sleep_1.sleep)(retryDelayMs);
40
+ }
41
+ }
42
+ throw new Error(`Failed to find variable ${variableName} after ${maxRetries} attempts: ${lastError?.message}`);
43
+ }
44
+ exports.getVariableKeyByProcessInstanceKey = getVariableKeyByProcessInstanceKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.440",
3
+ "version": "0.0.442",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",