@camunda/e2e-test-suite 0.0.1667 → 0.0.1669

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.
@@ -10,6 +10,8 @@ declare class OperateProcessInstancePage {
10
10
  readonly activeIcon: Locator;
11
11
  readonly incidentIcon: Locator;
12
12
  readonly incidentsBanner: Locator;
13
+ readonly instanceHeader: Locator;
14
+ readonly suspendedIcon: Locator;
13
15
  readonly userTaskOpenTasklistLink: Locator;
14
16
  readonly taskDetailsPopOver: Locator;
15
17
  readonly connectorResultVariableName: (name: string) => Locator;
@@ -47,5 +49,9 @@ declare class OperateProcessInstancePage {
47
49
  assertActiveTokenIsPresent(): Promise<void>;
48
50
  assertDetailsPopoverIsVisible(): Promise<void>;
49
51
  assertBusinessIdVisible(businessId: string): Promise<void>;
52
+ instanceIdFromUrl(): string;
53
+ private clickInstanceHeaderAction;
54
+ suspendInstance(instanceId: string): Promise<void>;
55
+ resumeInstance(instanceId: string): Promise<void>;
50
56
  }
51
57
  export { OperateProcessInstancePage, watchOperateInstanceUrl };
@@ -151,6 +151,8 @@ class OperateProcessInstancePage {
151
151
  activeIcon;
152
152
  incidentIcon;
153
153
  incidentsBanner;
154
+ instanceHeader;
155
+ suspendedIcon;
154
156
  userTaskOpenTasklistLink;
155
157
  taskDetailsPopOver;
156
158
  connectorResultVariableName;
@@ -178,6 +180,8 @@ class OperateProcessInstancePage {
178
180
  // Same test id Operate's own e2e suite uses for the incident bar
179
181
  // (camunda/camunda `operate/client/e2e-playwright/pages/ProcessInstance.ts`).
180
182
  this.incidentsBanner = page.getByTestId('incidents-banner');
183
+ this.instanceHeader = page.getByTestId('instance-header');
184
+ this.suspendedIcon = this.instanceHeader.getByTestId('SUSPENDED-icon');
181
185
  this.userTaskOpenTasklistLink = page.getByRole('link', {
182
186
  name: 'Open Tasklist',
183
187
  });
@@ -945,5 +949,37 @@ class OperateProcessInstancePage {
945
949
  });
946
950
  await (0, test_1.expect)(instanceHeader.getByText(businessId, { exact: true })).toBeVisible({ timeout: 60000 });
947
951
  }
952
+ instanceIdFromUrl() {
953
+ const match = new URL(this.page.url()).pathname.match(/\/processes\/(\d+)/);
954
+ if (!match) {
955
+ throw new Error(`Could not read a process instance id from URL ${this.page.url()}`);
956
+ }
957
+ return match[1];
958
+ }
959
+ // Below Carbon's `xlg` breakpoint the header collapses Suspend/Resume into
960
+ // an "Actions" menu instead of its own button.
961
+ async clickInstanceHeaderAction(directButtonName, collapsedMenuItemName) {
962
+ const actionsMenuButton = this.instanceHeader.getByRole('button', {
963
+ name: 'Actions',
964
+ });
965
+ const directButton = this.instanceHeader.getByRole('button', {
966
+ name: directButtonName,
967
+ });
968
+ await actionsMenuButton.or(directButton).first().waitFor({ timeout: 30000 });
969
+ if (await actionsMenuButton.isVisible()) {
970
+ await actionsMenuButton.click();
971
+ await this.page
972
+ .getByRole('menuitem', { name: collapsedMenuItemName })
973
+ .click();
974
+ return;
975
+ }
976
+ await directButton.click();
977
+ }
978
+ async suspendInstance(instanceId) {
979
+ await this.clickInstanceHeaderAction(new RegExp(`Suspend Instance ${instanceId}`), 'Suspend');
980
+ }
981
+ async resumeInstance(instanceId) {
982
+ await this.clickInstanceHeaderAction(new RegExp(`Resume Instance ${instanceId}`), 'Resume');
983
+ }
948
984
  }
949
985
  exports.OperateProcessInstancePage = OperateProcessInstancePage;
@@ -9,6 +9,8 @@ declare class TaskDetailsPage {
9
9
  readonly addVariableButton: Locator;
10
10
  readonly detailsPanel: Locator;
11
11
  readonly detailsHeader: Locator;
12
+ readonly suspendedLabel: Locator;
13
+ readonly suspendedActionsTooltip: Locator;
12
14
  readonly pendingTaskDescription: Locator;
13
15
  readonly pickATaskHeader: Locator;
14
16
  readonly emptyTaskMessage: Locator;
@@ -40,6 +42,7 @@ declare class TaskDetailsPage {
40
42
  constructor(page: Page);
41
43
  clickAssignToMeButton(): Promise<void>;
42
44
  clickUnassignButton(): Promise<void>;
45
+ assertSuspendedActionDisabled(button: Locator): Promise<void>;
43
46
  clickCompleteTaskButton(): Promise<void>;
44
47
  clickAddVariableButton(): Promise<void>;
45
48
  replaceExistingVariableValue(values: {
@@ -29,6 +29,8 @@ class TaskDetailsPage {
29
29
  addVariableButton;
30
30
  detailsPanel;
31
31
  detailsHeader;
32
+ suspendedLabel;
33
+ suspendedActionsTooltip;
32
34
  pendingTaskDescription;
33
35
  pickATaskHeader;
34
36
  emptyTaskMessage;
@@ -69,6 +71,13 @@ class TaskDetailsPage {
69
71
  name: 'Task details right panel',
70
72
  });
71
73
  this.detailsHeader = page.getByTitle('Task details header');
74
+ this.suspendedLabel = this.detailsHeader.getByText('Suspended', {
75
+ exact: true,
76
+ });
77
+ this.suspendedActionsTooltip = page.getByRole('tooltip', {
78
+ name: 'Process instance suspended. Available again when it resumes.',
79
+ exact: true,
80
+ });
72
81
  this.pendingTaskDescription = page.getByText('Pending task');
73
82
  this.pickATaskHeader = page.getByRole('heading', {
74
83
  name: 'Pick a task to work on',
@@ -123,6 +132,15 @@ class TaskDetailsPage {
123
132
  async clickUnassignButton() {
124
133
  await this.unassignButton.click();
125
134
  }
135
+ // A disabled button receives no pointer events, so the tooltip has to be
136
+ // raised by hovering its wrapper rather than the button itself.
137
+ async assertSuspendedActionDisabled(button) {
138
+ await (0, test_1.expect)(button).toBeDisabled();
139
+ await button.locator('..').hover();
140
+ await (0, test_1.expect)(this.suspendedActionsTooltip).toBeVisible();
141
+ await (0, test_1.expect)(this.suspendedActionsTooltip).toHaveText('Process instance suspended. Available again when it resumes.');
142
+ await this.page.keyboard.press('Escape');
143
+ }
126
144
  // The "Task completed" toast is a transient confirmation: the v2 webapp's
127
145
  // notification store auto-removes it after 5s, and it is never rendered at
128
146
  // all when the refreshed task list deselects the completed task before the
@@ -12,6 +12,7 @@ declare class TaskPanelPage {
12
12
  readonly processesInfoText: Locator;
13
13
  constructor(page: Page);
14
14
  taskInList(name: string): Locator;
15
+ taskLink(processName: string): Locator;
15
16
  openTask(name: string, totalTimeout?: number): Promise<void>;
16
17
  filterBy(option: 'All open tasks' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
17
18
  private openFilterControls;
@@ -73,6 +73,16 @@ class TaskPanelPage {
73
73
  taskInList(name) {
74
74
  return this.availableTasks.getByText(name, { exact: true }).first();
75
75
  }
76
+ // The link's accessible name is the task's own display name, not the
77
+ // process name -- the process name is only the card's visible subtitle, so
78
+ // find the card by that text first and read the link inside it.
79
+ taskLink(processName) {
80
+ return this.availableTasks
81
+ .locator('article')
82
+ .filter({ has: this.page.getByText(processName, { exact: true }) })
83
+ .first()
84
+ .getByRole('link');
85
+ }
76
86
  async openTask(name, totalTimeout = 1200000) {
77
87
  const deadline = Date.now() + totalTimeout;
78
88
  let lastError;
@@ -8,6 +8,8 @@ declare class OperateProcessInstancePage {
8
8
  readonly incidentIcon: Locator;
9
9
  readonly variablesList: Locator;
10
10
  readonly messageVariable: Locator;
11
+ readonly instanceHeader: Locator;
12
+ readonly suspendedIcon: Locator;
11
13
  constructor(page: Page);
12
14
  connectorResultVariableName(name: string): Promise<Locator>;
13
15
  connectorResultVariableValue(variableName: string): Promise<Locator>;
@@ -26,5 +28,9 @@ declare class OperateProcessInstancePage {
26
28
  assertActiveTokenIsPresent(): Promise<void>;
27
29
  assertBusinessIdVisible(businessId: string): Promise<void>;
28
30
  assertVariablesListVisible(timeout?: number): Promise<void>;
31
+ instanceIdFromUrl(): string;
32
+ private clickInstanceHeaderAction;
33
+ suspendInstance(instanceId: string): Promise<void>;
34
+ resumeInstance(instanceId: string): Promise<void>;
29
35
  }
30
36
  export { OperateProcessInstancePage };
@@ -14,6 +14,8 @@ class OperateProcessInstancePage {
14
14
  incidentIcon;
15
15
  variablesList;
16
16
  messageVariable;
17
+ instanceHeader;
18
+ suspendedIcon;
17
19
  constructor(page) {
18
20
  this.page = page;
19
21
  this.diagram = page.getByTestId('diagram');
@@ -29,6 +31,8 @@ class OperateProcessInstancePage {
29
31
  .getByTestId('INCIDENT-icon');
30
32
  this.variablesList = page.getByTestId('variables-list');
31
33
  this.messageVariable = page.getByTestId('variable-message');
34
+ this.instanceHeader = page.getByTestId('instance-header');
35
+ this.suspendedIcon = this.instanceHeader.getByTestId('SUSPENDED-icon');
32
36
  }
33
37
  async connectorResultVariableName(name) {
34
38
  return await this.page.getByTestId(name);
@@ -272,5 +276,37 @@ class OperateProcessInstancePage {
272
276
  }
273
277
  throw new Error(`Variables list not visible after ${Math.round(timeout / 1000)}s`);
274
278
  }
279
+ instanceIdFromUrl() {
280
+ const match = new URL(this.page.url()).pathname.match(/\/processes\/(\d+)/);
281
+ if (!match) {
282
+ throw new Error(`Could not read a process instance id from URL ${this.page.url()}`);
283
+ }
284
+ return match[1];
285
+ }
286
+ // Below Carbon's `xlg` breakpoint the header collapses Suspend/Resume into
287
+ // an "Actions" menu instead of its own button.
288
+ async clickInstanceHeaderAction(directButtonName, collapsedMenuItemName) {
289
+ const actionsMenuButton = this.instanceHeader.getByRole('button', {
290
+ name: 'Actions',
291
+ });
292
+ const directButton = this.instanceHeader.getByRole('button', {
293
+ name: directButtonName,
294
+ });
295
+ await actionsMenuButton.or(directButton).first().waitFor({ timeout: 30000 });
296
+ if (await actionsMenuButton.isVisible()) {
297
+ await actionsMenuButton.click();
298
+ await this.page
299
+ .getByRole('menuitem', { name: collapsedMenuItemName })
300
+ .click();
301
+ return;
302
+ }
303
+ await directButton.click();
304
+ }
305
+ async suspendInstance(instanceId) {
306
+ await this.clickInstanceHeaderAction(new RegExp(`Suspend Instance ${instanceId}`), 'Suspend');
307
+ }
308
+ async resumeInstance(instanceId) {
309
+ await this.clickInstanceHeaderAction(new RegExp(`Resume Instance ${instanceId}`), 'Resume');
310
+ }
275
311
  }
276
312
  exports.OperateProcessInstancePage = OperateProcessInstancePage;
@@ -9,6 +9,8 @@ declare class TaskDetailsPage {
9
9
  readonly addVariableButton: Locator;
10
10
  readonly detailsPanel: Locator;
11
11
  readonly detailsHeader: Locator;
12
+ readonly suspendedLabel: Locator;
13
+ readonly suspendedActionsTooltip: Locator;
12
14
  readonly pendingTaskDescription: Locator;
13
15
  readonly pickATaskHeader: Locator;
14
16
  readonly emptyTaskMessage: Locator;
@@ -36,6 +38,7 @@ declare class TaskDetailsPage {
36
38
  constructor(page: Page);
37
39
  clickAssignToMeButton(): Promise<void>;
38
40
  clickUnassignButton(): Promise<void>;
41
+ assertSuspendedActionDisabled(button: Locator): Promise<void>;
39
42
  clickCompleteTaskButton(): Promise<void>;
40
43
  clickAddVariableButton(): Promise<void>;
41
44
  replaceExistingVariableValue(values: {
@@ -29,6 +29,8 @@ class TaskDetailsPage {
29
29
  addVariableButton;
30
30
  detailsPanel;
31
31
  detailsHeader;
32
+ suspendedLabel;
33
+ suspendedActionsTooltip;
32
34
  pendingTaskDescription;
33
35
  pickATaskHeader;
34
36
  emptyTaskMessage;
@@ -65,6 +67,13 @@ class TaskDetailsPage {
65
67
  name: 'Task details right panel',
66
68
  });
67
69
  this.detailsHeader = page.getByTitle('Task details header');
70
+ this.suspendedLabel = this.detailsHeader.getByText('Suspended', {
71
+ exact: true,
72
+ });
73
+ this.suspendedActionsTooltip = page.getByRole('tooltip', {
74
+ name: 'Process instance suspended. Available again when it resumes.',
75
+ exact: true,
76
+ });
68
77
  this.pendingTaskDescription = page.getByText('Pending task');
69
78
  this.pickATaskHeader = page.getByRole('heading', {
70
79
  name: 'Pick a task to work on',
@@ -120,6 +129,15 @@ class TaskDetailsPage {
120
129
  async clickUnassignButton() {
121
130
  await this.unassignButton.click();
122
131
  }
132
+ // A disabled button receives no pointer events, so the tooltip has to be
133
+ // raised by hovering its wrapper rather than the button itself.
134
+ async assertSuspendedActionDisabled(button) {
135
+ await (0, test_1.expect)(button).toBeDisabled();
136
+ await button.locator('..').hover();
137
+ await (0, test_1.expect)(this.suspendedActionsTooltip).toBeVisible();
138
+ await (0, test_1.expect)(this.suspendedActionsTooltip).toHaveText('Process instance suspended. Available again when it resumes.');
139
+ await this.page.keyboard.press('Escape');
140
+ }
123
141
  async clickCompleteTaskButton() {
124
142
  await this.completeTaskButton.click({ timeout: 60000 });
125
143
  await (0, test_1.expect)(this.taskCompletedBanner).toBeVisible({
@@ -14,6 +14,7 @@ declare class TaskPanelPage {
14
14
  readonly licenseKeyTagNonProduction: Locator;
15
15
  readonly licenseKeyTagProduction: Locator;
16
16
  constructor(page: Page);
17
+ taskLink(processName: string): Locator;
17
18
  openTask(name: string, assignButton?: boolean): Promise<void>;
18
19
  filterBy(option: 'All open' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
19
20
  private openFilterControls;
@@ -79,6 +79,16 @@ class TaskPanelPage {
79
79
  exact: true,
80
80
  });
81
81
  }
82
+ // The link's accessible name is the task's own display name, not the
83
+ // process name -- the process name is only the card's visible subtitle, so
84
+ // find the card by that text first and read the link inside it.
85
+ taskLink(processName) {
86
+ return this.availableTasks
87
+ .locator('article')
88
+ .filter({ has: this.page.getByText(processName, { exact: true }) })
89
+ .first()
90
+ .getByRole('link');
91
+ }
82
92
  async openTask(name, assignButton = true) {
83
93
  const maxAttempts = 10;
84
94
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
@@ -9,6 +9,8 @@ const fileUpload_1 = require("../../utils/fileUpload");
9
9
  const expectTextWithPagination_1 = require("../../utils/assertionHelpers/expectTextWithPagination");
10
10
  const expectTextWithRetry_1 = require("../../utils/assertionHelpers/expectTextWithRetry");
11
11
  const users_1 = require("../../utils/users");
12
+ const OperateProcessInstancePage_1 = require("../../pages/8.11/OperateProcessInstancePage");
13
+ const apiHelpers_1 = require("../../utils/apiHelpers");
12
14
  const testUser = (0, users_1.getTestUser)('nineteenthUser');
13
15
  _8_11_1.test.describe.configure({ mode: 'parallel' });
14
16
  _8_11_1.test.describe('HTO User Flow Tests', () => {
@@ -355,4 +357,100 @@ _8_11_1.test.describe('HTO User Flow Tests', () => {
355
357
  await operateProcessInstancePage.assertProcessVariableHasDocumentCount('Upload_Files', 3);
356
358
  });
357
359
  });
360
+ // Requires merge commit 037526fc174 (the fix for
361
+ // https://github.com/camunda/camunda/issues/68919); 8.11 already has it.
362
+ (0, _8_11_1.test)('A suspended process instance marks its user task in Tasklist and blocks its actions', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, taskPanelPage, taskDetailsPage, }) => {
363
+ _8_11_1.test.slow();
364
+ const processName = 'Suspended_User_Task_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
365
+ let instanceId = '';
366
+ await _8_11_1.test.step('Navigate to Web Modeler', async () => {
367
+ await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
368
+ timeout: 120000,
369
+ });
370
+ await appsPage.clickCamundaApps();
371
+ await appsPage.clickModeler();
372
+ await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
373
+ timeout: 180000,
374
+ });
375
+ });
376
+ await _8_11_1.test.step('Create BPMN Diagram with a Camunda User Task and Start Process Instance', async () => {
377
+ await modelerHomePage.clickCrossComponentProjectFolder();
378
+ await modelerHomePage.clickDiagramTypeDropdown();
379
+ await modelerHomePage.clickBpmnTemplateOption();
380
+ await modelerCreatePage.modelCamundaUserTaskDiagram(processName);
381
+ await modelerCreatePage.runProcessInstance(clusterName);
382
+ await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible({
383
+ timeout: 120000,
384
+ });
385
+ });
386
+ // Open Operate in a second tab -- `page` stays on Tasklist for the rest
387
+ // of the test, so the task's in-place update can be observed there while
388
+ // suspend/resume happens from this tab.
389
+ const watchedInstanceUrl = (0, OperateProcessInstancePage_1.watchOperateInstanceUrl)(page.context());
390
+ const operateTab = await (0, UtilitiesPage_1.openAppTabWithRetry)(page, modelerCreatePage.viewProcessInstanceLink);
391
+ const operateProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
392
+ try {
393
+ await _8_11_1.test.step('Open and Assign the Task in Tasklist', async () => {
394
+ await appsPage.clickCamundaApps();
395
+ await appsPage.clickTasklist(clusterName);
396
+ await (0, test_1.expect)(taskPanelPage.taskListPageBanner).toBeVisible({
397
+ timeout: 30000,
398
+ });
399
+ await (0, UtilitiesPage_1.assertPageTextWithRetry)(page, processName, false, 60000);
400
+ await taskPanelPage.openTask(processName);
401
+ await taskDetailsPage.clickAssignToMeButton();
402
+ });
403
+ await _8_11_1.test.step('Suspend the Instance from the Second Operate Tab', async () => {
404
+ await operateProcessInstancePage.rememberInstanceUrl(60000, watchedInstanceUrl);
405
+ await operateProcessInstancePage.closePopOverIfVisible();
406
+ instanceId = operateProcessInstancePage.instanceIdFromUrl();
407
+ await operateProcessInstancePage.suspendInstance(instanceId);
408
+ await (0, test_1.expect)(operateProcessInstancePage.suspendedIcon).toBeVisible({
409
+ timeout: 60000,
410
+ });
411
+ });
412
+ await _8_11_1.test.step('Assert the Open Task Updates In Place to Suspended, Without Reopening It', async () => {
413
+ await (0, test_1.expect)(taskPanelPage.taskLink(processName)).toHaveAccessibleName(/\(suspended\)$/, { timeout: 60000 });
414
+ await (0, test_1.expect)(taskDetailsPage.suspendedLabel).toBeVisible({
415
+ timeout: 60000,
416
+ });
417
+ await (0, test_1.expect)(taskDetailsPage.unassignButton).toBeDisabled();
418
+ await (0, test_1.expect)(taskDetailsPage.completeTaskButton).toBeDisabled();
419
+ await taskDetailsPage.assertSuspendedActionDisabled(taskDetailsPage.unassignButton);
420
+ });
421
+ await _8_11_1.test.step('Resume the Instance in Operate and Complete the Task, Still Without Reopening It', async () => {
422
+ await operateProcessInstancePage.resumeInstance(instanceId);
423
+ await (0, test_1.expect)(operateProcessInstancePage.suspendedIcon).toBeHidden({
424
+ timeout: 60000,
425
+ });
426
+ await (0, test_1.expect)(taskPanelPage.taskLink(processName)).not.toHaveAccessibleName(/\(suspended\)$/, { timeout: 60000 });
427
+ await (0, test_1.expect)(taskDetailsPage.suspendedLabel).toBeHidden({
428
+ timeout: 60000,
429
+ });
430
+ await (0, test_1.expect)(taskDetailsPage.completeTaskButton).toBeEnabled();
431
+ await taskDetailsPage.clickCompleteTaskButton();
432
+ });
433
+ await _8_11_1.test.step('Assert the Instance Completes in Operate', async () => {
434
+ await operateTab.reload();
435
+ await (0, test_1.expect)(operateProcessInstancePage.completedIcon).toBeVisible({
436
+ timeout: 60000,
437
+ });
438
+ });
439
+ }
440
+ finally {
441
+ await operateTab.close();
442
+ // Best-effort: completing the task above already finishes the
443
+ // instance, so this is only load-bearing when an earlier step failed
444
+ // and left it suspended (or otherwise unfinished).
445
+ if (instanceId) {
446
+ try {
447
+ const authToken = await (0, apiHelpers_1.authSaasAPI)();
448
+ await (0, apiHelpers_1.cancelProcessInstance)(instanceId, authToken, 'saas');
449
+ }
450
+ catch (cleanupError) {
451
+ console.warn(`Could not cancel process instance ${instanceId} during cleanup: ${cleanupError}`);
452
+ }
453
+ }
454
+ }
455
+ });
358
456
  });
@@ -67,7 +67,15 @@ _8_11_1.test.describe('Agentic Control Plane Dashboard API Tests @agentic-dashbo
67
67
  (0, test_1.expect)(joined.includes(agenticDashboardHelpers_1.LEGACY_TERMINOLOGY)).toBeFalsy();
68
68
  });
69
69
  (0, _8_11_1.test)('Changing the date range triggers refreshed report API calls', async ({ page, appsPage, optimizeHomePage, }) => {
70
- await (0, agenticDashboardHelpers_1.openAgenticControlPlane)(page, appsPage, optimizeHomePage, clusterName);
70
+ const initialResponses = await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
71
+ await (0, agenticDashboardHelpers_1.openAgenticControlPlane)(page, appsPage, optimizeHomePage, clusterName);
72
+ }, { includeNonJsonReportEvaluations: true });
73
+ // Precondition: the dashboard must have loaded healthily before the date
74
+ // range is changed, otherwise a backend 5xx burst on the initial load is
75
+ // misattributed to the date-range refresh.
76
+ const initialReports = await (0, agenticDashboardHelpers_1.reloadUntilDashboardReportsHealthy)(page, initialResponses);
77
+ (0, test_1.expect)(initialReports.filter((r) => r.status !== 200).map((r) => r.url), 'initial dashboard report evaluations returned non-200').toEqual([]);
78
+ (0, test_1.expect)(initialReports.length).toBeGreaterThan(0);
71
79
  let dateRangeChanged = false;
72
80
  const responses = await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
73
81
  dateRangeChanged = await (0, agenticDashboardHelpers_1.changeDashboardDateRange)(page);
@@ -76,7 +84,7 @@ _8_11_1.test.describe('Agentic Control Plane Dashboard API Tests @agentic-dashbo
76
84
  const reportResponses = responses.filter(agenticDashboardHelpers_1.isReportEvaluateResponse);
77
85
  (0, test_1.expect)(reportResponses.length).toBeGreaterThan(0);
78
86
  for (const response of reportResponses) {
79
- (0, test_1.expect)(response.status).toBe(200);
87
+ (0, test_1.expect)(response.status, `${response.method} ${response.url}`).toBe(200);
80
88
  }
81
89
  });
82
90
  (0, _8_11_1.test)('Report payloads do not expose Phase 1 out-of-scope details', async ({ page, appsPage, optimizeHomePage, }) => {
@@ -6,6 +6,11 @@ const _setup_1 = require("../../test-setup.js");
6
6
  const sleep_1 = require("../../utils/sleep");
7
7
  const UtilitiesPage_1 = require("../../pages/SM-8.11/UtilitiesPage");
8
8
  const resetSession_1 = require("../../utils/resetSession");
9
+ const NavigationPage_1 = require("../../pages/SM-8.11/NavigationPage");
10
+ const OperateHomePage_1 = require("../../pages/SM-8.11/OperateHomePage");
11
+ const OperateProcessesPage_1 = require("../../pages/SM-8.11/OperateProcessesPage");
12
+ const OperateProcessInstancePage_1 = require("../../pages/SM-8.11/OperateProcessInstancePage");
13
+ const apiHelpers_1 = require("../../utils/apiHelpers");
9
14
  SM_8_11_1.test.describe.configure({ mode: 'parallel' });
10
15
  SM_8_11_1.test.describe('HTO User Flow Tests', () => {
11
16
  const mtTenant = process.env.IS_MT === 'true' ? '<default>' : '';
@@ -407,4 +412,92 @@ SM_8_11_1.test.describe('HTO User Flow Tests', () => {
407
412
  });
408
413
  });
409
414
  });
415
+ // Requires merge commit 037526fc174 (the fix for
416
+ // https://github.com/camunda/camunda/issues/68919); 8.11 already has it.
417
+ (0, SM_8_11_1.test)('A suspended process instance marks its user task in Tasklist and blocks its actions', async ({ page, context, modelerHomePage, navigationPage, modelerCreatePage, taskPanelPage, taskDetailsPage, }) => {
418
+ SM_8_11_1.test.slow();
419
+ const processName = 'Suspended_User_Task_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
420
+ let instanceId = '';
421
+ await SM_8_11_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
422
+ await modelerHomePage.clickCrossComponentProjectFolder();
423
+ await modelerHomePage.clickDiagramTypeDropdown();
424
+ await modelerHomePage.clickBpmnTemplateOption();
425
+ });
426
+ await SM_8_11_1.test.step('Create BPMN Diagram with a Camunda User Task and Start Process Instance', async () => {
427
+ await modelerCreatePage.modelCamundaUserTaskDiagram(processName);
428
+ await modelerCreatePage.runProcessInstance('', mtTenant);
429
+ });
430
+ await SM_8_11_1.test.step('Open and Assign the Task in Tasklist', async () => {
431
+ await navigationPage.goToTasklist();
432
+ await (0, UtilitiesPage_1.assertPageTextWithRetry)(page, processName, false, 60000);
433
+ await taskPanelPage.openTask(processName);
434
+ await taskDetailsPage.clickAssignToMeButton();
435
+ });
436
+ // A second tab so the task's in-place update stays observable on `page`
437
+ // while suspend/resume happens from Operate.
438
+ const operatePage = await context.newPage();
439
+ const operateNavigationPage = new NavigationPage_1.NavigationPage(operatePage);
440
+ const operateHomePage = new OperateHomePage_1.OperateHomePage(operatePage);
441
+ const operateProcessesPage = new OperateProcessesPage_1.OperateProcessesPage(operatePage);
442
+ const operateProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operatePage);
443
+ try {
444
+ await SM_8_11_1.test.step('Open the Instance in Operate on a Second Page and Suspend It', async () => {
445
+ await operateNavigationPage.goToOperate();
446
+ await operateHomePage.clickProcessesTab();
447
+ await operateProcessesPage.clickProcessInstanceLink(processName);
448
+ await (0, test_1.expect)(operateProcessInstancePage.activeIcon).toBeVisible({
449
+ timeout: 120000,
450
+ });
451
+ instanceId = operateProcessInstancePage.instanceIdFromUrl();
452
+ await operateProcessInstancePage.suspendInstance(instanceId);
453
+ await (0, test_1.expect)(operateProcessInstancePage.suspendedIcon).toBeVisible({
454
+ timeout: 60000,
455
+ });
456
+ });
457
+ await SM_8_11_1.test.step('Assert the Open Task Updates In Place to Suspended, Without Reopening It', async () => {
458
+ await (0, test_1.expect)(taskPanelPage.taskLink(processName)).toHaveAccessibleName(/\(suspended\)$/, { timeout: 60000 });
459
+ await (0, test_1.expect)(taskDetailsPage.suspendedLabel).toBeVisible({
460
+ timeout: 60000,
461
+ });
462
+ await (0, test_1.expect)(taskDetailsPage.unassignButton).toBeDisabled();
463
+ await (0, test_1.expect)(taskDetailsPage.completeTaskButton).toBeDisabled();
464
+ await taskDetailsPage.assertSuspendedActionDisabled(taskDetailsPage.unassignButton);
465
+ });
466
+ await SM_8_11_1.test.step('Resume the Instance in Operate and Complete the Task, Still Without Reopening It', async () => {
467
+ await operateProcessInstancePage.resumeInstance(instanceId);
468
+ await (0, test_1.expect)(operateProcessInstancePage.suspendedIcon).toBeHidden({
469
+ timeout: 60000,
470
+ });
471
+ await (0, test_1.expect)(taskPanelPage.taskLink(processName)).not.toHaveAccessibleName(/\(suspended\)$/, { timeout: 60000 });
472
+ await (0, test_1.expect)(taskDetailsPage.suspendedLabel).toBeHidden({
473
+ timeout: 60000,
474
+ });
475
+ await (0, test_1.expect)(taskDetailsPage.completeTaskButton).toBeEnabled();
476
+ await taskDetailsPage.clickCompleteTaskButton();
477
+ });
478
+ await SM_8_11_1.test.step('Assert the Instance Completes in Operate', async () => {
479
+ await operatePage.reload();
480
+ await operateHomePage.clickProcessesTab();
481
+ await operateProcessesPage.clickProcessInstanceLink(processName, 'completed');
482
+ await (0, test_1.expect)(operateProcessInstancePage.completedIcon).toBeVisible({
483
+ timeout: 60000,
484
+ });
485
+ });
486
+ }
487
+ finally {
488
+ await operatePage.close();
489
+ // Best-effort: completing the task above already finishes the
490
+ // instance, so this is only load-bearing when an earlier step failed
491
+ // and left it suspended (or otherwise unfinished).
492
+ if (instanceId) {
493
+ try {
494
+ const authToken = await (0, apiHelpers_1.authSmAPI)();
495
+ await (0, apiHelpers_1.cancelProcessInstance)(instanceId, authToken, 'sm');
496
+ }
497
+ catch (cleanupError) {
498
+ console.warn(`Could not cancel process instance ${instanceId} during cleanup: ${cleanupError}`);
499
+ }
500
+ }
501
+ }
502
+ });
410
503
  });
@@ -29,7 +29,16 @@ export declare function changeDashboardDateRange(page: Page): Promise<boolean>;
29
29
  export declare function isAgenticDashboardDefinitionResponse(response: CapturedResponse): boolean;
30
30
  export declare function isReportEvaluateResponse(response: CapturedResponse): boolean;
31
31
  export declare function isLikelyDashboardApiResponse(response: CapturedResponse): boolean;
32
- export declare function captureDashboardResponses(page: Page, action: () => Promise<void>): Promise<CapturedResponse[]>;
32
+ export declare function captureDashboardResponses(page: Page, action: () => Promise<void>, options?: {
33
+ includeNonJsonReportEvaluations?: boolean;
34
+ }): Promise<CapturedResponse[]>;
35
+ /**
36
+ * Waits until the agentic dashboard's initial report evaluations all return
37
+ * 200, reloading the page (up to `maxReloads` times) while the Optimize
38
+ * backend is still answering some of them with 5xx. Returns the report
39
+ * evaluate responses of the last load so the caller can assert on them.
40
+ */
41
+ export declare function reloadUntilDashboardReportsHealthy(page: Page, initialResponses: CapturedResponse[], maxReloads?: number): Promise<CapturedResponse[]>;
33
42
  export declare function parseJsonResponseBodies(responses: CapturedResponse[]): unknown[];
34
43
  export declare function findReportByName(bodies: unknown[], name: string): unknown;
35
44
  export declare function getReportNumericResult(body: unknown): number | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectSingleProcessIfPossible = exports.dashboardHasComparisonTile = exports.getReportNumericResult = exports.findReportByName = exports.parseJsonResponseBodies = exports.captureDashboardResponses = exports.isLikelyDashboardApiResponse = exports.isReportEvaluateResponse = exports.isAgenticDashboardDefinitionResponse = exports.changeDashboardDateRange = exports.openAgenticControlPlane = exports.clickFirstVisibleByName = exports.LEGACY_TERMINOLOGY = exports.CURRENT_TERMINOLOGY = exports.EXECUTION_REPORT_NAME = exports.REPORT_EVALUATE_PATH_PATTERN = exports.AGENTIC_DASHBOARD_DEFINITION_PATH = void 0;
3
+ exports.selectSingleProcessIfPossible = exports.dashboardHasComparisonTile = exports.getReportNumericResult = exports.findReportByName = exports.parseJsonResponseBodies = exports.reloadUntilDashboardReportsHealthy = exports.captureDashboardResponses = exports.isLikelyDashboardApiResponse = exports.isReportEvaluateResponse = exports.isAgenticDashboardDefinitionResponse = exports.changeDashboardDateRange = exports.openAgenticControlPlane = exports.clickFirstVisibleByName = exports.LEGACY_TERMINOLOGY = exports.CURRENT_TERMINOLOGY = exports.EXECUTION_REPORT_NAME = exports.REPORT_EVALUATE_PATH_PATTERN = exports.AGENTIC_DASHBOARD_DEFINITION_PATH = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  exports.AGENTIC_DASHBOARD_DEFINITION_PATH = '/api/dashboard/agentic';
6
6
  exports.REPORT_EVALUATE_PATH_PATTERN = /\/api\/report\/[^/]+\/evaluate/;
@@ -90,7 +90,7 @@ function isLikelyDashboardApiResponse(response) {
90
90
  isReportEvaluateResponse(response));
91
91
  }
92
92
  exports.isLikelyDashboardApiResponse = isLikelyDashboardApiResponse;
93
- async function captureDashboardResponses(page, action) {
93
+ async function captureDashboardResponses(page, action, options = {}) {
94
94
  const captured = [];
95
95
  const listener = async (response) => {
96
96
  try {
@@ -99,7 +99,11 @@ async function captureDashboardResponses(page, action) {
99
99
  if (method !== 'GET' && method !== 'POST')
100
100
  return;
101
101
  const contentType = response.headers()['content-type'] || '';
102
- if (!contentType.includes('application/json'))
102
+ // Opt-in: keep non-JSON report evaluations (e.g. a gateway 502 served
103
+ // as text/html) so health checks see the failure instead of dropping it.
104
+ const keepNonJson = options.includeNonJsonReportEvaluations &&
105
+ exports.REPORT_EVALUATE_PATH_PATTERN.test(response.url().toLowerCase());
106
+ if (!contentType.includes('application/json') && !keepNonJson)
103
107
  return;
104
108
  const bodyText = await response.text();
105
109
  captured.push({
@@ -122,6 +126,24 @@ async function captureDashboardResponses(page, action) {
122
126
  return captured;
123
127
  }
124
128
  exports.captureDashboardResponses = captureDashboardResponses;
129
+ /**
130
+ * Waits until the agentic dashboard's initial report evaluations all return
131
+ * 200, reloading the page (up to `maxReloads` times) while the Optimize
132
+ * backend is still answering some of them with 5xx. Returns the report
133
+ * evaluate responses of the last load so the caller can assert on them.
134
+ */
135
+ async function reloadUntilDashboardReportsHealthy(page, initialResponses, maxReloads = 3) {
136
+ const isHealthy = (reports) => reports.length > 0 && reports.every((r) => r.status === 200);
137
+ let reports = initialResponses.filter(isReportEvaluateResponse);
138
+ for (let attempt = 0; attempt < maxReloads && !isHealthy(reports); attempt++) {
139
+ const responses = await captureDashboardResponses(page, async () => {
140
+ await page.reload({ waitUntil: 'domcontentloaded' });
141
+ }, { includeNonJsonReportEvaluations: true });
142
+ reports = responses.filter(isReportEvaluateResponse);
143
+ }
144
+ return reports;
145
+ }
146
+ exports.reloadUntilDashboardReportsHealthy = reloadUntilDashboardReportsHealthy;
125
147
  function parseJsonResponseBodies(responses) {
126
148
  const parsed = [];
127
149
  for (const response of responses) {
@@ -23,6 +23,7 @@ export declare function waitForInboundWebhookRegistered(webhookPath: string, bas
23
23
  export declare function waitForOrchestrationClusterReady(managementUrl?: string, timeoutMs?: number): Promise<void>;
24
24
  export declare function deployProcess(filePath: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string): Promise<number | null>;
25
25
  export declare function createProcessInstance(processDefinitionKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, variables?: Record<string, unknown>): Promise<string>;
26
+ export declare function cancelProcessInstance(processInstanceKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string): Promise<void>;
26
27
  export declare function waitForProcessInstanceVisible(processInstanceKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, maxAttempts?: number, retryDelayMs?: number): Promise<void>;
27
28
  export declare function createTenantClusterVariable(authToken: string, environment: 'saas' | 'sm', tenantId: string, variableName: string, variableValue: unknown, clusterType?: string): Promise<void>;
28
29
  export declare function createJsonClusterVariable(authToken?: string, environment?: 'saas' | 'sm', customVariableName?: string, customVariableValue?: string, clusterType?: string): Promise<void>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.updateClusterDataFilters = exports.getClusterDataFilters = exports.getTestClusterUuid = exports.authConsoleManagementAPI = exports.updateCollectionScope = exports.createSingleProcessReport = exports.setOptimizeSharing = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.loginToOptimizeSession = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.createTenantClusterVariable = exports.waitForProcessInstanceVisible = exports.createProcessInstance = exports.deployProcess = exports.waitForOrchestrationClusterReady = exports.waitForInboundWebhookRegistered = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.parseRetryAfterMs = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOnTransientApiError = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertUnauthorizedResponseBody = exports.expectUnauthorizedErrorBody = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
6
+ exports.updateClusterDataFilters = exports.getClusterDataFilters = exports.getTestClusterUuid = exports.authConsoleManagementAPI = exports.updateCollectionScope = exports.createSingleProcessReport = exports.setOptimizeSharing = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.loginToOptimizeSession = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.createTenantClusterVariable = exports.waitForProcessInstanceVisible = exports.cancelProcessInstance = exports.createProcessInstance = exports.deployProcess = exports.waitForOrchestrationClusterReady = exports.waitForInboundWebhookRegistered = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.parseRetryAfterMs = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOnTransientApiError = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertUnauthorizedResponseBody = exports.expectUnauthorizedErrorBody = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
7
7
  const test_1 = require("@playwright/test");
8
8
  const sleep_1 = require("./sleep");
9
9
  const randomSleep_1 = require("./randomSleep");
@@ -632,6 +632,18 @@ async function createProcessInstance(processDefinitionKey, authToken, environmen
632
632
  return String(processInstanceKey);
633
633
  }
634
634
  exports.createProcessInstance = createProcessInstance;
635
+ // Best-effort cleanup. 409 means the instance is already terminal
636
+ // (completed/cancelled), which is a successful cleanup, not a failure.
637
+ async function cancelProcessInstance(processInstanceKey, authToken, environment, clusterType) {
638
+ apiRequestContext = await getApiRequestContext();
639
+ const url = buildZeebeApiUrl(`/v2/process-instances/${processInstanceKey}/cancellation`, environment, clusterType);
640
+ const response = await apiRequestContext.post(url, {
641
+ headers: { Authorization: authToken ?? '' },
642
+ data: {},
643
+ });
644
+ (0, test_1.expect)([204, 404, 409], `cancelProcessInstance failed for ${processInstanceKey}: HTTP ${response.status()}`).toContain(response.status());
645
+ }
646
+ exports.cancelProcessInstance = cancelProcessInstance;
635
647
  // Poll the eventually-consistent GET /v2/process-instances/{key} endpoint until
636
648
  // the instance has been exported to secondary storage (HTTP 200). Immediately
637
649
  // after creation this endpoint returns 404 until the Camunda Exporter syncs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1667",
3
+ "version": "0.0.1669",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",