@camunda/e2e-test-suite 0.0.1337 → 0.0.1338

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.
@@ -545,10 +545,28 @@ class ModelerCreatePage {
545
545
  }
546
546
  async deployDiagram(clusterName) {
547
547
  await this.processApplicationPage.ensureStageCluster(clusterName);
548
- await this.clickDeployButtonWithRetry();
549
- await (0, test_1.expect)(this.deployDiagramDialog).toBeVisible({
550
- timeout: 30000,
551
- });
548
+ // ensureStageCluster navigates back to the diagram, whose toolbar can
549
+ // take ~50s to boot. A Deploy click that lands before Hub has wired it up
550
+ // registers but never opens the dialog, and the old single check then
551
+ // failed the test outright. Reopen from a fresh page instead.
552
+ const maxOpenAttempts = 3;
553
+ for (let attempt = 1; attempt <= maxOpenAttempts; attempt++) {
554
+ await this.clickDeployButtonWithRetry();
555
+ const opened = await this.deployDiagramDialog
556
+ .waitFor({ state: 'visible', timeout: 30000 })
557
+ .then(() => true)
558
+ .catch(() => false);
559
+ if (opened) {
560
+ break;
561
+ }
562
+ if (attempt === maxOpenAttempts) {
563
+ await (0, test_1.expect)(this.deployDiagramDialog).toBeVisible({ timeout: 30000 });
564
+ }
565
+ console.warn(`Deploy dialog did not open (attempt ${attempt}/${maxOpenAttempts}); reloading.`);
566
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
567
+ await (0, sessionRecovery_1.recoverStuckModelerLogin)(this.page);
568
+ await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page);
569
+ }
552
570
  // Hub's environment-based deploy dialog (camunda-hub#29210) lists the
553
571
  // Environments assigned to the workspace as a role="radiogroup" under
554
572
  // #environment-selection-heading, one row per
@@ -636,10 +654,15 @@ class ModelerCreatePage {
636
654
  // the same session loss utils/sessionRecovery.ts already recovers
637
655
  // from elsewhere. One retry after recovering; any other cause
638
656
  // rethrows unchanged.
657
+ if (attempt === 1) {
658
+ throw error;
659
+ }
639
660
  const recovered = await (0, sessionRecovery_1.recoverStuckModelerLogin)(this.page);
640
661
  const restored = await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page);
641
- if ((!recovered && !restored) || attempt === 1) {
642
- throw error;
662
+ // A diagram whose toolbar never booted with the session intact still
663
+ // gets one fresh load, as clickDeployButtonWithRetry already does.
664
+ if (!recovered && !restored) {
665
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
643
666
  }
644
667
  }
645
668
  }
@@ -1734,6 +1757,17 @@ class ModelerCreatePage {
1734
1757
  }
1735
1758
  async selectCluster(clusterName, healthCheckTimeout = 30000) {
1736
1759
  await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 30000 });
1760
+ // The dialog is visible well before its environment / cluster list has
1761
+ // loaded. On a slow Hub that list outlasted the 10s + 30s windows below,
1762
+ // so a cluster that was bound all along was reported as not offered.
1763
+ // Let any of the dialog's content variants render before branching.
1764
+ await this.dialog
1765
+ .locator('[data-test^="environment-row-"]')
1766
+ .or(this.dialog.getByText('Clusters not configured for stages'))
1767
+ .or(this.dialog.getByText(clusterName, { exact: false }))
1768
+ .first()
1769
+ .waitFor({ state: 'visible', timeout: 60000 })
1770
+ .catch(() => false);
1737
1771
  // Inside a process application the deploy dialog renders
1738
1772
  // ProcessAppClusterSelection, not the per-deploy ClusterSelection toggle
1739
1773
  // list: it shows only clusters assigned to one of the application's stages
@@ -482,6 +482,9 @@ class ModelerHomePage {
482
482
  const rootLoaded = await this.becameVisible(button.or(this.diagramTypeDropdown).first(), 60000);
483
483
  if (!rootLoaded) {
484
484
  await this.page.reload();
485
+ // The 5s probes below assume one branch has already rendered, which
486
+ // is not yet true straight after a reload.
487
+ await this.becameVisible(button.or(this.diagramTypeDropdown).first(), 90000);
485
488
  }
486
489
  // Short: the joint probe above already settled which branch rendered, and
487
490
  // hub renders exactly one of them (EntityTable renders the toolbar's create
@@ -609,6 +612,16 @@ class ModelerHomePage {
609
612
  }
610
613
  await this.clickMessageBanner();
611
614
  },
615
+ // The workspace list can take over a minute to render (see
616
+ // createCrossComponentProjectFolder), which outlasted the default 3 x
617
+ // 10s window. Give each attempt longer and reload between attempts so
618
+ // a list that stalled while loading gets fetched again.
619
+ totalTimeout: 180000,
620
+ visibilityTimeout: 45000,
621
+ postAction: async () => {
622
+ await this.page.reload();
623
+ await this.dismissOverlays();
624
+ },
612
625
  });
613
626
  }
614
627
  // Drives Camunda Hub's workspace-creation wizard. The name is entered on
@@ -185,7 +185,11 @@ class ProcessApplicationPage {
185
185
  await this.nameInput.click({ timeout: 30000 });
186
186
  await this.nameInput.fill(name);
187
187
  await (0, test_1.expect)(this.nameInput).toHaveValue(name, { timeout: 10000 });
188
- await (0, submitModalWithRetry_1.submitModalWithRetry)(this.submitButton, this.creationDialog);
188
+ // A slow Hub took longer than the default 20s per submit to create the
189
+ // application and close the dialog.
190
+ await (0, submitModalWithRetry_1.submitModalWithRetry)(this.submitButton, this.creationDialog, {
191
+ closeTimeout: 60000,
192
+ });
189
193
  await this.waitForProcessApplication();
190
194
  return;
191
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1337",
3
+ "version": "0.0.1338",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",