@camunda/e2e-test-suite 0.0.759 → 0.0.761
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/dist/pages/8.10/ModelerCreatePage.d.ts +2 -0
- package/dist/pages/8.10/ModelerCreatePage.js +14 -0
- package/dist/tests/8.9/orchestration-cluster-mcp-server/mcp-process-instance-tools.spec.js +5 -3
- package/dist/utils/apiHelpers.d.ts +1 -0
- package/dist/utils/apiHelpers.js +26 -1
- package/package.json +1 -1
|
@@ -89,6 +89,7 @@ declare class ModelerCreatePage {
|
|
|
89
89
|
readonly zeebeClientIdVariable: Locator;
|
|
90
90
|
readonly variableAssignmentValueTextboxThirdVariable: Locator;
|
|
91
91
|
readonly connectorsDocHandlingStartEventElement: Locator;
|
|
92
|
+
readonly detailsPanelToggle: Locator;
|
|
92
93
|
readonly timerEventOption: Locator;
|
|
93
94
|
readonly timerEventSettings: Locator;
|
|
94
95
|
readonly timerType: Locator;
|
|
@@ -203,6 +204,7 @@ declare class ModelerCreatePage {
|
|
|
203
204
|
switchToPlay(): Promise<void>;
|
|
204
205
|
completePlayConfiguration(clusterName: string): Promise<void>;
|
|
205
206
|
embedForm(formName: string): Promise<void>;
|
|
207
|
+
openDetailsPanelIfCollapsed(): Promise<void>;
|
|
206
208
|
fillStartEventVariablesForDocHandling(zeebeUrl: string, zeebeClientId: string, zeebeClientSecret: string): Promise<void>;
|
|
207
209
|
fillZeebeClientId(clientId: string): Promise<void>;
|
|
208
210
|
fillZeebeSecretValue(zeebeSecret: string): Promise<void>;
|
|
@@ -95,6 +95,7 @@ class ModelerCreatePage {
|
|
|
95
95
|
zeebeClientIdVariable;
|
|
96
96
|
variableAssignmentValueTextboxThirdVariable;
|
|
97
97
|
connectorsDocHandlingStartEventElement;
|
|
98
|
+
detailsPanelToggle;
|
|
98
99
|
timerEventOption;
|
|
99
100
|
timerEventSettings;
|
|
100
101
|
timerType;
|
|
@@ -276,6 +277,7 @@ class ModelerCreatePage {
|
|
|
276
277
|
.getByText('zeebeClientId');
|
|
277
278
|
this.variableAssignmentValueTextboxThirdVariable = page.locator('#bio-properties-panel-StartEvent_1-output-2-source div');
|
|
278
279
|
this.connectorsDocHandlingStartEventElement = page.locator('g:nth-child(5) > .djs-element > .djs-hit');
|
|
280
|
+
this.detailsPanelToggle = page.locator('[data-test="details-panel-toggle"]');
|
|
279
281
|
this.timerEventOption = page.getByRole('listitem', {
|
|
280
282
|
name: 'Timer intermediate catch event',
|
|
281
283
|
exact: true,
|
|
@@ -1152,12 +1154,24 @@ class ModelerCreatePage {
|
|
|
1152
1154
|
await this.clickForm(formName);
|
|
1153
1155
|
await this.clickEmbedButton();
|
|
1154
1156
|
}
|
|
1157
|
+
async openDetailsPanelIfCollapsed() {
|
|
1158
|
+
await (0, test_1.expect)(this.detailsPanelToggle).toBeVisible({ timeout: 60000 });
|
|
1159
|
+
const isCollapsed = (await this.detailsPanelToggle.getAttribute('aria-expanded')) === 'false';
|
|
1160
|
+
if (isCollapsed) {
|
|
1161
|
+
await this.detailsPanelToggle.click({ timeout: 60000 });
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1155
1164
|
async fillStartEventVariablesForDocHandling(zeebeUrl, zeebeClientId, zeebeClientSecret) {
|
|
1156
1165
|
console.log(`URL: ${zeebeUrl}, ClientId: ${zeebeClientId}, Secret: ${zeebeClientSecret}`);
|
|
1157
1166
|
await (0, test_1.expect)(this.connectorsDocHandlingStartEventElement).toBeVisible({
|
|
1158
1167
|
timeout: 60000,
|
|
1159
1168
|
});
|
|
1160
1169
|
await this.connectorsDocHandlingStartEventElement.click();
|
|
1170
|
+
// After the page reload in modelAndRunConnectorsDocHandlingDiagram the
|
|
1171
|
+
// modeler's Details (properties) panel is collapsed, so the start event's
|
|
1172
|
+
// "Output mapping" group is not rendered. Re-open the panel before
|
|
1173
|
+
// asserting on its contents.
|
|
1174
|
+
await this.openDetailsPanelIfCollapsed();
|
|
1161
1175
|
await (0, test_1.expect)(this.startEventVariableInputWithThreeVariables).toBeVisible({
|
|
1162
1176
|
timeout: 60000,
|
|
1163
1177
|
});
|
|
@@ -4,7 +4,6 @@ const _8_9_1 = require("../../../fixtures/8.9");
|
|
|
4
4
|
const UtilitiesPage_1 = require("../../../pages/8.9/UtilitiesPage");
|
|
5
5
|
const _setup_1 = require("../../../test-setup.js");
|
|
6
6
|
const apiHelpers_1 = require("../../../utils/apiHelpers");
|
|
7
|
-
const sleep_1 = require("../../../utils/sleep");
|
|
8
7
|
const users_1 = require("../../../utils/users");
|
|
9
8
|
const test_1 = require("@playwright/test");
|
|
10
9
|
const testUser = (0, users_1.getTestUser)('fourteenthUser');
|
|
@@ -23,8 +22,11 @@ _8_9_1.test.describe('Orchestration Cluster MCP Server - Process Instance Tools
|
|
|
23
22
|
throw new Error('Failed to deploy process instance tools processes');
|
|
24
23
|
}
|
|
25
24
|
const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(testFileProcessKey), authToken, 'saas', 'agentic_cluster');
|
|
26
|
-
// Wait for test instance to be
|
|
27
|
-
|
|
25
|
+
// Wait for the test instance to be exported to secondary storage before the
|
|
26
|
+
// tools instance queries it via the getProcessInstance MCP tool. That tool
|
|
27
|
+
// wraps GET /v2/process-instances/{key}, which is eventually consistent and
|
|
28
|
+
// returns 404 until the Camunda Exporter syncs — a fixed sleep is not enough.
|
|
29
|
+
await (0, apiHelpers_1.waitForProcessInstanceVisible)(String(testInstanceKey), authToken, 'saas', 'agentic_cluster');
|
|
28
30
|
toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testInstanceKey });
|
|
29
31
|
});
|
|
30
32
|
_8_9_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
@@ -17,6 +17,7 @@ export declare function validateMcpServerHealth(serverUrl?: string): Promise<API
|
|
|
17
17
|
export declare function waitForConnectorsReady(baseUrl?: string | undefined, timeoutMs?: number): Promise<void>;
|
|
18
18
|
export declare function deployProcess(filePath: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string): Promise<number | null>;
|
|
19
19
|
export declare function createProcessInstance(processDefinitionKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, variables?: Record<string, unknown>): Promise<string>;
|
|
20
|
+
export declare function waitForProcessInstanceVisible(processInstanceKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, maxAttempts?: number, retryDelayMs?: number): Promise<void>;
|
|
20
21
|
export declare function createJsonClusterVariable(authToken?: string, environment?: 'saas' | 'sm', customVariableName?: string, customVariableValue?: string, clusterType?: string): Promise<void>;
|
|
21
22
|
export declare function createStringClusterVariable(authToken?: string, environment?: 'saas' | 'sm', customVariableName?: string, customVariableValue?: string, clusterType?: string): Promise<void>;
|
|
22
23
|
interface ReportDefinition {
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.createProcessInstance = exports.deployProcess = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
|
|
6
|
+
exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.waitForProcessInstanceVisible = exports.createProcessInstance = exports.deployProcess = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
|
|
7
7
|
const test_1 = require("@playwright/test");
|
|
8
8
|
const sleep_1 = require("./sleep");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -394,6 +394,31 @@ async function createProcessInstance(processDefinitionKey, authToken, environmen
|
|
|
394
394
|
return String(processInstanceKey);
|
|
395
395
|
}
|
|
396
396
|
exports.createProcessInstance = createProcessInstance;
|
|
397
|
+
// Poll the eventually-consistent GET /v2/process-instances/{key} endpoint until
|
|
398
|
+
// the instance has been exported to secondary storage (HTTP 200). Immediately
|
|
399
|
+
// after creation this endpoint returns 404 until the Camunda Exporter syncs,
|
|
400
|
+
// so callers that need the instance queryable by key (e.g. via the
|
|
401
|
+
// getProcessInstance MCP tool) must wait for it to become visible.
|
|
402
|
+
async function waitForProcessInstanceVisible(processInstanceKey, authToken, environment, clusterType, maxAttempts = 12, retryDelayMs = 5000) {
|
|
403
|
+
apiRequestContext = await getApiRequestContext();
|
|
404
|
+
const url = buildZeebeApiUrl(`/v2/process-instances/${processInstanceKey}`, environment, clusterType);
|
|
405
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
406
|
+
const response = await apiRequestContext.get(url, {
|
|
407
|
+
headers: {
|
|
408
|
+
Authorization: authToken ?? '',
|
|
409
|
+
},
|
|
410
|
+
});
|
|
411
|
+
if (response.status() === 200) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (attempt < maxAttempts) {
|
|
415
|
+
console.warn(`waitForProcessInstanceVisible: process instance ${processInstanceKey} not yet indexed (HTTP ${response.status()}), attempt ${attempt}/${maxAttempts}, retrying in ${retryDelayMs}ms`);
|
|
416
|
+
await (0, sleep_1.sleep)(retryDelayMs);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
throw new Error(`Process instance ${processInstanceKey} was not visible in secondary storage after ${maxAttempts} attempts.`);
|
|
420
|
+
}
|
|
421
|
+
exports.waitForProcessInstanceVisible = waitForProcessInstanceVisible;
|
|
397
422
|
async function createClusterVariableInternal(authToken, environment, variableName, variableValue, variableType, clusterType) {
|
|
398
423
|
// Retry on transient ingress / upstream errors (502/503/504) and on
|
|
399
424
|
// network-layer exceptions, which we have observed during nightly runs
|