@camunda/e2e-test-suite 0.0.815 → 0.0.816

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.
@@ -8,6 +8,7 @@ declare class ConnectorMarketplacePage {
8
8
  readonly replaceResourceButton: Locator;
9
9
  readonly addToProjectButton: Locator;
10
10
  readonly saveAsCopyButton: Locator;
11
+ readonly importModal: Locator;
11
12
  constructor(page: Page);
12
13
  clickSearchForConnectorTextbox(): Promise<void>;
13
14
  fillSearchForConnectorTextbox(connectorName: string): Promise<void>;
@@ -10,6 +10,7 @@ class ConnectorMarketplacePage {
10
10
  replaceResourceButton;
11
11
  addToProjectButton;
12
12
  saveAsCopyButton;
13
+ importModal;
13
14
  constructor(page) {
14
15
  this.page = page;
15
16
  this.searchForConnectorTextbox = page.getByPlaceholder('Search for a connector');
@@ -25,6 +26,7 @@ class ConnectorMarketplacePage {
25
26
  name: 'Add to project',
26
27
  });
27
28
  this.saveAsCopyButton = page.getByRole('button', { name: 'Save as copy' });
29
+ this.importModal = page.locator('[data-test="import-modal"]');
28
30
  }
29
31
  async clickSearchForConnectorTextbox() {
30
32
  await this.searchForConnectorTextbox.click({ timeout: 60000 });
@@ -60,26 +62,47 @@ class ConnectorMarketplacePage {
60
62
  this.replaceResourceButton,
61
63
  ];
62
64
  let imported = false;
63
- // The first probe gets a long timeout to absorb the modal's slow (~20s)
65
+ // Wait for each candidate button with waitFor(), NOT isVisible():
66
+ // isVisible() checks the current state and returns immediately, so it fires
67
+ // before the ~20s-slow modal has rendered and reports every button absent —
68
+ // the import is never confirmed and the modal is left blocking the canvas.
69
+ // The first probe gets a long timeout to absorb the modal's slow
64
70
  // appearance; once the modal is up the remaining buttons resolve at once.
65
71
  let probeTimeout = 60000;
66
72
  for (const button of importConfirmButtons) {
67
- if (await button.isVisible({ timeout: probeTimeout }).catch(() => false)) {
73
+ const buttonVisible = await button
74
+ .waitFor({ state: 'visible', timeout: probeTimeout })
75
+ .then(() => true)
76
+ .catch(() => false);
77
+ if (buttonVisible) {
68
78
  await button.click({ timeout: 30000 });
69
79
  imported = true;
70
80
  break;
71
81
  }
72
82
  probeTimeout = 5000;
73
83
  }
74
- // After a successful import, wait for the snackbar (confirms the connector
75
- // template was received by the modeler) then close the marketplace panel so
76
- // the diagram canvas is unblocked before the caller tries to select the
77
- // newly installed connector.
84
+ // After a successful import, unblock the diagram canvas before the caller
85
+ // selects the newly installed connector.
78
86
  if (imported) {
79
- await this.snackbar
80
- .waitFor({ state: 'visible', timeout: 60000 })
87
+ // Wait for the "Import resource" modal to close after confirming — while
88
+ // it is still up its subtree intercepts pointer events on the canvas and
89
+ // any downstream change-element click retries fruitlessly against it.
90
+ await this.importModal
91
+ .waitFor({ state: 'hidden', timeout: 60000 })
81
92
  .catch(() => { });
82
- if (await this.closeButton.isVisible({ timeout: 5000 }).catch(() => false)) {
93
+ // The modeler closes the marketplace panel itself once the import
94
+ // finishes, so only close it if it is somehow still open — gated on the
95
+ // marketplace's own search box. A bare getByRole('button', {name:
96
+ // 'Close'}) would otherwise match the properties panel's "Close" (×)
97
+ // button and collapse it, hiding the connector's "Input" tab the caller
98
+ // needs next. (Do not idle-wait on the snackbar here either: it never
99
+ // matches the import toast, so it only stalls ~60s, during which the
100
+ // modeler auto-collapses the properties panel.)
101
+ const marketplaceStillOpen = await this.searchForConnectorTextbox
102
+ .isVisible()
103
+ .catch(() => false);
104
+ if (marketplaceStillOpen &&
105
+ (await this.closeButton.isVisible({ timeout: 5000 }).catch(() => false))) {
83
106
  await this.closeButton.click({ timeout: 10000 });
84
107
  }
85
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.815",
3
+ "version": "0.0.816",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",