@camunda/e2e-test-suite 0.0.1019 → 0.0.1020

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.
@@ -38,6 +38,11 @@ class AuditLogPage {
38
38
  await (0, test_1.expect)(checkbox).toBeChecked();
39
39
  return true;
40
40
  }
41
+ // Not used by cluster setup: Console re-seeds this panel's checkbox state
42
+ // from the cluster on every background refresh, so selections made before
43
+ // "Update" is pressed can be dropped and only some categories get saved. Use
44
+ // ensureClientAuditLoggingViaApi (utils/consoleApiHelpers) to configure a
45
+ // cluster; drive this only when the UI itself is what is under test.
41
46
  async enableClientOperationLogging() {
42
47
  const categories = [
43
48
  'Administration',
@@ -55,7 +55,7 @@ _8_10_1.test.describe('Cluster Setup Tests', () => {
55
55
  await clusterSecretsPage.createSetOfSecrets(clusterName, connectorSecrets_1.bedrockCodeInterpreterSecretsValues);
56
56
  }
57
57
  });
58
- (0, _8_10_1.test)('Create Agentic Orchestration Cluster', async ({ page, loginPage, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, auditLogPage, }, testInfo) => {
58
+ (0, _8_10_1.test)('Create Agentic Orchestration Cluster', async ({ page, loginPage, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }, testInfo) => {
59
59
  _8_10_1.test.skip(process.env.IS_PROD === 'true', 'Skipping test because not required on PROD test org');
60
60
  _8_10_1.test.skip(process.env.IS_AG === 'true', 'Skipping test because not required when IS_AG is true');
61
61
  _8_10_1.test.slow();
@@ -69,8 +69,9 @@ _8_10_1.test.describe('Cluster Setup Tests', () => {
69
69
  await homePage.clickClusters();
70
70
  await clusterPage.clickClusterLink(clusterName);
71
71
  await clusterDetailsPage.assertComponentsHealth();
72
- await auditLogPage.clickAuditLogTab();
73
- await auditLogPage.enableClientOperationLogging();
72
+ // Must happen before the MCP toggle: the restart that toggle triggers is
73
+ // what makes the new audit-log configuration live on the cluster.
74
+ await (0, consoleApiHelpers_1.ensureClientAuditLoggingViaApi)(page, clusterUuid);
74
75
  await clusterDetailsPage.clickSettingsTab();
75
76
  await clusterDetailsPage.checkMcpSupportToggle();
76
77
  // Enabling MCP support restarts the cluster (Console shows a "Restart
@@ -3,5 +3,6 @@ export declare function deleteClusterViaApi(page: Page, clusterName: string): Pr
3
3
  export declare function createClusterViaApi(page: Page, clusterName: string, region?: string, tasklistV2Enabled?: boolean): Promise<string>;
4
4
  export declare function ensureClusterViaApi(page: Page, clusterName: string, region?: string, tasklistV2Enabled?: boolean): Promise<string>;
5
5
  export declare function ensureTasklistV2Enabled(page: Page, clusterUuid: string): Promise<void>;
6
+ export declare function ensureClientAuditLoggingViaApi(page: Page, clusterUuid: string): Promise<void>;
6
7
  export declare function waitForClusterHealthyViaApi(page: Page, clusterUuid: string, timeoutMs?: number): Promise<void>;
7
8
  export declare function waitForClusterRestartHealthyViaApi(page: Page, clusterUuid: string, timeoutMs?: number): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitForClusterRestartHealthyViaApi = exports.waitForClusterHealthyViaApi = exports.ensureTasklistV2Enabled = exports.ensureClusterViaApi = exports.createClusterViaApi = exports.deleteClusterViaApi = void 0;
3
+ exports.waitForClusterRestartHealthyViaApi = exports.waitForClusterHealthyViaApi = exports.ensureClientAuditLoggingViaApi = exports.ensureTasklistV2Enabled = exports.ensureClusterViaApi = exports.createClusterViaApi = exports.deleteClusterViaApi = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("./sleep");
6
6
  const PLAN_TYPE_ID = '574cde5f-54ae-43c1-851a-e6fb4f03423a';
@@ -401,6 +401,42 @@ async function ensureTasklistV2Enabled(page, clusterUuid) {
401
401
  }
402
402
  }
403
403
  exports.ensureTasklistV2Enabled = ensureTasklistV2Enabled;
404
+ // Client operation logging is opt-in: a fresh cluster carries no audit-log
405
+ // config at all, which Console renders as "all user categories, no client
406
+ // categories". The MCP audit-log specs assert on CLIENT-actor PROCESS_INSTANCE
407
+ // entries, and the engine only records those when the DEPLOYED_RESOURCES client
408
+ // category is enabled.
409
+ //
410
+ // Driving the Audit log tab's checkboxes cannot set this reliably: the panel
411
+ // re-seeds its checkbox state from the cluster every time Console refreshes it
412
+ // in the background, silently dropping selections made before "Update" is
413
+ // pressed. The 2026-08-26/27 nightlies persisted only the last category clicked
414
+ // ("USER_TASKS"), so DEPLOYED_RESOURCES stayed off and every SC-AUD spec polled
415
+ // an audit log that would never receive an entry. Call the same endpoint the
416
+ // Update button calls, then read the config back until it is really persisted.
417
+ const AUDIT_LOG_CATEGORIES = ['ADMIN', 'DEPLOYED_RESOURCES', 'USER_TASKS'];
418
+ async function ensureClientAuditLoggingViaApi(page, clusterUuid) {
419
+ const orgId = getOrgId();
420
+ const url = `${getConsoleBaseUrl()}/api/orgs/${orgId}/clusters/${clusterUuid}`;
421
+ const response = await clusterApiRequest(page, 'PATCH', url, {
422
+ auditLogEnabled: true,
423
+ auditLogUserCategories: AUDIT_LOG_CATEGORIES,
424
+ auditLogClientCategories: AUDIT_LOG_CATEGORIES,
425
+ });
426
+ if (response.status() !== 200 && response.status() !== 204) {
427
+ throw new Error(`Failed to enable client audit logging on cluster "${clusterUuid}": ` +
428
+ `HTTP ${response.status()} - ${await response.text()}`);
429
+ }
430
+ await (0, test_1.expect)(async () => {
431
+ const readBack = await clusterApiRequest(page, 'GET', url);
432
+ (0, test_1.expect)(readBack.status()).toBe(200);
433
+ const body = await readBack.json();
434
+ const auditLog = (body.data ?? body)?.externalMetadata?.auditLog;
435
+ (0, test_1.expect)(auditLog?.enabled).toBe(true);
436
+ (0, test_1.expect)([...(auditLog?.clientCategories ?? [])].sort()).toEqual([...AUDIT_LOG_CATEGORIES].sort());
437
+ }).toPass({ timeout: 120000, intervals: [2000, 5000, 10000] });
438
+ }
439
+ exports.ensureClientAuditLoggingViaApi = ensureClientAuditLoggingViaApi;
404
440
  async function waitForClusterHealthyViaApi(page, clusterUuid, timeoutMs = 1500000) {
405
441
  const orgId = getOrgId();
406
442
  const url = `${getConsoleBaseUrl()}/api/orgs/${orgId}/clusters/${clusterUuid}`;
@@ -14,14 +14,13 @@ exports.deletionAssertionOptions = {
14
14
  intervals: [5000, 10000, 15000, 30000],
15
15
  timeout: 60000,
16
16
  };
17
- // Longest options for audit-log assertions: entries land in secondary storage
18
- // only after the audit config propagates to the exporters, which is markedly
19
- // slower on freshly-provisioned SaaS clusters. 90s occasionally lapsed before
20
- // the CLIENT-actor PROCESS_INSTANCE CREATE entry surfaced, then 180s did too
21
- // (every audit test in the nightly timed out on the same fresh org, including
22
- // the REST-triggered one, so nothing about the entry itself was wrong — the
23
- // pipeline simply had not started exporting yet). Poll for 360s, which still
24
- // leaves headroom inside the 12-minute test timeout after the ~60s beforeAll.
17
+ // Longest options for audit-log assertions. Measured on the nightly, a
18
+ // CLIENT-actor PROCESS_INSTANCE CREATE entry surfaces within ~10s whenever the
19
+ // cluster has the DEPLOYED_RESOURCES client category enabled — the earlier 90s
20
+ // and 180s budgets were raised against runs where that category was never
21
+ // persisted at all, so no budget could have helped. Keep a generous 360s so a
22
+ // genuinely slow export still passes; it fits inside the 12-minute test timeout
23
+ // after the ~60s beforeAll.
25
24
  exports.auditLogAssertionOptions = {
26
25
  intervals: [5000, 10000, 15000, 20000, 30000],
27
26
  timeout: 360000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1019",
3
+ "version": "0.0.1020",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",