@camunda/e2e-test-suite 0.0.1308 → 0.0.1309

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,7 +10,7 @@ declare class TaskPanelPage {
10
10
  readonly expandButton: Locator;
11
11
  readonly processesInfoText: Locator;
12
12
  constructor(page: Page);
13
- openTask(name: string): Promise<void>;
13
+ openTask(name: string, taskKeys?: string[]): Promise<void>;
14
14
  filterBy(option: 'All open' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
15
15
  taskCount(name: string): Promise<number>;
16
16
  clickTasksTab(): Promise<void>;
@@ -30,7 +30,7 @@ class TaskPanelPage {
30
30
  });
31
31
  this.processesInfoText = page.getByText('Browse and run processes published by your organization');
32
32
  }
33
- async openTask(name) {
33
+ async openTask(name, taskKeys) {
34
34
  let attempts = 0;
35
35
  // Tasklist's importer can lag well behind Zeebe under heavy concurrent
36
36
  // load from the sibling chromium-v1/chromium-v2 projects sharing one
@@ -40,7 +40,13 @@ class TaskPanelPage {
40
40
  const maxAttempts = 10;
41
41
  while (attempts < maxAttempts) {
42
42
  try {
43
- const task = this.availableTasks.getByText(name, { exact: true }).first();
43
+ // When the caller knows its own task's key(s), match the task link by
44
+ // key instead of by name: a same-named task left behind by an earlier
45
+ // attempt or by the sibling chromium-v1/chromium-v2 project would
46
+ // otherwise be opened and completed instead of this run's task.
47
+ const task = (taskKeys?.length
48
+ ? this.availableTasks.locator(taskKeys.map((key) => `a[href*="/tasklist/${key}"]`).join(', '))
49
+ : this.availableTasks.getByText(name, { exact: true })).first();
44
50
  await task.waitFor({ state: 'visible', timeout: 120000 });
45
51
  await task.click({ timeout: 120000 });
46
52
  return;
@@ -8,6 +8,31 @@ const sleep_1 = require("../../utils/sleep");
8
8
  const users_1 = require("../../utils/users");
9
9
  const testUser = (0, users_1.getTestUser)('fourteenthUser');
10
10
  let authToken;
11
+ // Poll the V2 API until the process instance's user task exists and return
12
+ // the keys Tasklist may use in the task link (userTaskKey on Tasklist v2,
13
+ // the element instance key on v1).
14
+ async function waitForUserTaskKeys(processInstanceKey, maxAttempts = 120, retryDelayMs = 10000) {
15
+ const apiRequestContext = await (0, apiHelpers_1.getApiRequestContext)();
16
+ const url = (0, apiHelpers_1.buildZeebeApiUrl)('/v2/user-tasks/search');
17
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
18
+ const response = await apiRequestContext.post(url, {
19
+ headers: { Authorization: authToken },
20
+ data: { filter: { processInstanceKey: String(processInstanceKey) } },
21
+ });
22
+ if (response.status() === 200) {
23
+ const task = (await response.json())?.items?.[0];
24
+ if (task?.userTaskKey != null) {
25
+ return [task.userTaskKey, task.elementInstanceKey]
26
+ .filter((key) => key != null)
27
+ .map(String);
28
+ }
29
+ }
30
+ if (attempt < maxAttempts) {
31
+ await (0, sleep_1.sleep)(retryDelayMs);
32
+ }
33
+ }
34
+ throw new Error(`No user task for process instance ${processInstanceKey} after ${maxAttempts} attempts`);
35
+ }
11
36
  // The shared fixtures under resources/agentic_ai/ were migrated to the v2 AI
12
37
  // Agent element template (task type io.camunda.agenticai:aiagent:task:2).
13
38
  // That connector only ships from connectors stable/8.10 onwards - stable/8.8
@@ -84,10 +109,11 @@ _8_8_1.test.describe('Agentic Orchestation User Flows', () => {
84
109
  await operateProcessInstancePage.assertActiveTokenIsPresent();
85
110
  });
86
111
  await _8_8_1.test.step('User can view the agent feedback on tasklist', async () => {
112
+ const taskKeys = await waitForUserTaskKeys(instanceKey);
87
113
  await appsPage.clickCamundaApps();
88
114
  await appsPage.clickTasklist(clusterName);
89
115
  await (0, sleep_1.sleep)(5000);
90
- await taskPanelPage.openTask(`AI Agent Chat With Tools ${params.provider}`);
116
+ await taskPanelPage.openTask(`AI Agent Chat With Tools ${params.provider}`, taskKeys);
91
117
  await taskDetailsPage.clickAssignToMeButton();
92
118
  });
93
119
  await _8_8_1.test.step('User can view the agent response and complete the task', async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1308",
3
+ "version": "0.0.1309",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",