@camunda/e2e-test-suite 0.0.659 → 0.0.661

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.
@@ -4,6 +4,7 @@ exports.OperateProcessInstancePage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("../../utils/sleep");
6
6
  const constants_1 = require("../../utils/constants");
7
+ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
7
8
  class OperateProcessInstancePage {
8
9
  page;
9
10
  diagram;
@@ -236,10 +237,21 @@ class OperateProcessInstancePage {
236
237
  }
237
238
  async assertBusinessIdVisible(businessId) {
238
239
  const instanceHeader = this.page.getByTestId('instance-header');
239
- await (0, test_1.expect)(instanceHeader.getByText('Business ID')).toBeVisible({
240
- timeout: 60000,
240
+ const reload = async () => {
241
+ await this.page.reload();
242
+ };
243
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, instanceHeader.getByText('Business ID'), {
244
+ totalTimeout: 60000,
245
+ visibilityTimeout: 10000,
246
+ maxRetries: 5,
247
+ postAction: reload,
248
+ });
249
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, instanceHeader.getByText(businessId, { exact: true }), {
250
+ totalTimeout: 60000,
251
+ visibilityTimeout: 10000,
252
+ maxRetries: 5,
253
+ postAction: reload,
241
254
  });
242
- await (0, test_1.expect)(instanceHeader.getByText(businessId, { exact: true })).toBeVisible({ timeout: 60000 });
243
255
  }
244
256
  async assertVariablesListVisible(timeout = 30000) {
245
257
  const startTime = Date.now();
@@ -23,7 +23,7 @@ class OptimizeCollectionsPage {
23
23
  this.modalCloseButton = page.getByText('Close', { exact: true });
24
24
  this.processReport = page.getByText('Process Report').first();
25
25
  this.collectionsLink = page.getByRole('link', { name: 'Collections' });
26
- this.reportAuthor = page.getByRole('cell', { name: 'Demo User' });
26
+ this.reportAuthor = page.getByRole('cell', { name: 'Demo User' }).first();
27
27
  }
28
28
  async clickCreateNewButton() {
29
29
  if (await this.modalCloseButton.isVisible({ timeout: 2000 })) {
@@ -12,5 +12,6 @@ declare class ConnectorMarketplacePage {
12
12
  clickCancelButton(): Promise<void>;
13
13
  clickReplaceResourceButton(): Promise<void>;
14
14
  downloadConnectorToProject(): Promise<void>;
15
+ searchAndDownloadConnector(connectorName: string, maxRetries?: number): Promise<void>;
15
16
  }
16
17
  export { ConnectorMarketplacePage };
@@ -48,5 +48,33 @@ class ConnectorMarketplacePage {
48
48
  return;
49
49
  }
50
50
  }
51
+ // The marketplace search backend can transiently return HTTP 504
52
+ // ("upstream request timeout"), which leaves the modal in an error or
53
+ // "We couldn't find a match" state with no "Download to project" button.
54
+ // Re-issue the search (clearing the field first) until the button appears,
55
+ // so a single slow search response doesn't fail the whole flow.
56
+ async searchAndDownloadConnector(connectorName, maxRetries = 4) {
57
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
58
+ await this.clickSearchForConnectorTextbox();
59
+ await this.searchForConnectorTextbox.fill('', { timeout: 60000 });
60
+ await this.fillSearchForConnectorTextbox(connectorName);
61
+ try {
62
+ await this.downloadToProjectButton.waitFor({
63
+ state: 'visible',
64
+ timeout: 30000,
65
+ });
66
+ await this.downloadConnectorToProject();
67
+ return;
68
+ }
69
+ catch (e) {
70
+ if (attempt === maxRetries - 1) {
71
+ throw new Error(`Connector "${connectorName}" did not appear in the marketplace ` +
72
+ `after ${maxRetries} search attempts; the marketplace search ` +
73
+ `API may be returning errors (e.g. HTTP 504).`);
74
+ }
75
+ await (0, sleep_1.sleep)(5000);
76
+ }
77
+ }
78
+ }
51
79
  }
52
80
  exports.ConnectorMarketplacePage = ConnectorMarketplacePage;
@@ -608,9 +608,12 @@ class ModelerCreatePage {
608
608
  // slice until the list is filtered. Type into the popup search box (the
609
609
  // same `.djs-popup-search input` selector the bpmn-js/hub e2e tests use)
610
610
  // so the REST Outbound Connector entry is rendered before asserting on it.
611
- if (await this.changeElementSearchInput.isVisible()) {
612
- await this.changeElementSearchInput.fill('REST Outbound');
613
- }
611
+ // Wait for the search input to render before filling: a bare isVisible()
612
+ // check races the popup re-render on retries and silently skips the fill,
613
+ // leaving the list unfiltered so the off-screen connector entry never
614
+ // becomes visible and the assertion below times out.
615
+ await (0, test_1.expect)(this.changeElementSearchInput).toBeVisible({ timeout: 30000 });
616
+ await this.changeElementSearchInput.fill('REST Outbound');
614
617
  await (0, test_1.expect)(this.restConnectorOption).toBeVisible({ timeout: 90000 });
615
618
  await this.restConnectorOption.click({ timeout: 90000 });
616
619
  }
@@ -179,10 +179,7 @@ async function modelRestConnector(modelerCreatePage, connectorSettingsPage, conn
179
179
  }
180
180
  catch (error) {
181
181
  await modelerCreatePage.clickMarketPlaceButton();
182
- await connectorMarketplacePage.clickSearchForConnectorTextbox();
183
- await connectorMarketplacePage.fillSearchForConnectorTextbox('REST Connector');
184
- await (0, sleep_1.sleep)(10000);
185
- await connectorMarketplacePage.downloadConnectorToProject();
182
+ await connectorMarketplacePage.searchAndDownloadConnector('REST Connector');
186
183
  // Marketplace closes the change-type panel; reopen it so the
187
184
  // newly installed connector appears in the list.
188
185
  await modelerCreatePage.clickChangeTypeButton();
@@ -62,6 +62,7 @@ if (process.env.IS_MIGRATION === 'true') {
62
62
  await SM_8_10_1.test.step('View Report in Optimize', async () => {
63
63
  await navigationPage.goToOptimize();
64
64
  await optimizeHomePage.clickCollectionsLink();
65
+ await optimizeReportPage.waitUntilLocatorIsVisible(optimizeCollectionsPage.reportAuthor, page);
65
66
  await (0, test_1.expect)(optimizeCollectionsPage.reportAuthor).toBeVisible({
66
67
  timeout: 60000,
67
68
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.659",
3
+ "version": "0.0.661",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",