@camunda/e2e-test-suite 0.0.1297 → 0.0.1299

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.
@@ -83,7 +83,8 @@ declare class ClusterPage {
83
83
  */
84
84
  private pruneDuplicateClusters;
85
85
  createClusterIfNotExists(clusterName: string, region?: string): Promise<void>;
86
- assertClusterHealthyStatusWithRetry(name: string, visibilityTimeout?: number, totalTimeout?: number): Promise<void>;
86
+ private isSessionLost;
87
+ assertClusterHealthyStatusWithRetry(name: string, visibilityTimeout?: number, totalTimeout?: number, recoverSession?: () => Promise<void>): Promise<void>;
87
88
  clickAlphaTab(): Promise<void>;
88
89
  clickDevTab(): Promise<void>;
89
90
  clickStableTab(): Promise<void>;
@@ -496,7 +496,15 @@ class ClusterPage {
496
496
  console.log(`${clusterName} exists but is not Healthy yet; waiting for it to come up.`);
497
497
  await this.assertClusterHealthyStatusWithRetry(clusterName, 120000, 600000);
498
498
  }
499
- async assertClusterHealthyStatusWithRetry(name, visibilityTimeout = 100000, totalTimeout = 500000) {
499
+ isSessionLost() {
500
+ try {
501
+ return /^(weblogin|login|auth)\./.test(new URL(this.page.url()).host);
502
+ }
503
+ catch {
504
+ return false;
505
+ }
506
+ }
507
+ async assertClusterHealthyStatusWithRetry(name, visibilityTimeout = 100000, totalTimeout = 500000, recoverSession) {
500
508
  const unhealthy = this.clusterRow(name).getByText('Unhealthy', {
501
509
  exact: true,
502
510
  });
@@ -540,7 +548,14 @@ class ClusterPage {
540
548
  while (Date.now() - start < totalTimeout) {
541
549
  attempt++;
542
550
  try {
543
- await this.page.reload();
551
+ // Once the Console session drops the tab sits on the identity
552
+ // provider's login form, and reloading only re-renders it.
553
+ if (recoverSession && this.isSessionLost()) {
554
+ await recoverSession();
555
+ }
556
+ else {
557
+ await this.page.reload();
558
+ }
544
559
  await (0, test_1.expect)(this.clusterRow(name)).toBeVisible({ timeout: 10000 });
545
560
  // Only treat Unhealthy as terminal once it has persisted for
546
561
  // `unhealthyConfirmMs`. A cluster mid-provisioning can flash through
@@ -38,6 +38,7 @@ export declare function runMultipleProcesses(clusterName: string, page: Page, mo
38
38
  processName?: string;
39
39
  uploadFromFile?: string;
40
40
  }): Promise<void>;
41
+ export declare function consoleSessionRecovery(page: Page, clusterUrl: string): () => Promise<void>;
41
42
  export declare function goBackWithRetry(page: Page, maxRetries?: number): Promise<void>;
42
43
  export declare function disableRBA(clusterName: string, homePage: HomePage, clusterPage: ClusterPage, clusterDetailsPage: ClusterDetailsPage, appsPage: AppsPage): Promise<void>;
43
44
  export declare function enableAuthorizations(clusterName: string, homePage: HomePage, clusterPage: ClusterPage, clusterDetailsPage: ClusterDetailsPage, appsPage: AppsPage): 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.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.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");
@@ -661,6 +661,7 @@ function consoleSessionRecovery(page, clusterUrl) {
661
661
  });
662
662
  };
663
663
  }
664
+ exports.consoleSessionRecovery = consoleSessionRecovery;
664
665
  // `page.goBack()` rejects with `net::ERR_ABORTED` when the page it returns to
665
666
  // immediately issues a navigation of its own (Console re-runs its auth
666
667
  // redirect on entry): the history entry is superseded, not failed, and the
@@ -779,11 +779,21 @@ class ModelerHomePage {
779
779
  // non-elevated users (their list is membership-scoped anyway), so a missing
780
780
  // control is a no-op. Ported from pages/8.10/ModelerHomePage.ts (#3710).
781
781
  async showAllWorkspaces(probeTimeout) {
782
+ const switchButton = this.page.getByRole('button', {
783
+ name: 'Switch to All workspaces',
784
+ });
782
785
  const scopeFilter = this.page.getByRole('combobox', {
783
786
  name: 'Filter workspaces',
784
787
  });
785
- if (!(await this.becameVisible(scopeFilter, probeTimeout)))
788
+ if (!(await this.becameVisible(switchButton.or(scopeFilter).first(), probeTimeout)))
789
+ return;
790
+ // The empty state's own button avoids the Radix dropdown, whose option can
791
+ // stay "not stable" for the whole click timeout.
792
+ if (await switchButton.isVisible().catch(() => false)) {
793
+ await switchButton.click({ timeout: 10000 });
794
+ await (0, test_1.expect)(switchButton).toBeHidden({ timeout: 10000 });
786
795
  return;
796
+ }
787
797
  if ((await scopeFilter.innerText()).includes('All workspaces'))
788
798
  return;
789
799
  await scopeFilter.click({ timeout: 10000 });
@@ -46,7 +46,7 @@ _8_10_1.test.describe('Cluster Setup Tests', () => {
46
46
  await homePage.clickClusters();
47
47
  }
48
48
  await clusterPage.clickClusterLink(clusterName);
49
- await clusterDetailsPage.assertComponentsHealth();
49
+ await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
50
50
  // API-client creation is needed whenever this run will also exercise the
51
51
  // full-suite pass: many of those specs call the Zeebe REST API directly
52
52
  // and need CAMUNDA_OPTIMIZE_BASE_URL for Optimize session login, even
@@ -99,7 +99,7 @@ _8_10_1.test.describe('Cluster Setup Tests', () => {
99
99
  await (0, consoleApiHelpers_1.waitForClusterHealthyViaApi)(page, clusterUuid, 1500000);
100
100
  await homePage.clickClusters();
101
101
  await clusterPage.clickClusterLink(clusterName);
102
- await clusterDetailsPage.assertComponentsHealth();
102
+ await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
103
103
  // Must happen before the MCP toggle: the restart that toggle triggers is
104
104
  // what makes the new audit-log configuration live on the cluster.
105
105
  await (0, consoleApiHelpers_1.ensureClientAuditLoggingViaApi)(page, clusterUuid);
@@ -111,7 +111,7 @@ _8_10_1.test.describe('Cluster Setup Tests', () => {
111
111
  // abort on the transient Unhealthy state during the restart.
112
112
  await (0, consoleApiHelpers_1.waitForClusterRestartHealthyViaApi)(page, clusterUuid, 1500000);
113
113
  await homePage.clickClusters();
114
- await clusterPage.assertClusterHealthyStatusWithRetry(clusterName);
114
+ await clusterPage.assertClusterHealthyStatusWithRetry(clusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
115
115
  await clusterPage.clickClusterLink(clusterName);
116
116
  await clusterDetailsPage.clickAPITab();
117
117
  const agenticCredentials = await clusterDetailsPage.createAPIClientAndReturnVariables(apiClientName, true, 'agentic_cluster');
@@ -142,7 +142,7 @@ _8_10_1.test.describe('Cluster Setup Tests', () => {
142
142
  await homePage.clickClusters();
143
143
  }
144
144
  await clusterPage.clickClusterLink(clusterName);
145
- await clusterDetailsPage.assertComponentsHealth();
145
+ await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
146
146
  if (process.env.IS_AG !== 'true') {
147
147
  await clusterPage.clickConnectorSecretsTab(clusterName);
148
148
  await clusterSecretsPage.createSetOfSecrets(clusterName, connectorSecrets_1.connectorSecretsValues);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1297",
3
+ "version": "0.0.1299",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",