@camunda/e2e-test-suite 0.0.1557 → 0.0.1559

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.
@@ -189,11 +189,6 @@ async function modelRestConnector(modelerCreatePage, connectorSettingsPage, conn
189
189
  }
190
190
  await modelerCreatePage.clickAppendElementButton();
191
191
  await modelerCreatePage.clickAppendTaskButton();
192
- // The REST connector template requires engines.camunda ^8.10 (since connector v15).
193
- // New diagrams default to "Check problems against: Camunda 8.9", which moves the
194
- // connector into the "Requires newer Camunda version" section where clicking it
195
- // has no effect. Set the diagram version to 8.10 before opening the picker.
196
- await modelerCreatePage.setEngineVersion('8.10');
197
192
  await modelerCreatePage.clickChangeTypeButton();
198
193
  try {
199
194
  // The change-element popup virtualizes its list: connector templates render
@@ -6,6 +6,7 @@ declare class ConnectorTemplatePage {
6
6
  constructor(page: Page);
7
7
  clickPublishToOrgButton(): Promise<void>;
8
8
  clickPublishButton(): Promise<void>;
9
+ publishToProject(): Promise<void>;
9
10
  publishConnector(): Promise<void>;
10
11
  }
11
12
  export { ConnectorTemplatePage };
@@ -20,6 +20,50 @@ class ConnectorTemplatePage {
20
20
  async clickPublishButton() {
21
21
  await this.publishButton.click({ timeout: 90000 });
22
22
  }
23
+ // The control depends on whether the template was ever published: a template
24
+ // that never was has a single "Publish to project" button, while one that
25
+ // already was has a "Publish" dropdown holding "Publish to project" and
26
+ // "Publish to organization". The dropdown items only exist once it is open.
27
+ async publishToProject() {
28
+ const directButton = this.page.getByRole('button', {
29
+ name: 'Publish to project',
30
+ exact: true,
31
+ });
32
+ await directButton
33
+ .or(this.publishButton)
34
+ .first()
35
+ .waitFor({ state: 'visible', timeout: 90000 });
36
+ if (await directButton.isVisible()) {
37
+ await directButton.click({ timeout: 30000 });
38
+ }
39
+ else {
40
+ await this.publishButton.click({ timeout: 30000 });
41
+ await this.page
42
+ .getByRole('menuitem', { name: 'Publish to project', exact: true })
43
+ .click({ timeout: 30000 });
44
+ }
45
+ const dialog = this.page.getByRole('dialog');
46
+ await dialog.waitFor({ state: 'visible', timeout: 30000 });
47
+ // The version field is prefilled with the template's own version. When that
48
+ // version is already published, the form rejects it, so there is nothing
49
+ // left to publish.
50
+ const alreadyPublished = await dialog
51
+ .getByText(/Enter a version number greater than/)
52
+ .waitFor({ state: 'visible', timeout: 5000 })
53
+ .then(() => true)
54
+ .catch(() => false);
55
+ if (alreadyPublished) {
56
+ await dialog
57
+ .getByRole('button', { name: 'Cancel', exact: true })
58
+ .click({ timeout: 30000 });
59
+ await (0, test_1.expect)(dialog).toBeHidden({ timeout: 30000 });
60
+ return;
61
+ }
62
+ await dialog
63
+ .getByRole('button', { name: 'Publish', exact: true })
64
+ .click({ timeout: 30000 });
65
+ await (0, test_1.expect)(dialog).toBeHidden({ timeout: 60000 });
66
+ }
23
67
  async publishConnector() {
24
68
  try {
25
69
  await (0, test_1.expect)(this.publishToOrgButton).toBeVisible({ timeout: 15000 });
@@ -139,6 +139,7 @@ declare class ModelerCreatePage {
139
139
  clickDeploySubButton(): Promise<void>;
140
140
  clickCancelButton(): Promise<void>;
141
141
  private recoverModelerSession;
142
+ searchChangeElementList(searchTerm: string): Promise<void>;
142
143
  clickRestConnectorOption(recoverSession?: () => Promise<void>): Promise<void>;
143
144
  clickMarketPlaceButton(): Promise<void>;
144
145
  completeDeploymentEndpointConfiguration(): Promise<void>;
@@ -671,11 +671,24 @@ class ModelerCreatePage {
671
671
  });
672
672
  await (0, test_1.expect)(this.secondElement).toBeVisible({ timeout: 60000 });
673
673
  }
674
+ // The change-element popup virtualizes its list: connector templates render
675
+ // below the built-in tasks and are not in the DOM until the list is filtered.
676
+ // Use pressSequentially (not fill): fill sets the value in one shot and the
677
+ // single input event can land before bpmn-js attaches its search handler.
678
+ async searchChangeElementList(searchTerm) {
679
+ await (0, test_1.expect)(this.changeElementSearchInput).toBeVisible({ timeout: 30000 });
680
+ await this.changeElementSearchInput.click();
681
+ await this.changeElementSearchInput.fill('');
682
+ await this.changeElementSearchInput.pressSequentially(searchTerm, {
683
+ delay: 50,
684
+ });
685
+ }
674
686
  async clickRestConnectorOption(recoverSession) {
675
687
  const maxRetries = 4;
676
688
  for (let retries = 0; retries < maxRetries; retries++) {
677
689
  try {
678
690
  if (retries === 0) {
691
+ await this.searchChangeElementList('REST Outbound');
679
692
  await (0, test_1.expect)(this.restConnectorOption).toBeVisible({ timeout: 60000 });
680
693
  await this.restConnectorOption.scrollIntoViewIfNeeded();
681
694
  await this.restConnectorOption.click({ timeout: 60000, force: true });
@@ -685,6 +698,7 @@ class ModelerCreatePage {
685
698
  await this.recoverModelerSession(recoverSession);
686
699
  await this.secondElement.click({ force: true, timeout: 60000 });
687
700
  await this.changeTypeButton.click({ force: true, timeout: 60000 });
701
+ await this.searchChangeElementList('REST Outbound');
688
702
  await (0, test_1.expect)(this.restConnectorOption).toBeVisible({ timeout: 90000 });
689
703
  await this.restConnectorOption.scrollIntoViewIfNeeded();
690
704
  await this.restConnectorOption.click({ timeout: 90000, force: true });
@@ -112,6 +112,54 @@ async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskN
112
112
  throw new Error(`Completion of task ${taskName} failed after ${attempt} attempts (${TOTAL_TIMEOUT_MS / 1000}s timeout)`);
113
113
  }
114
114
  exports.completeTaskWithRetry = completeTaskWithRetry;
115
+ const REST_CONNECTOR_TEMPLATE_NAME = 'REST Outbound Connector';
116
+ // Web Modeler lists an uploaded template by its file name, not its `name`.
117
+ const REST_CONNECTOR_TEMPLATE_RESOURCE = 'http-json-connector-12';
118
+ // The Marketplace serves only `latest`, which is an 8.10-only template (see
119
+ // camunda/connectors#9966). v12 is the newest REST template whose engine
120
+ // constraint (^8.3) an 8.8 Web Modeler satisfies.
121
+ const REST_CONNECTOR_TEMPLATE_V12_URL = 'https://raw.githubusercontent.com/camunda/connectors/e0977665e7e64ac786a51b34106a3581a24f92ed/connectors/http/rest/element-templates/versioned/http-json-connector-12.json';
122
+ // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
123
+ // Workaround so the REST connector template is imported correctly: the
124
+ // Marketplace only serves `latest`, which an 8.8 Web Modeler cannot import.
125
+ // Remove this function once the bug is solved.
126
+ async function uploadRestConnectorTemplate(page, modelerHomePage) {
127
+ // Wait for the project list to render before counting, or a not-yet-loaded
128
+ // list reads as "template missing" and the file is uploaded again.
129
+ await (0, test_1.expect)(modelerHomePage.rows.filter({ hasText: 'BPMN diagram' }).first()).toBeVisible({ timeout: 60000 });
130
+ // The project list is paginated, so a template uploaded by an earlier run can
131
+ // sit past the first page. Filter the whole project instead of counting rows.
132
+ const filterInput = page.getByPlaceholder('Filter table');
133
+ await filterInput.fill(REST_CONNECTOR_TEMPLATE_RESOURCE);
134
+ const templateRow = modelerHomePage.rows.filter({
135
+ hasText: REST_CONNECTOR_TEMPLATE_RESOURCE,
136
+ });
137
+ const alreadyUploaded = await templateRow
138
+ .first()
139
+ .waitFor({ state: 'visible', timeout: 15000 })
140
+ .then(() => true)
141
+ .catch(() => false);
142
+ if (alreadyUploaded) {
143
+ return;
144
+ }
145
+ await filterInput.fill('');
146
+ const response = await page.request.get(REST_CONNECTOR_TEMPLATE_V12_URL);
147
+ (0, test_1.expect)(response.ok(), `Fetching the REST connector template failed with ${response.status()}`).toBeTruthy();
148
+ const buffer = await response.body();
149
+ (0, test_1.expect)(JSON.parse(buffer.toString('utf-8'))).toMatchObject({
150
+ id: 'io.camunda.connectors.HttpJson.v2',
151
+ name: REST_CONNECTOR_TEMPLATE_NAME,
152
+ version: 12,
153
+ });
154
+ await modelerHomePage.clickDiagramTypeDropdown();
155
+ await modelerHomePage.clickUploadFilesButton();
156
+ await (0, fileUpload_1.uploadFileContent)(page, {
157
+ name: `${REST_CONNECTOR_TEMPLATE_RESOURCE}.json`,
158
+ mimeType: 'application/json',
159
+ buffer,
160
+ });
161
+ await (0, test_1.expect)(templateRow.first()).toBeVisible({ timeout: 60000 });
162
+ }
115
163
  async function modelRestConnector(modelerCreatePage, connectorSettingsPage, connectorMarketplacePage, processName, url, auth, resultExpression, { resultVariable = '', basicAuthCredentials = { username: '', password: '' }, page, modelerHomePage, recoverSession, } = {}) {
116
164
  await (0, test_1.expect)(modelerCreatePage.generalPanel).toBeVisible({
117
165
  timeout: 120000,
@@ -137,44 +185,30 @@ async function modelRestConnector(modelerCreatePage, connectorSettingsPage, conn
137
185
  await modelerCreatePage.clickAppendTaskButton();
138
186
  await modelerCreatePage.clickChangeTypeButton();
139
187
  try {
188
+ await modelerCreatePage.searchChangeElementList('REST Outbound');
140
189
  await (0, test_1.expect)(modelerCreatePage.restConnectorOption).toBeVisible({
141
190
  timeout: 15000,
142
191
  });
143
192
  }
144
193
  catch (error) {
145
- await modelerCreatePage.clickMarketPlaceButton();
146
- await connectorMarketplacePage.clickSearchForConnectorTextbox();
147
- await connectorMarketplacePage.fillSearchForConnectorTextbox('REST Connector');
148
- await (0, sleep_1.sleep)(10000);
149
- await connectorMarketplacePage.downloadConnectorToProject();
150
- // After download the connector template must be published before it
151
- // appears in the change-type panel. Navigate to the downloaded template,
152
- // publish it, then return to the original diagram and reload so the
153
- // freshly-published connector is available.
154
- if (page && modelerHomePage) {
155
- try {
156
- const connectorTemplatePage = new ConnectorTemplatePage_1.ConnectorTemplatePage(page);
157
- await modelerHomePage.clickProjectBreadcrumb();
158
- await modelerHomePage.clickProcessDiagram('REST Outbound Connector');
159
- await connectorTemplatePage.publishConnector();
160
- await modelerHomePage.clickProjectBreadcrumb();
161
- await modelerHomePage.clickProcessDiagram(processName);
162
- await (0, sleep_1.sleep)(3000);
163
- await page.reload();
164
- await (0, sleep_1.sleep)(3000);
165
- // Re-select the task element and reopen the change-type panel so
166
- // clickRestConnectorOption() finds the connector immediately.
167
- await modelerCreatePage.secondElement.click({
168
- force: true,
169
- timeout: 60000,
170
- });
171
- await modelerCreatePage.clickChangeTypeButton();
172
- }
173
- catch (publishError) {
174
- console.error(`Connector publish flow failed: ${publishError}`);
175
- // clickRestConnectorOption() retries will recover via page.reload()
176
- }
194
+ if (!page || !modelerHomePage) {
195
+ throw new Error('modelRestConnector needs `page` and `modelerHomePage` to upload the REST connector template');
177
196
  }
197
+ await modelerHomePage.clickProjectBreadcrumb();
198
+ await uploadRestConnectorTemplate(page, modelerHomePage);
199
+ const connectorTemplatePage = new ConnectorTemplatePage_1.ConnectorTemplatePage(page);
200
+ await modelerHomePage.clickProcessDiagram(REST_CONNECTOR_TEMPLATE_RESOURCE);
201
+ await connectorTemplatePage.publishToProject();
202
+ await modelerHomePage.clickProjectBreadcrumb();
203
+ await modelerHomePage.clickProcessDiagram(processName);
204
+ await page.reload();
205
+ // Re-select the task element and reopen the change-type panel so
206
+ // clickRestConnectorOption() finds the freshly published connector.
207
+ await modelerCreatePage.secondElement.click({
208
+ force: true,
209
+ timeout: 60000,
210
+ });
211
+ await modelerCreatePage.clickChangeTypeButton();
178
212
  }
179
213
  await modelerCreatePage.clickRestConnectorOption(recoverSession);
180
214
  await connectorSettingsPage.clickAuthenticationTab();
@@ -15,8 +15,7 @@ SM_8_8_1.test.describe('Connectors User Flow Tests @tasklistV2', () => {
15
15
  await (0, _setup_1.captureScreenshot)(page, testInfo);
16
16
  await (0, _setup_1.captureFailureVideo)(page, testInfo);
17
17
  });
18
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
19
- SM_8_8_1.test.skip('REST Connector No Auth User Flow', async ({ page, operateHomePage, modelerHomePage, operateProcessInstancePage, modelerCreatePage, connectorSettingsPage, operateProcessesPage, connectorMarketplacePage, navigationPage, }) => {
18
+ (0, SM_8_8_1.test)('REST Connector No Auth User Flow', async ({ page, operateHomePage, modelerHomePage, operateProcessInstancePage, modelerCreatePage, connectorSettingsPage, operateProcessesPage, connectorMarketplacePage, navigationPage, }) => {
20
19
  SM_8_8_1.test.slow();
21
20
  const processName = 'REST_Connector_No_Auth_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
22
21
  await SM_8_8_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
@@ -44,8 +43,7 @@ SM_8_8_1.test.describe('Connectors User Flow Tests @tasklistV2', () => {
44
43
  });
45
44
  });
46
45
  });
47
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
48
- SM_8_8_1.test.skip('REST Connector Bearer Token Auth User Flow', async ({ page, operateHomePage, modelerHomePage, modelerCreatePage, connectorSettingsPage, navigationPage, operateProcessInstancePage, operateProcessesPage, connectorMarketplacePage, }) => {
46
+ (0, SM_8_8_1.test)('REST Connector Bearer Token Auth User Flow', async ({ page, operateHomePage, modelerHomePage, modelerCreatePage, connectorSettingsPage, navigationPage, operateProcessInstancePage, operateProcessesPage, connectorMarketplacePage, }) => {
49
47
  SM_8_8_1.test.slow();
50
48
  const processName = 'REST_Connector_Bearer_Auth_Process' +
51
49
  (await (0, _setup_1.generateRandomStringAsync)(3));
@@ -132,8 +130,7 @@ SM_8_8_1.test.describe('Connectors User Flow Tests @tasklistV2', () => {
132
130
  (0, test_1.expect)(result).toBe('completed');
133
131
  });
134
132
  });
135
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
136
- SM_8_8_1.test.skip('Connector Secrets User Flow', async ({ page, operateHomePage, modelerHomePage, navigationPage, modelerCreatePage, connectorSettingsPage, operateProcessInstancePage, operateProcessesPage, connectorMarketplacePage, }) => {
133
+ (0, SM_8_8_1.test)('Connector Secrets User Flow', async ({ page, operateHomePage, modelerHomePage, navigationPage, modelerCreatePage, connectorSettingsPage, operateProcessInstancePage, operateProcessesPage, connectorMarketplacePage, }) => {
137
134
  SM_8_8_1.test.slow();
138
135
  const processName = 'REST_Connector_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
139
136
  await SM_8_8_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
@@ -127,8 +127,7 @@ if (process.env.IS_MT === 'true') {
127
127
  }
128
128
  });
129
129
  });
130
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
131
- SM_8_8_1.test.skip('Main User Can Create & Access Tenant - Connectors Flow @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, operateProcessInstancePage, operateProcessesPage, operateHomePage, navigationPage, managementIdentityTenantPage, connectorSettingsPage, connectorMarketplacePage, optimizeHomePage, optimizeDashboardPage, ocIdentityHomePage, ocTenantPage, }) => {
130
+ (0, SM_8_8_1.test)('Main User Can Create & Access Tenant - Connectors Flow @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, operateProcessInstancePage, operateProcessesPage, operateHomePage, navigationPage, managementIdentityTenantPage, connectorSettingsPage, connectorMarketplacePage, optimizeHomePage, optimizeDashboardPage, ocIdentityHomePage, ocTenantPage, }) => {
132
131
  SM_8_8_1.test.slow();
133
132
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
134
133
  const processName = 'Main_User_Connectors_Flow_' + randomString;
@@ -260,8 +259,7 @@ if (process.env.IS_MT === 'true') {
260
259
  });
261
260
  }
262
261
  });
263
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
264
- SM_8_8_1.test.skip('Second User Can Access Tenant Created By Main User - Connectors Flow @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, operateProcessInstancePage, operateProcessesPage, operateHomePage, navigationPage, managementIdentityTenantPage, connectorSettingsPage, connectorMarketplacePage, optimizeHomePage, optimizeDashboardPage, ocIdentityHomePage, ocTenantPage, managementIdentityPage, keycloakAdminPage, keycloakLoginPage, ocIdentityRolesPage, ocIdentityMappingRulesPage, browser, }) => {
262
+ (0, SM_8_8_1.test)('Second User Can Access Tenant Created By Main User - Connectors Flow @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, operateProcessInstancePage, operateProcessesPage, operateHomePage, navigationPage, managementIdentityTenantPage, connectorSettingsPage, connectorMarketplacePage, optimizeHomePage, optimizeDashboardPage, ocIdentityHomePage, ocTenantPage, managementIdentityPage, keycloakAdminPage, keycloakLoginPage, ocIdentityRolesPage, ocIdentityMappingRulesPage, browser, }) => {
265
263
  SM_8_8_1.test.slow();
266
264
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
267
265
  const processName = 'Second_User_Connectors_Flow_' + randomString;
@@ -394,8 +392,7 @@ if (process.env.IS_MT === 'true') {
394
392
  });
395
393
  }
396
394
  });
397
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
398
- SM_8_8_1.test.skip('User Can Be Assigned To Multiple Tenants @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, operateProcessInstancePage, operateProcessesPage, operateHomePage, navigationPage, managementIdentityTenantPage, connectorSettingsPage, connectorMarketplacePage, ocIdentityHomePage, ocTenantPage, managementIdentityPage, }) => {
395
+ (0, SM_8_8_1.test)('User Can Be Assigned To Multiple Tenants @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, operateProcessInstancePage, operateProcessesPage, operateHomePage, navigationPage, managementIdentityTenantPage, connectorSettingsPage, connectorMarketplacePage, ocIdentityHomePage, ocTenantPage, managementIdentityPage, }) => {
399
396
  SM_8_8_1.test.slow();
400
397
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
401
398
  const processName1 = 'Multiple_Tenant_Flow_1' + randomString;
@@ -135,8 +135,7 @@ SM_8_8_1.test.describe.parallel('Smoke Tests', () => {
135
135
  });
136
136
  console.log(`[${testInfo.title}] Test end: timeout = ${testInfo.timeout}`);
137
137
  });
138
- // Skipped due to bug 320: https://github.com/camunda/marketplace-api/issues/320
139
- SM_8_8_1.test.skip('Most Common REST Connector User Flow @tasklistV2', async ({ page, context, operateHomePage, modelerHomePage, modelerCreatePage, connectorSettingsPage, navigationPage, operateProcessesPage, operateProcessInstancePage, connectorMarketplacePage, }, testInfo) => {
138
+ (0, SM_8_8_1.test)('Most Common REST Connector User Flow @tasklistV2', async ({ page, context, operateHomePage, modelerHomePage, modelerCreatePage, connectorSettingsPage, navigationPage, operateProcessesPage, operateProcessInstancePage, connectorMarketplacePage, }, testInfo) => {
140
139
  console.log(`[${testInfo.title}] Test start: timeout = ${testInfo.timeout}`);
141
140
  const processName = 'REST_Connector_Basic_Auth_Process' +
142
141
  (await (0, _setup_1.generateRandomStringAsync)(3));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1557",
3
+ "version": "0.0.1559",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",