@camunda/e2e-test-suite 0.0.1556 → 0.0.1557

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.
@@ -5,6 +5,7 @@ declare class ConnectorMarketplacePage {
5
5
  readonly downloadToProjectButton: Locator;
6
6
  readonly replaceResourceButton: Locator;
7
7
  readonly addToProjectButton: Locator;
8
+ readonly saveAsCopyButton: Locator;
8
9
  readonly cancelButton: Locator;
9
10
  readonly backToMarketplaceButton: Locator;
10
11
  readonly downloadErrorMessage: Locator;
@@ -8,6 +8,7 @@ class ConnectorMarketplacePage {
8
8
  downloadToProjectButton;
9
9
  replaceResourceButton;
10
10
  addToProjectButton;
11
+ saveAsCopyButton;
11
12
  cancelButton;
12
13
  backToMarketplaceButton;
13
14
  downloadErrorMessage;
@@ -24,6 +25,7 @@ class ConnectorMarketplacePage {
24
25
  this.addToProjectButton = page.getByRole('button', {
25
26
  name: 'Add to project',
26
27
  });
28
+ this.saveAsCopyButton = page.getByRole('button', { name: 'Save as copy' });
27
29
  this.backToMarketplaceButton = page.getByRole('button', {
28
30
  name: 'Back to Marketplace',
29
31
  });
@@ -47,27 +49,43 @@ class ConnectorMarketplacePage {
47
49
  async clickReplaceResourceButton() {
48
50
  await this.replaceResourceButton.click({ timeout: 30000 });
49
51
  }
50
- // The import dialog confirms with either "Add to project" (the resource is new
51
- // to the project) or "Replace resource" (a file with the same name already
52
- // exists); on a backend failure it renders a download-error panel with neither
53
- // button. Probe which one rendered and click only that one - issuing both
52
+ // The import dialog confirms with "Add to project" (the resource is new to
53
+ // the project), "Replace resource" (a file with the same name already
54
+ // exists) or "Save as copy" (the templates' IDs already exist in the project,
55
+ // e.g. the Webhook bundle that imports 3 templates at once); on a backend
56
+ // failure it renders a download-error panel with none of them. Hub can also
57
+ // import without asking at all: the marketplace modal just closes. Probe
58
+ // which outcome rendered and click only the matching button - issuing both
54
59
  // clicks through Promise.race also fired the Cancel click, so the import was
55
60
  // abandoned and the connector template never landed in the project.
56
- // Resolves true only when a confirm button was actually clicked, so callers
57
- // can tell a completed import from a swallowed download error.
61
+ // Resolves true only when the import completed, so callers can tell it from
62
+ // a swallowed download error.
58
63
  async downloadConnectorToProject() {
59
64
  await this.clickDownloadToProjectButton();
60
- const importConfirmButton = this.addToProjectButton.or(this.replaceResourceButton);
65
+ const importConfirmButton = this.addToProjectButton
66
+ .or(this.replaceResourceButton)
67
+ .or(this.saveAsCopyButton);
61
68
  const settled = await importConfirmButton
62
69
  .or(this.downloadErrorMessage)
63
70
  .first()
64
71
  .waitFor({ state: 'visible', timeout: 20000 })
65
72
  .then(() => true)
66
73
  .catch(() => false);
67
- if (!settled || !(await importConfirmButton.first().isVisible())) {
74
+ if (!settled) {
75
+ // Neither a confirmation nor an error: if the marketplace modal has
76
+ // closed, Hub imported the resource directly. Let the template write
77
+ // settle so a caller's reload does not abort it.
78
+ if (!(await this.searchForConnectorTextbox.isVisible())) {
79
+ await this.page.waitForLoadState('networkidle').catch(() => { });
80
+ return true;
81
+ }
82
+ return false;
83
+ }
84
+ if (!(await importConfirmButton.first().isVisible())) {
68
85
  return false;
69
86
  }
70
87
  await importConfirmButton.first().click({ timeout: 30000 });
88
+ await this.page.waitForLoadState('networkidle').catch(() => { });
71
89
  return true;
72
90
  }
73
91
  // The marketplace backend transiently fails in two ways: the search returns an
@@ -80,6 +98,12 @@ class ConnectorMarketplacePage {
80
98
  if (await this.backToMarketplaceButton.isVisible()) {
81
99
  await this.backToMarketplaceButton.click({ timeout: 30000 });
82
100
  }
101
+ // A failed attempt can leave the import dialog open on top of the
102
+ // marketplace search; dismiss it so the search box is reachable again.
103
+ if (!(await this.searchForConnectorTextbox.isVisible()) &&
104
+ (await this.cancelButton.first().isVisible())) {
105
+ await this.cancelButton.first().click({ timeout: 30000 });
106
+ }
83
107
  await this.clickSearchForConnectorTextbox();
84
108
  await this.searchForConnectorTextbox.fill('', { timeout: 60000 });
85
109
  await this.fillSearchForConnectorTextbox(connectorName);
@@ -192,9 +192,9 @@ class ModelerCreatePage {
192
192
  .locator('path');
193
193
  this.canvas = page.locator('rect').nth(1);
194
194
  this.intermediateBoundaryEvent = page.getByTitle('Append intermediate/boundary');
195
- this.intermediateWebhookConnectorOption = page.getByRole('listitem', {
196
- name: 'Webhook Intermediate Event Connector',
197
- });
195
+ this.intermediateWebhookConnectorOption = page
196
+ .locator('.djs-popup-results')
197
+ .locator('[data-id="replace.template-io.camunda.connectors.webhook.WebhookConnectorIntermediate.v1"]');
198
198
  this.correlationKeyPayloadInput = page.getByLabel('Correlation key (payload)');
199
199
  this.correlationKeyProcessInput = page.getByLabel('Correlation key (process)');
200
200
  // Modeler renamed the third mode tab "Play" -> "Test" (camunda-hub
@@ -24,6 +24,7 @@ declare class ModelerHomePage {
24
24
  readonly messageBanner: Locator;
25
25
  readonly closeButton: Locator;
26
26
  readonly modalCloseButton: Locator;
27
+ readonly projectNotFoundMessage: Locator;
27
28
  readonly idpTemplateOption: Locator;
28
29
  readonly idpApplicationNameInput: Locator;
29
30
  readonly dialog: Locator;
@@ -31,6 +31,7 @@ class ModelerHomePage {
31
31
  messageBanner;
32
32
  closeButton;
33
33
  modalCloseButton;
34
+ projectNotFoundMessage;
34
35
  idpTemplateOption;
35
36
  idpApplicationNameInput;
36
37
  dialog;
@@ -63,6 +64,7 @@ class ModelerHomePage {
63
64
  })
64
65
  .first();
65
66
  this.homeBreadcrumb = page.locator('[data-test="breadcrumb-home"]');
67
+ this.projectNotFoundMessage = page.getByText('Project not found!');
66
68
  this.formNameInput = page.locator('[data-test="editable-input"]');
67
69
  this.rows = page.getByRole('row');
68
70
  this.licenseKeyTagNonProduction = page
@@ -174,6 +176,19 @@ class ModelerHomePage {
174
176
  .then(() => this.modalCloseButton.click())
175
177
  .catch(() => { });
176
178
  await this.crossComponentProjectFolder.click();
179
+ // Under parallel load the project page can transiently render
180
+ // "Project not found!" for a project that exists (the retry of the
181
+ // same test opens it fine). Wait for the project page to settle and
182
+ // treat that state as a failed attempt instead of returning, so the
183
+ // caller does not wait out its timeout on a page with no project.
184
+ await this.diagramTypeDropdown
185
+ .or(this.projectNotFoundMessage)
186
+ .first()
187
+ .waitFor({ state: 'visible', timeout })
188
+ .catch(() => { });
189
+ if (await this.projectNotFoundMessage.isVisible()) {
190
+ throw new Error('Cross Component Test Project page: not found');
191
+ }
177
192
  await this.clickMessageBanner();
178
193
  return;
179
194
  }
@@ -181,6 +196,11 @@ class ModelerHomePage {
181
196
  attempts++;
182
197
  if (attempts < maxAttempts) {
183
198
  console.log(`Attempt ${attempts} failed. Reloading page and retrying...`);
199
+ // Reloading the "Project not found" URL keeps us off the projects
200
+ // list, so go back Home before looking for the folder again.
201
+ if (await this.projectNotFoundMessage.isVisible()) {
202
+ await this.clickHomeBreadcrumb();
203
+ }
184
204
  await this.page.reload();
185
205
  await (0, sleep_1.sleep)(10000);
186
206
  // A reload can bounce the Modeler SPA back to the Identity login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1556",
3
+ "version": "0.0.1557",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",