@camunda/e2e-test-suite 0.0.1512 → 0.0.1514

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.
@@ -51,6 +51,7 @@ export declare function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePag
51
51
  export declare function modelAndRunConnectorsTimerEventDiagram(modelerCreatePage: ModelerCreatePage, modelerHomePage: ModelerHomePage, processName: string, page: Page, connectorMarketplacePage: ConnectorMarketplacePage, clusterName: string, connectorTemplatePage: ConnectorTemplatePage): Promise<void>;
52
52
  export declare function createAPIClient(apiClientName: string, homePage: HomePage, clusterDetailsPage: ClusterDetailsPage, clusterName: string, clusterPage: ClusterPage): Promise<void>;
53
53
  export declare function ensureDefaultClusterApiCredentials(apiClientName: string, homePage: HomePage, clusterDetailsPage: ClusterDetailsPage, clusterName: string, clusterPage: ClusterPage): Promise<void>;
54
+ export declare function ensureClusterTypeApiCredentials(page: Page, clusterType: string, apiClientName: string, homePage: HomePage, clusterDetailsPage: ClusterDetailsPage, clusterName: string, clusterPage: ClusterPage, enableMcpSupport?: boolean): Promise<void>;
54
55
  export declare function expectCountToBeOneOf(locator: Locator, count1: number, count2: number): Promise<void>;
55
56
  export declare function assertTestUsesCorrectOrganizationFromModeler(page: Page): Promise<void>;
56
57
  export declare function waitForLoadingToFinish(page: Page, timeout?: number): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitForLoadingToFinish = exports.assertTestUsesCorrectOrganizationFromModeler = exports.expectCountToBeOneOf = exports.ensureDefaultClusterApiCredentials = exports.createAPIClient = exports.modelAndRunConnectorsTimerEventDiagram = exports.modelAndRunConnectorsDocHandlingDiagram = exports.deleteCluster = exports.deleteAllUserGroups = exports.assertTestUsesCorrectOrganization = exports.assertLatestAlertEmail = exports.clickInvitationLinkInEmail = exports.enableAuthorizations = exports.disableRBA = exports.goBackWithRetry = exports.consoleSessionRecovery = exports.runMultipleProcesses = exports.runProcess = exports.completeTaskWithRetry = exports.assertPageTextWithRetry = exports.openAppTabWithRetry = exports.assertLocatorVisibleWithRetry = exports.modelRestConnector = exports.modelDiagramFromFile = exports.withSessionRecovery = exports.isSignedOut = exports.loginWithRetry = void 0;
3
+ exports.waitForLoadingToFinish = exports.assertTestUsesCorrectOrganizationFromModeler = exports.expectCountToBeOneOf = exports.ensureClusterTypeApiCredentials = exports.ensureDefaultClusterApiCredentials = exports.createAPIClient = exports.modelAndRunConnectorsTimerEventDiagram = exports.modelAndRunConnectorsDocHandlingDiagram = exports.deleteCluster = exports.deleteAllUserGroups = exports.assertTestUsesCorrectOrganization = exports.assertLatestAlertEmail = exports.clickInvitationLinkInEmail = exports.enableAuthorizations = exports.disableRBA = exports.goBackWithRetry = exports.consoleSessionRecovery = exports.runMultipleProcesses = exports.runProcess = exports.completeTaskWithRetry = exports.assertPageTextWithRetry = exports.openAppTabWithRetry = exports.assertLocatorVisibleWithRetry = exports.modelRestConnector = exports.modelDiagramFromFile = exports.withSessionRecovery = exports.isSignedOut = exports.loginWithRetry = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const ModelerHomePage_1 = require("./ModelerHomePage");
6
6
  const HomePage_1 = require("./HomePage");
@@ -970,6 +970,61 @@ async function ensureDefaultClusterApiCredentials(apiClientName, homePage, clust
970
970
  await createAPIClient(apiClientName, homePage, clusterDetailsPage, clusterName, clusterPage);
971
971
  }
972
972
  exports.ensureDefaultClusterApiCredentials = ensureDefaultClusterApiCredentials;
973
+ // Same gap as ensureDefaultClusterApiCredentials, for a named cluster type
974
+ // whose credentials live in suffixed env vars (ZEEBE_API_*_<TYPE>, read by
975
+ // getClusterCredentials(clusterType) in utils/apiHelpers.ts). test-setup's
976
+ // "Create Agentic Orchestration Cluster" sets them for 'agentic_cluster', but
977
+ // only in its own process, so a --no-deps run of an MCP spec has none and
978
+ // every API call throws "Credentials for cluster type ... not found".
979
+ //
980
+ // The org may not have the cluster at all: the SaaS flakiness validate loop
981
+ // gives each iteration a fresh org and only runs "Create Default Cluster", so
982
+ // clicking the cluster link failed on every attempt. Provision it the way
983
+ // test-setup does (ensureClusterViaApi adopts an existing one) and, when
984
+ // `enableMcpSupport` is set, turn MCP support on before creating the client.
985
+ //
986
+ // Requires `page` to already be logged in to Console as an org admin. Creating
987
+ // the cluster can take ~25 min, so callers must raise their timeout.
988
+ async function ensureClusterTypeApiCredentials(page, clusterType, apiClientName, homePage, clusterDetailsPage, clusterName, clusterPage, enableMcpSupport = false) {
989
+ const suffix = clusterType.toUpperCase().replace(/[\s-]/g, '_');
990
+ const required = [
991
+ `ZEEBE_API_CLIENT_ID_${suffix}`,
992
+ `ZEEBE_API_CLIENT_SECRET_${suffix}`,
993
+ `ZEEBE_API_AUTH_URL_${suffix}`,
994
+ `ZEEBE_API_URL_${suffix}`,
995
+ `ZEEBE_API_TOKEN_AUDIENCE_${suffix}`,
996
+ ];
997
+ if (required.every((key) => process.env[key])) {
998
+ return;
999
+ }
1000
+ console.log(`"${clusterType}" API credentials are not in the environment; ` +
1001
+ `creating an API client on "${clusterName}".`);
1002
+ const clusterUuid = await (0, consoleApiHelpers_1.ensureClusterViaApi)(page, clusterName);
1003
+ await (0, consoleApiHelpers_1.waitForClusterHealthyViaApi)(page, clusterUuid, 1500000);
1004
+ await homePage.closeInformationDialog();
1005
+ await homePage.clickClusters();
1006
+ await clusterPage.clickClusterLink(clusterName);
1007
+ if (enableMcpSupport) {
1008
+ await clusterDetailsPage.clickSettingsTab();
1009
+ await (0, test_1.expect)(clusterDetailsPage.mcpSupportToggle).toBeVisible({
1010
+ timeout: 60000,
1011
+ });
1012
+ if (!(await clusterDetailsPage.mcpSupportToggle.isChecked())) {
1013
+ // Same order as test-setup: the restart the MCP toggle triggers is what
1014
+ // makes the audit-log configuration live.
1015
+ await (0, consoleApiHelpers_1.ensureClientAuditLoggingViaApi)(page, clusterUuid);
1016
+ await clusterDetailsPage.checkMcpSupportToggle();
1017
+ await (0, consoleApiHelpers_1.waitForClusterRestartHealthyViaApi)(page, clusterUuid, 1500000);
1018
+ await homePage.clickClusters();
1019
+ await clusterPage.assertClusterHealthyStatusWithRetry(clusterName);
1020
+ await clusterPage.clickClusterLink(clusterName);
1021
+ }
1022
+ }
1023
+ await clusterDetailsPage.clickAPITab();
1024
+ await clusterDetailsPage.createAPIClientAndReturnVariables(apiClientName, true, clusterType);
1025
+ await clusterDetailsPage.clickCloseModalButton();
1026
+ }
1027
+ exports.ensureClusterTypeApiCredentials = ensureClusterTypeApiCredentials;
973
1028
  async function expectCountToBeOneOf(locator, count1, count2) {
974
1029
  try {
975
1030
  await Promise.race([
@@ -200,6 +200,7 @@ declare class ModelerCreatePage {
200
200
  expandAssignmentSection(): Promise<void>;
201
201
  clickAppendElementButton(): Promise<void>;
202
202
  clickParallelGatewayOption(): Promise<void>;
203
+ private ensureGatewayAppended;
203
204
  private gatewayShapeIds;
204
205
  private selectReplacedGateway;
205
206
  private pinAppendedGateway;
@@ -1683,6 +1683,34 @@ class ModelerCreatePage {
1683
1683
  }
1684
1684
  throw new Error(`Failed to replace the element with a parallel gateway after ${maxRetries} attempts: ${lastError}`);
1685
1685
  }
1686
+ // A save conflict force-refreshes the diagram, which drops the gateway just
1687
+ // appended and leaves the start event selected, so the replace popup offers
1688
+ // start-event entries only. Reload onto the saved diagram and append again.
1689
+ async ensureGatewayAppended() {
1690
+ const selectedGateway = this.page
1691
+ .locator('.djs-element.selected[data-element-id*="Gateway"]')
1692
+ .first();
1693
+ if (await this.isVisibleWithin(selectedGateway, 10000)) {
1694
+ return;
1695
+ }
1696
+ await this.waitForFileSavesToSettle();
1697
+ await this.page.reload();
1698
+ await (0, sleep_1.sleep)(10000);
1699
+ // The append may have been saved with only the selection lost; select
1700
+ // that gateway rather than appending a second one from the start event.
1701
+ const savedGateway = this.page
1702
+ .locator('.djs-element[data-element-id*="Gateway"]')
1703
+ .first();
1704
+ if (await this.isVisibleWithin(savedGateway, 5000)) {
1705
+ await savedGateway.click({ force: true, timeout: 30000 });
1706
+ }
1707
+ else {
1708
+ await this.clickFirstPlacedElement();
1709
+ await this.clickAppendElementButton();
1710
+ await this.clickAppendGatewayButton();
1711
+ }
1712
+ await (0, test_1.expect)(selectedGateway).toBeVisible({ timeout: 30000 });
1713
+ }
1686
1714
  async gatewayShapeIds() {
1687
1715
  const ids = await this.page
1688
1716
  .locator('.djs-shape[data-element-id^="Gateway_"]')
@@ -1832,6 +1860,7 @@ class ModelerCreatePage {
1832
1860
  await this.hoverOnLocator(this.appendElementButton);
1833
1861
  }
1834
1862
  await this.clickAppendGatewayButton();
1863
+ await this.ensureGatewayAppended();
1835
1864
  await this.clickParallelGatewayOption();
1836
1865
  await this.clickAppendElementButton();
1837
1866
  await this.clickAppendTaskButton();
@@ -16,16 +16,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  */
17
17
  const _8_10_1 = require("../../../../fixtures/8.10");
18
18
  const test_1 = require("@playwright/test");
19
+ const UtilitiesPage_1 = require("../../../../pages/8.10/UtilitiesPage");
20
+ const _setup_1 = require("../../../../test-setup.js");
19
21
  const apiHelpers_1 = require("../../../../utils/apiHelpers");
20
22
  const constants_1 = require("../../../../utils/constants");
21
23
  const mcpHelpers_1 = require("../../../../utils/mcpHelpers");
24
+ const users_1 = require("../../../../utils/users");
25
+ const testUser = (0, users_1.getTestUser)();
26
+ let suiteSetup;
22
27
  let authToken;
23
28
  let mcpProcessesUrl;
24
29
  let messageSubscriptionsSearchUrl;
25
30
  let mcpSessionId = null;
26
31
  _8_10_1.test.describe
27
32
  .parallel('Orchestration Cluster MCP Server — /mcp/processes tools/list', () => {
28
- _8_10_1.test.beforeAll(async () => {
33
+ // The agentic-cluster credentials come from test-setup and only reach this
34
+ // spec within the same `playwright test` invocation. Runs launched with
35
+ // --no-deps (flakiness validate loop, fix-agent verification) lack them, so
36
+ // provision our own API client first. That needs a logged-in Console page,
37
+ // i.e. test-scoped fixtures, hence beforeEach + a once-per-worker setup
38
+ // instead of beforeAll. No browser work happens when the creds are present.
39
+ _8_10_1.test.beforeEach(async ({ page, loginPage, homePage, clusterPage, clusterDetailsPage }, testInfo) => {
40
+ if (!process.env.ZEEBE_API_CLIENT_ID_AGENTIC_CLUSTER) {
41
+ // Provisioning the cluster when the org lacks it outlasts the default
42
+ // timeout; same budget the setup test gets for it (create + restart).
43
+ _8_10_1.test.setTimeout(testInfo.timeout + 3600000);
44
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
45
+ await (0, UtilitiesPage_1.ensureClusterTypeApiCredentials)(page, 'agentic_cluster', 'MCP_List_Tools_API_Client' + (await (0, _setup_1.generateRandomStringAsync)(3)), homePage, clusterDetailsPage, 'Agentic Orchestration Cluster', clusterPage, true);
46
+ }
47
+ suiteSetup ??= setupSuite();
48
+ await suiteSetup;
49
+ });
50
+ const setupSuite = async () => {
29
51
  authToken = await (0, apiHelpers_1.authSaasAPI)(undefined, 'agentic_cluster');
30
52
  mcpProcessesUrl = (0, apiHelpers_1.buildZeebeApiUrl)('/mcp/processes', 'saas', 'agentic_cluster');
31
53
  messageSubscriptionsSearchUrl = (0, apiHelpers_1.buildZeebeApiUrl)('/v2/message-subscriptions/search', 'saas', 'agentic_cluster');
@@ -56,7 +78,7 @@ _8_10_1.test.describe
56
78
  const v2Key = await (0, apiHelpers_1.deployProcess)('./resources/mcp_server_saas/mcp_as_tool_v2.bpmn', authToken, 'saas', 'agentic_cluster');
57
79
  if (v2Key == null)
58
80
  throw new Error('Failed to deploy mcp_as_tool_v2.bpmn');
59
- });
81
+ };
60
82
  (0, _8_10_1.test)('SC-MCP-02 — Static observability tools always present in tools/list', async () => {
61
83
  const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
62
84
  await (0, test_1.expect)(async () => {
@@ -693,6 +693,13 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
693
693
  await modelerCreatePage.modelCamundaUserTaskDiagram(processName, processName);
694
694
  await modelerCreatePage.linkFormToStartEvent(formName);
695
695
  await modelerCreatePage.enablePublicAccessIfDisabled();
696
+ // The deploy sends what the server holds, and the public-access toggle
697
+ // (the last edit) is only persisted by Hub's ~10s debounced autosave.
698
+ // Deploying before it lands publishes no public link, so the
699
+ // Publication tab never renders its "Copy to clipboard" code block.
700
+ // 15s covers that debounce without paying the full default when the
701
+ // save already landed during the toggle's own wait.
702
+ await modelerCreatePage.waitForAutosaveAfterEdits(15000);
696
703
  await modelerCreatePage.deployDiagram(clusterName);
697
704
  await (0, sleep_1.sleep)(10000);
698
705
  });
@@ -706,10 +713,14 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
706
713
  });
707
714
  await _8_7_1.test.step('Access Public Form After Session Reset and Submit the Form', async () => {
708
715
  console.log('Navigating to public form:', publicFormLink);
709
- await page.goto(publicFormLink);
710
- await (0, test_1.expect)(taskDetailsPage.textInput).toBeVisible({
711
- timeout: 30000,
712
- });
716
+ // The public form can take a moment to become servable right after the
717
+ // deploy; re-open the link rather than waiting on one blank page.
718
+ await (0, test_1.expect)(async () => {
719
+ await page.goto(publicFormLink);
720
+ await (0, test_1.expect)(taskDetailsPage.textInput).toBeVisible({
721
+ timeout: 30000,
722
+ });
723
+ }).toPass({ timeout: 120000, intervals: [5000] });
713
724
  await taskDetailsPage.fillTextInput('Public Form Test Value');
714
725
  await taskDetailsPage.clickSubmitButton();
715
726
  await (0, test_1.expect)(page.getByRole('heading', { name: 'Success!' })).toBeVisible({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1512",
3
+ "version": "0.0.1514",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",