@camunda/e2e-test-suite 0.0.424 → 0.0.426

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.
@@ -14,12 +14,8 @@ _8_8_1.test.describe('Cluster Setup Tests', () => {
14
14
  await (0, _setup_1.captureFailureVideo)(page, testInfo);
15
15
  });
16
16
  (0, _8_8_1.test)('Enable Alpha Features', async ({ page, loginPage, consoleOrganizationsPage, homePage, }, testInfo) => {
17
- if (process.env.IS_PROD === 'true') {
18
- _8_8_1.test.skip(true, 'Skipping test because not required on PROD test org');
19
- }
20
- if (process.env.IS_AG === 'true') {
21
- _8_8_1.test.skip(true, 'Skipping test because not required when IS_AG is true');
22
- }
17
+ _8_8_1.test.skip(process.env.IS_PROD === 'true', 'Skipping test because not required on PROD test org');
18
+ _8_8_1.test.skip(process.env.IS_AG === 'true', 'Skipping test because not required when IS_AG is true');
23
19
  await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, users_1.testUsers.mainUser, (testInfo.workerIndex + 1) * 1000);
24
20
  await homePage.clickOrganization();
25
21
  await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(page, consoleOrganizationsPage.settingsTab, 'settings tab', 60000, false, 2);
@@ -54,9 +50,9 @@ _8_8_1.test.describe('Cluster Setup Tests', () => {
54
50
  });
55
51
  (0, _8_8_1.test)('Create AWS Cluster', async ({ page, loginPage, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }, testInfo) => {
56
52
  _8_8_1.test.skip(process.env.IS_MIGRATION === 'true', 'Skipping AWS Cluster creation during upgrade testing');
57
- await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, users_1.testUsers.mainUser, (testInfo.workerIndex + 1) * 1000);
58
53
  _8_8_1.test.slow();
59
54
  const clusterName = 'AWS Cluster';
55
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, users_1.testUsers.mainUser, (testInfo.workerIndex + 1) * 1000);
60
56
  await homePage.clickClusters();
61
57
  await clusterPage.createCluster(clusterName, 'AWS');
62
58
  await clusterPage.assertClusterHealthyStatusWithRetry(clusterName, 300000);
@@ -0,0 +1,123 @@
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 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_9_1.test.describe.configure({ mode: 'parallel' });
14
+ _8_9_1.test.describe('Orchestration Cluster MCP Server - Incident 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_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_9_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
39
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
40
+ });
41
+ _8_9_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_9_1.test)(testCase.name, async ({ homePage, appsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
103
+ _8_9_1.test.slow();
104
+ await _8_9_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_9_1.test.step(assertion.description, async () => {
118
+ await operateProcessInstancePage.assertProcessVariableContainsText(testCase.variable, assertion.text);
119
+ });
120
+ }
121
+ });
122
+ }
123
+ });
@@ -0,0 +1 @@
1
+ export declare function getIncidentKeyByProcessInstanceKey(processInstanceKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, maxRetries?: number, retryDelayMs?: number): Promise<string>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIncidentKeyByProcessInstanceKey = void 0;
4
+ const test_1 = require("@playwright/test");
5
+ const apiHelpers_1 = require("./apiHelpers");
6
+ const sleep_1 = require("./sleep");
7
+ async function getIncidentKeyByProcessInstanceKey(processInstanceKey, authToken, environment, clusterType, maxRetries = 10, retryDelayMs = 2000) {
8
+ const apiRequestContext = await (0, apiHelpers_1.getApiRequestContext)();
9
+ const url = (0, apiHelpers_1.buildZeebeApiUrl)('/v2/incidents/search', environment, clusterType);
10
+ let lastError = null;
11
+ // Retry logic to wait for incident 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: { filter: { processInstanceKey: String(processInstanceKey) } },
17
+ });
18
+ (0, test_1.expect)(response.status()).toBe(200);
19
+ const responseBody = await response.json();
20
+ if (responseBody?.items && responseBody.items.length > 0) {
21
+ const incidentKey = responseBody.items[0]?.incidentKey;
22
+ if (incidentKey != null) {
23
+ console.log(`Found incident key ${incidentKey} on attempt ${attempt}`);
24
+ return String(incidentKey);
25
+ }
26
+ }
27
+ lastError = new Error(`No incidents found for processInstanceKey: ${processInstanceKey}`);
28
+ }
29
+ catch (error) {
30
+ lastError = error;
31
+ }
32
+ if (attempt < maxRetries) {
33
+ console.log(`Incident not found yet, retrying in ${retryDelayMs}ms (${attempt}/${maxRetries})...`);
34
+ await (0, sleep_1.sleep)(retryDelayMs);
35
+ }
36
+ }
37
+ throw new Error(`Failed to find incident after ${maxRetries} attempts: ${lastError?.message}`);
38
+ }
39
+ exports.getIncidentKeyByProcessInstanceKey = getIncidentKeyByProcessInstanceKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.424",
3
+ "version": "0.0.426",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",