@camunda/e2e-test-suite 0.0.117 → 0.0.118

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConnectorMarketplacePage = void 0;
4
+ const sleep_1 = require("../../utils/sleep");
4
5
  class ConnectorMarketplacePage {
5
6
  page;
6
7
  searchForConnectorTextbox;
@@ -20,9 +21,11 @@ class ConnectorMarketplacePage {
20
21
  }
21
22
  async clickSearchForConnectorTextbox() {
22
23
  await this.searchForConnectorTextbox.click({ timeout: 60000 });
24
+ await (0, sleep_1.sleep)(2000);
23
25
  }
24
26
  async fillSearchForConnectorTextbox(connectorName) {
25
27
  await this.searchForConnectorTextbox.fill(connectorName, { timeout: 60000 });
28
+ await (0, sleep_1.sleep)(2000);
26
29
  }
27
30
  async clickDownloadToProjectButton() {
28
31
  await this.downloadToProjectButton.click({ timeout: 60000 });
@@ -79,6 +79,11 @@ declare class ModelerCreatePage {
79
79
  readonly variableAssignmentValueTextboxSecondVariable: Locator;
80
80
  readonly zeebeClientIdVariable: Locator;
81
81
  readonly variableAssignmentValueTextboxThirdVariable: Locator;
82
+ readonly firstPlaceRESTConnector: Locator;
83
+ readonly authenticationPanel: Locator;
84
+ readonly oauthTokenEndpointInput: Locator;
85
+ readonly closeDetailsPanel: Locator;
86
+ readonly openDetailsPanel: Locator;
82
87
  constructor(page: Page);
83
88
  deployProcessInstance(): Promise<void>;
84
89
  clickCloseModalButton(): Promise<void>;
@@ -177,5 +182,13 @@ declare class ModelerCreatePage {
177
182
  fillZeebeSecretValue(zeebeSecret: string): Promise<void>;
178
183
  fillZeebeRestValue(zeebeUrl: string): Promise<void>;
179
184
  embedForm(formName: string): Promise<void>;
185
+ clickFirstPlaceRESTConnector(): Promise<void>;
186
+ setOAuthTokenEndpoint(elementToClick: Locator, endpoint: string, options?: {
187
+ retries?: number;
188
+ settleMs?: number;
189
+ openPanel?: boolean;
190
+ }): Promise<void>;
191
+ clickCloseDetailsPanel(): Promise<void>;
192
+ clickOpenDetailsPanel(): Promise<void>;
180
193
  }
181
194
  export { ModelerCreatePage };
@@ -84,6 +84,11 @@ class ModelerCreatePage {
84
84
  variableAssignmentValueTextboxSecondVariable;
85
85
  zeebeClientIdVariable;
86
86
  variableAssignmentValueTextboxThirdVariable;
87
+ firstPlaceRESTConnector;
88
+ authenticationPanel;
89
+ oauthTokenEndpointInput;
90
+ closeDetailsPanel;
91
+ openDetailsPanel;
87
92
  constructor(page) {
88
93
  this.page = page;
89
94
  this.generalPanel = page.locator('[data-group-id="group-general"]');
@@ -213,7 +218,8 @@ class ModelerCreatePage {
213
218
  this.deployErrorMessage = page.getByText('The diagram failed to deploy & run');
214
219
  this.bpmnReplaceMenu = page.getByTestId('bpmn-replace');
215
220
  this.connectorsDocHandlingStartEventElement = page.locator('g:nth-child(5) > .djs-element > .djs-hit');
216
- this.startEventVariableInputWithThreeVariables = page.getByText('Outputs3');
221
+ this.startEventVariableInputWithThreeVariables =
222
+ page.getByText('Output mapping3');
217
223
  this.zeebeRestAddressVariable = page
218
224
  .locator('[data-test="properties-panel"]')
219
225
  .getByText('zeebeRestAdress');
@@ -228,6 +234,14 @@ class ModelerCreatePage {
228
234
  .locator('[data-test="properties-panel"]')
229
235
  .getByText('zeebeClientId');
230
236
  this.variableAssignmentValueTextboxThirdVariable = page.locator('#bio-properties-panel-StartEvent_1-output-2-source div');
237
+ this.firstPlaceRESTConnector = page.locator('g:nth-child(2) > .djs-element > .djs-hit');
238
+ this.authenticationPanel = page
239
+ .locator('div')
240
+ .filter({ hasText: /^Authentication$/ })
241
+ .first();
242
+ this.oauthTokenEndpointInput = page.getByLabel('OAuth 2.0 token endpoint');
243
+ this.closeDetailsPanel = page.getByTitle('Close Details Panel');
244
+ this.openDetailsPanel = page.getByTitle('Open Details Panel');
231
245
  }
232
246
  async deployProcessInstance() {
233
247
  await this.clickDeployButton();
@@ -976,5 +990,39 @@ class ModelerCreatePage {
976
990
  await this.clickForm(formName);
977
991
  await this.clickEmbedButton();
978
992
  }
993
+ async clickFirstPlaceRESTConnector() {
994
+ await this.firstPlaceRESTConnector.click({ timeout: 60000 });
995
+ }
996
+ async setOAuthTokenEndpoint(elementToClick, endpoint, options) {
997
+ const retries = options?.retries ?? 2;
998
+ const settleMs = options?.settleMs ?? 250;
999
+ const openPanel = options?.openPanel ?? false;
1000
+ await elementToClick.click({ timeout: 60000 });
1001
+ if (openPanel) {
1002
+ await this.clickOpenDetailsPanel();
1003
+ }
1004
+ await this.authenticationPanel.click({ timeout: 60000 });
1005
+ let lastError;
1006
+ for (let attempt = 1; attempt <= retries; attempt++) {
1007
+ try {
1008
+ await (0, test_1.expect)(this.oauthTokenEndpointInput).toBeVisible({ timeout: 3000 });
1009
+ await this.oauthTokenEndpointInput.click({ timeout: 3000 });
1010
+ await this.oauthTokenEndpointInput.fill(endpoint, { timeout: 30000 });
1011
+ return;
1012
+ }
1013
+ catch (err) {
1014
+ lastError = err;
1015
+ await this.authenticationPanel.click({ timeout: 60000 });
1016
+ await (0, sleep_1.sleep)(settleMs);
1017
+ }
1018
+ }
1019
+ throw new Error(`Failed to set OAuth 2.0 token endpoint after ${retries} attempt(s). Last error: ${String(lastError)}`);
1020
+ }
1021
+ async clickCloseDetailsPanel() {
1022
+ await this.closeDetailsPanel.click({ timeout: 30000 });
1023
+ }
1024
+ async clickOpenDetailsPanel() {
1025
+ await this.openDetailsPanel.click({ timeout: 30000 });
1026
+ }
979
1027
  }
980
1028
  exports.ModelerCreatePage = ModelerCreatePage;
@@ -24,6 +24,10 @@ declare class OCIdentityRolesPage {
24
24
  readonly assignUserButton: Locator;
25
25
  readonly usernameTextBox: Locator;
26
26
  readonly assignUserSubButton: Locator;
27
+ readonly clientsTab: Locator;
28
+ readonly assignClientsButton: Locator;
29
+ readonly clientIdTextBox: Locator;
30
+ readonly assignClientIdSubButton: Locator;
27
31
  constructor(page: Page);
28
32
  clickMappingRulesTab(): Promise<void>;
29
33
  clickRole(roleID: string): Promise<void>;
@@ -41,5 +45,11 @@ declare class OCIdentityRolesPage {
41
45
  clickUsernameTextbox(): Promise<void>;
42
46
  fillUsernameTextbox(userId: string): Promise<void>;
43
47
  clickAssignUserSubButton(): Promise<void>;
48
+ clickClientsTab(): Promise<void>;
49
+ clickAssignClientButton(): Promise<void>;
50
+ clickClientIdTextbox(): Promise<void>;
51
+ fillClientIdTextbox(clientId: string): Promise<void>;
52
+ clickAssignClientIdSubButton(): Promise<void>;
53
+ addClientToRole(clientId: string): Promise<void>;
44
54
  }
45
55
  export { OCIdentityRolesPage };
@@ -28,6 +28,10 @@ class OCIdentityRolesPage {
28
28
  assignUserButton;
29
29
  usernameTextBox;
30
30
  assignUserSubButton;
31
+ clientsTab;
32
+ assignClientsButton;
33
+ clientIdTextBox;
34
+ assignClientIdSubButton;
31
35
  constructor(page) {
32
36
  this.page = page;
33
37
  this.rolesList = page.getByRole('table');
@@ -80,6 +84,14 @@ class OCIdentityRolesPage {
80
84
  this.assignUserSubButton = page
81
85
  .getByLabel('Assign user')
82
86
  .getByRole('button', { name: 'Assign user' });
87
+ this.clientsTab = page.getByRole('tab', { name: 'Clients' });
88
+ this.assignClientsButton = page.getByRole('button', {
89
+ name: 'Assign client',
90
+ });
91
+ this.clientIdTextBox = page.getByPlaceholder('Enter client ID');
92
+ this.assignClientIdSubButton = page
93
+ .getByLabel('Assign client')
94
+ .getByRole('button', { name: 'Assign client' });
83
95
  }
84
96
  async clickMappingRulesTab() {
85
97
  await (0, test_1.expect)(this.selectResourceTypeTab('Mapping Rules')).toBeVisible({
@@ -159,5 +171,27 @@ class OCIdentityRolesPage {
159
171
  async clickAssignUserSubButton() {
160
172
  await this.assignUserSubButton.click();
161
173
  }
174
+ async clickClientsTab() {
175
+ await this.clientsTab.click();
176
+ }
177
+ async clickAssignClientButton() {
178
+ await this.assignClientsButton.click();
179
+ }
180
+ async clickClientIdTextbox() {
181
+ await this.clientIdTextBox.click();
182
+ }
183
+ async fillClientIdTextbox(clientId) {
184
+ await this.clientIdTextBox.fill(clientId);
185
+ }
186
+ async clickAssignClientIdSubButton() {
187
+ await this.assignClientIdSubButton.click();
188
+ }
189
+ async addClientToRole(clientId) {
190
+ await this.clickClientsTab();
191
+ await this.clickAssignClientButton();
192
+ await this.clickClientIdTextbox();
193
+ await this.fillClientIdTextbox(clientId);
194
+ await this.clickAssignClientIdSubButton();
195
+ }
162
196
  }
163
197
  exports.OCIdentityRolesPage = OCIdentityRolesPage;
@@ -31,4 +31,4 @@ export declare function modelAndRunConnectorsTimerEventDiagram(modelerCreatePage
31
31
  export declare function findTextWithPagination(page: Page, text: string, timeout?: number, action?: (locator: Locator) => Promise<void>): Promise<boolean>;
32
32
  export declare function modelDiagramFromFile(page: Page, modelerHomePage: ModelerHomePage, modelerCreatePage: ModelerCreatePage, processName: string, fileName?: string, nrOfRenamedUserTasks?: number, taskName?: string): Promise<void>;
33
33
  export declare function expectTextWithPagination(page: Page, text: string, shouldExist?: boolean, timeout?: number): Promise<void>;
34
- export declare function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage: ModelerCreatePage, modelerHomePage: ModelerHomePage, processName: string, page: Page, connectorMarketplacePage: ConnectorMarketplacePage, clusterName: string, zeebeUrl: string, zeebeClientId: string, zeebeClientSecret: string): Promise<void>;
34
+ export declare function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage: ModelerCreatePage, modelerHomePage: ModelerHomePage, processName: string, page: Page, connectorMarketplacePage: ConnectorMarketplacePage, zeebeUrl: string, zeebeClientId: string, zeebeClientSecret: string, endpoint: string): Promise<void>;
@@ -393,12 +393,12 @@ async function expectTextWithPagination(page, text, shouldExist = true, timeout
393
393
  }
394
394
  }
395
395
  exports.expectTextWithPagination = expectTextWithPagination;
396
- async function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage, modelerHomePage, processName, page, connectorMarketplacePage, clusterName, zeebeUrl, zeebeClientId, zeebeClientSecret) {
396
+ async function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage, modelerHomePage, processName, page, connectorMarketplacePage, zeebeUrl, zeebeClientId, zeebeClientSecret, endpoint) {
397
397
  await modelerHomePage.clickCrossComponentProjectFolder();
398
398
  await modelerHomePage.clickDiagramTypeDropdown();
399
399
  await modelerHomePage.clickUploadFilesButton();
400
- await (0, fileUpload_1.uploadFile)(page, 'Connectors Document Handling.bpmn');
401
- await modelerHomePage.clickProcessDiagram('Connectors Document Handling');
400
+ await (0, fileUpload_1.uploadFile)(page, 'SM_Document_Handling_Connectors_User_Flow.bpmn');
401
+ await modelerHomePage.clickProcessDiagram('SM_Document_Handling_Connectors_User_Flow');
402
402
  await modelerCreatePage.clickDiagramBreadcrumb();
403
403
  await modelerCreatePage.clickEditDiagramNameButton();
404
404
  await modelerCreatePage.enterDiagramName(processName);
@@ -408,11 +408,8 @@ async function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage, modele
408
408
  await modelerCreatePage.clickIdInput();
409
409
  await modelerCreatePage.fillIdInput(processName);
410
410
  await (0, sleep_1.sleep)(10000);
411
- await modelerCreatePage.clickSecondPlacedElement();
411
+ await modelerCreatePage.clickFirstPlaceRESTConnector();
412
412
  await modelerCreatePage.clickChangeTypeButton();
413
- await (0, test_1.expect)(modelerCreatePage.marketPlaceButton).toBeVisible({
414
- timeout: 120000,
415
- });
416
413
  await modelerCreatePage.clickMarketPlaceButton();
417
414
  await connectorMarketplacePage.clickSearchForConnectorTextbox();
418
415
  await connectorMarketplacePage.fillSearchForConnectorTextbox('REST Connector');
@@ -421,6 +418,18 @@ async function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage, modele
421
418
  await page.reload();
422
419
  await (0, sleep_1.sleep)(5000);
423
420
  await modelerCreatePage.fillStartEventVariablesForDocHandling(zeebeUrl, zeebeClientId, zeebeClientSecret);
421
+ await modelerCreatePage.setOAuthTokenEndpoint(page.locator('.djs-hit').first(), endpoint);
422
+ await (0, sleep_1.sleep)(2000);
423
+ await modelerCreatePage.setOAuthTokenEndpoint(page.locator('g:nth-child(3) > .djs-element > .djs-hit'), endpoint);
424
+ await (0, sleep_1.sleep)(2000);
425
+ await modelerCreatePage.setOAuthTokenEndpoint(page.locator('g:nth-child(6) > .djs-element > .djs-hit'), endpoint);
426
+ await (0, sleep_1.sleep)(2000);
427
+ await modelerCreatePage.clickCloseDetailsPanel();
428
+ await modelerCreatePage.setOAuthTokenEndpoint(page.locator('g:nth-child(7) > .djs-element > .djs-hit'), endpoint, { openPanel: true });
429
+ await (0, sleep_1.sleep)(2000);
430
+ await modelerCreatePage.clickCloseDetailsPanel();
431
+ await modelerCreatePage.setOAuthTokenEndpoint(page.locator('g:nth-child(9) > .djs-element > .djs-hit'), endpoint, { openPanel: true });
432
+ await (0, sleep_1.sleep)(2000);
424
433
  await modelerCreatePage.runProcessInstance();
425
434
  }
426
435
  exports.modelAndRunConnectorsDocHandlingDiagram = modelAndRunConnectorsDocHandlingDiagram;
@@ -5,6 +5,7 @@ const SM_8_9_1 = require("../../fixtures/SM-8.9");
5
5
  const _setup_1 = require("../../test-setup.js");
6
6
  const sleep_1 = require("../../utils/sleep");
7
7
  const fileUpload_1 = require("../../utils/fileUpload");
8
+ const UtilitiesPage_1 = require("../../pages/SM-8.9/UtilitiesPage");
8
9
  if (process.env.IS_DS === 'true') {
9
10
  SM_8_9_1.test.describe.configure({ mode: 'parallel' });
10
11
  SM_8_9_1.test.describe('AWS Document Handling User Flows Test', () => {
@@ -113,5 +114,42 @@ if (process.env.IS_DS === 'true') {
113
114
  await operateProcessInstancePage.assertProcessVariableContainsText('Upload_Files', 'aws');
114
115
  });
115
116
  });
117
+ (0, SM_8_9_1.test)('Document Handling Connectors User Flow - AWS @tasklistV2', async ({ page, navigationPage, modelerHomePage, modelerCreatePage, operateHomePage, operateProcessesPage, connectorMarketplacePage, operateProcessInstancePage, ocIdentityHomePage, ocIdentityRolesPage, }) => {
118
+ const processName = 'Document_Handling_Connectors_User_Flow_AWS_Process' +
119
+ (await (0, _setup_1.generateRandomStringAsync)(3));
120
+ const baseURL = process.env.PLAYWRIGHT_BASE_URL ||
121
+ `https://eks-${process.env.BASE_URL}.qa.aws.camunda.cloud`;
122
+ const clientSecret = process.env.DISTRO_QA_E2E_TESTS_KEYCLOAK_CLIENTS_SECRET;
123
+ const endpoint = `${baseURL}/auth/realms/camunda-platform/protocol/openid-connect/token`;
124
+ await SM_8_9_1.test.step('Grant client admin access', async () => {
125
+ await navigationPage.goToOCIdentity();
126
+ await ocIdentityHomePage.clickRolesTab();
127
+ await ocIdentityRolesPage.clickRole('admin');
128
+ await ocIdentityRolesPage.addClientToRole('test');
129
+ });
130
+ await SM_8_9_1.test.step('Open Cross Component Test Project and Create a REST Connector Document Handling Flow', async () => {
131
+ await navigationPage.goToModeler();
132
+ await (0, UtilitiesPage_1.modelAndRunConnectorsDocHandlingDiagram)(modelerCreatePage, modelerHomePage, processName, page, connectorMarketplacePage, `"${baseURL}/orchestration"`, `"test"`, `"${clientSecret}"`, endpoint);
133
+ });
134
+ await SM_8_9_1.test.step('View Process Instance in Operate, assert it completes and assert variable values are correct', async () => {
135
+ await navigationPage.goToOperate();
136
+ await operateHomePage.clickProcessesTab();
137
+ await operateProcessesPage.clickProcessInstanceLink(processName, 'completed');
138
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc', 'aws');
139
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc', '14e564c347119f8bdde27c80ff5b3cb8d92709c5a6177b74cde568c5503c1f12');
140
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc', '72519');
141
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc', 'image/jpeg');
142
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc2', 'aws');
143
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc2', '14e564c347119f8bdde27c80ff5b3cb8d92709c5a6177b74cde568c5503c1f12');
144
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc2', '72519');
145
+ await operateProcessInstancePage.assertProcessVariableContainsText('doc2', 'image/jpeg');
146
+ await operateProcessInstancePage.assertProcessVariableContainsText('uploadBatch', 'aws');
147
+ await operateProcessInstancePage.assertProcessVariableContainsText('uploadBatch', '201');
148
+ await operateProcessInstancePage.assertProcessVariableContainsText('uploadDoc2', 'aws');
149
+ await operateProcessInstancePage.assertProcessVariableContainsText('uploadDoc2', '201');
150
+ await operateProcessInstancePage.assertProcessVariableContainsText('uploadDoc2', 'aws');
151
+ await operateProcessInstancePage.assertProcessVariableContainsText('GetDocUpload', '200');
152
+ });
153
+ });
116
154
  });
117
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.117",
3
+ "version": "0.0.118",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",