@camunda/e2e-test-suite 0.0.695 → 0.0.696

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.
@@ -12,6 +12,7 @@ declare class ConnectorMarketplacePage {
12
12
  clickDownloadToProjectButton(): Promise<void>;
13
13
  clickCancelButton(): Promise<void>;
14
14
  clickReplaceResourceButton(): Promise<void>;
15
+ searchAndDownloadConnector(connectorName: string): Promise<void>;
15
16
  downloadConnectorToProject(): Promise<void>;
16
17
  }
17
18
  export { ConnectorMarketplacePage };
@@ -38,6 +38,41 @@ class ConnectorMarketplacePage {
38
38
  async clickReplaceResourceButton() {
39
39
  await this.replaceResourceButton.click({ timeout: 30000 });
40
40
  }
41
+ async searchAndDownloadConnector(connectorName) {
42
+ // The marketplace backend is an external service that intermittently
43
+ // returns "an error occurred, please try again later" instead of the
44
+ // connector listing. Re-issue the search with an increasing backoff so a
45
+ // transient blip self-heals rather than failing the whole flow. A
46
+ // sustained outage still surfaces (the connector-dependent step downstream
47
+ // fails) rather than being masked.
48
+ const maxAttempts = 4;
49
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
50
+ await this.searchForConnectorTextbox.click({ timeout: 60000 });
51
+ await this.searchForConnectorTextbox.fill(connectorName, {
52
+ timeout: 60000,
53
+ });
54
+ // Wait for search debounce + client-side filtering to complete.
55
+ await (0, sleep_1.sleep)(5000);
56
+ const downloadOrError = this.downloadToProjectButton.or(this.marketplaceErrorLocator);
57
+ await downloadOrError
58
+ .first()
59
+ .waitFor({ state: 'visible', timeout: 30000 })
60
+ .catch(() => undefined);
61
+ if (await this.downloadToProjectButton.isVisible()) {
62
+ await this.downloadConnectorToProject();
63
+ return;
64
+ }
65
+ // Marketplace returned an error (or nothing rendered). Clear the query
66
+ // and retry after a backoff so the next search re-hits the backend.
67
+ if (attempt < maxAttempts) {
68
+ await this.searchForConnectorTextbox.fill('');
69
+ await (0, sleep_1.sleep)(2000 * attempt);
70
+ }
71
+ }
72
+ // Retries exhausted — close the dialog so the caller can proceed; the
73
+ // connector-dependent step downstream will surface a clear failure.
74
+ await this.page.keyboard.press('Escape');
75
+ }
41
76
  async downloadConnectorToProject() {
42
77
  // Race the download button against a marketplace API error so we don't
43
78
  // block the full 60 s timeout when the marketplace backend is unavailable.
@@ -176,12 +176,7 @@ async function modelIntermediateWebhookConnector(modelerCreatePage, connectorMar
176
176
  ]);
177
177
  if (result == 'marketPlaceButton') {
178
178
  await modelerCreatePage.clickMarketPlaceButton();
179
- await connectorMarketplacePage.clickSearchForConnectorTextbox();
180
- await connectorMarketplacePage.fillSearchForConnectorTextbox('Webhook Connector');
181
- await (0, test_1.expect)(connectorMarketplacePage.downloadToProjectButton).toBeVisible({
182
- timeout: 30000,
183
- });
184
- await connectorMarketplacePage.downloadConnectorToProject();
179
+ await connectorMarketplacePage.searchAndDownloadConnector('Webhook Connector');
185
180
  await modelerCreatePage.clickChangeTypeButton();
186
181
  }
187
182
  await modelerCreatePage.clickIntermediateWebhookConnectorOption();
@@ -224,12 +219,7 @@ async function modelWebhookConnector(modelerCreatePage, connectorMarketplacePage
224
219
  ]);
225
220
  if (result == 'marketPlaceButton') {
226
221
  await modelerCreatePage.clickMarketPlaceButton();
227
- await connectorMarketplacePage.clickSearchForConnectorTextbox();
228
- await connectorMarketplacePage.fillSearchForConnectorTextbox('Webhook Connector');
229
- await (0, test_1.expect)(connectorMarketplacePage.downloadToProjectButton).toBeVisible({
230
- timeout: 30000,
231
- });
232
- await connectorMarketplacePage.downloadConnectorToProject();
222
+ await connectorMarketplacePage.searchAndDownloadConnector('Webhook Connector');
233
223
  }
234
224
  await modelerCreatePage.clickWebhookStartEventConnectorOption();
235
225
  await modelerCreatePage.clickWebhookIdInput();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.695",
3
+ "version": "0.0.696",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",