@camunda/e2e-test-suite 0.0.647 → 0.0.648

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.
@@ -22,6 +22,7 @@ declare class ModelerCreatePage {
22
22
  readonly renameDiagramNameButton: Locator;
23
23
  readonly diagramNameInput: Locator;
24
24
  readonly variableInput: Locator;
25
+ readonly businessIdInput: Locator;
25
26
  readonly embedFormButton: Locator;
26
27
  readonly embedButton: Locator;
27
28
  readonly newForm: Locator;
@@ -92,7 +93,7 @@ declare class ModelerCreatePage {
92
93
  modelJobWorkerDiagram(processName: string): Promise<void>;
93
94
  assertThreeElementsVisible(): Promise<void>;
94
95
  clickForm(name: string): Promise<void>;
95
- runProcessInstance(variables?: string, tenant?: string): Promise<void>;
96
+ runProcessInstance(variables?: string, tenant?: string, businessId?: string): Promise<void>;
96
97
  switchToPlay(): Promise<void>;
97
98
  clickGeneralPropertiesPanel(): Promise<void>;
98
99
  clickIdInput(): Promise<void>;
@@ -27,6 +27,7 @@ class ModelerCreatePage {
27
27
  renameDiagramNameButton;
28
28
  diagramNameInput;
29
29
  variableInput;
30
+ businessIdInput;
30
31
  embedFormButton;
31
32
  embedButton;
32
33
  newForm;
@@ -136,6 +137,7 @@ class ModelerCreatePage {
136
137
  this.renameDiagramNameButton = page.getByText('Rename');
137
138
  this.diagramNameInput = page.locator('[data-test="editable-input"]');
138
139
  this.variableInput = page.locator('[id="variables-json"]');
140
+ this.businessIdInput = page.locator('[id^="business-id-input"]');
139
141
  this.embedFormButton = page.getByRole('button', { name: 'Link form' });
140
142
  this.embedButton = page.locator('[data-test="confirm-move"]');
141
143
  this.newForm = page.locator('[data-test="item-New form"]');
@@ -333,7 +335,7 @@ class ModelerCreatePage {
333
335
  .getByText(name)
334
336
  .click({ timeout: 90000 });
335
337
  }
336
- async runProcessInstance(variables = '', tenant = '') {
338
+ async runProcessInstance(variables = '', tenant = '', businessId = '') {
337
339
  await this.page.waitForTimeout(2000); // the canvas autosaves. This can take a second to save.
338
340
  const maxRetries = 3;
339
341
  for (let attempt = 0; attempt < maxRetries; attempt++) {
@@ -353,18 +355,24 @@ class ModelerCreatePage {
353
355
  await this.clickTenantIdInput();
354
356
  await this.fillTenantIdInput(tenant);
355
357
  }
358
+ if (businessId.length > 0) {
359
+ await (0, test_1.expect)(this.businessIdInput).toBeVisible({
360
+ timeout: 60000,
361
+ });
362
+ await this.businessIdInput.fill(businessId);
363
+ }
356
364
  await this.clickDeployAndRunSubButton();
357
365
  await this.instanceStartedAssertion();
358
366
  return;
359
367
  }
360
368
  catch (error) {
361
369
  if (attempt < maxRetries - 1) {
362
- console.warn(`Attempt ${attempt + 1} failed for deploy & run running process. Retrying...`);
370
+ console.warn(`Attempt ${attempt + 1} failed for deploy & run running process: ${error instanceof Error ? error.message : error}. Retrying...`);
363
371
  await this.page.reload();
364
372
  await (0, sleep_1.sleep)(10000);
365
373
  }
366
374
  else {
367
- throw new Error(`Assertion failed after ${maxRetries} attempts`);
375
+ throw new Error(`runProcessInstance failed after ${maxRetries} attempts. Last error: ${error instanceof Error ? error.message : error}`);
368
376
  }
369
377
  }
370
378
  }
@@ -24,6 +24,7 @@ declare class OperateProcessInstancePage {
24
24
  private captureVariableJsonValue;
25
25
  assertResultVariableVisibleWithRetry(variableName: string): Promise<void>;
26
26
  assertActiveTokenIsPresent(): Promise<void>;
27
+ assertBusinessIdVisible(businessId: string): Promise<void>;
27
28
  assertVariablesListVisible(timeout?: number): Promise<void>;
28
29
  }
29
30
  export { OperateProcessInstancePage };
@@ -234,6 +234,13 @@ class OperateProcessInstancePage {
234
234
  async assertActiveTokenIsPresent() {
235
235
  await (0, test_1.expect)(this.activeIcon).toBeVisible({ timeout: 60000 });
236
236
  }
237
+ async assertBusinessIdVisible(businessId) {
238
+ const instanceHeader = this.page.getByTestId('instance-header');
239
+ await (0, test_1.expect)(instanceHeader.getByText('Business ID')).toBeVisible({
240
+ timeout: 60000,
241
+ });
242
+ await (0, test_1.expect)(instanceHeader.getByText(businessId, { exact: true })).toBeVisible({ timeout: 60000 });
243
+ }
237
244
  async assertVariablesListVisible(timeout = 30000) {
238
245
  const startTime = Date.now();
239
246
  while (Date.now() - startTime < timeout) {
@@ -141,6 +141,35 @@ SM_8_10_1.test.describe('Web Modeler User Flow Tests', () => {
141
141
  await operateProcessInstancePage.completedIconAssertion();
142
142
  });
143
143
  });
144
+ (0, SM_8_10_1.test)('Deploy and run process with run configuration and verify in Operate', async ({ modelerHomePage, modelerCreatePage, navigationPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
145
+ SM_8_10_1.test.slow();
146
+ const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
147
+ const processName = 'Run_Config_Process_' + randomString;
148
+ const businessId = `bid-${Date.now()}-${randomString}`;
149
+ const variables = '{"orderNumber": "A12BH98", "amount": 185.34}';
150
+ await SM_8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
151
+ await modelerHomePage.clickCrossComponentProjectFolder();
152
+ await modelerHomePage.clickDiagramTypeDropdown();
153
+ await modelerHomePage.clickBpmnTemplateOption();
154
+ });
155
+ await SM_8_10_1.test.step('Model a simple job worker diagram', async () => {
156
+ await modelerCreatePage.modelJobWorkerDiagram(processName);
157
+ });
158
+ await SM_8_10_1.test.step('Deploy and run process with variables and Business ID', async () => {
159
+ await modelerCreatePage.runProcessInstance(variables, '', businessId);
160
+ });
161
+ await SM_8_10_1.test.step('View process instance in Operate and assert run configuration is visible', async () => {
162
+ await navigationPage.goToOperate();
163
+ await (0, test_1.expect)(operateHomePage.processesTab).toBeVisible({
164
+ timeout: 120000,
165
+ });
166
+ await operateHomePage.clickProcessesTab();
167
+ await operateProcessesPage.clickProcessInstanceLink(processName);
168
+ await operateProcessInstancePage.assertBusinessIdVisible(businessId);
169
+ await operateProcessInstancePage.assertProcessVariableContainsText('orderNumber', '"A12BH98"');
170
+ await operateProcessInstancePage.assertProcessVariableContainsText('amount', '185.34');
171
+ });
172
+ });
144
173
  (0, SM_8_10_1.test)('Conditional Events - Deploy, verify in Operate and verify process in Optimize dashboard @tasklistV2', async ({ page, modelerHomePage, modelerCreatePage, navigationPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, optimizeHomePage, optimizeDashboardPage, }) => {
145
174
  SM_8_10_1.test.slow();
146
175
  const bpmnFileName = 'Conditional_Events_All.bpmn';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.647",
3
+ "version": "0.0.648",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",