@camunda/e2e-test-suite 0.0.939 → 0.0.940

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.
@@ -121,11 +121,20 @@ class TaskDetailsPage {
121
121
  async clickUnassignButton() {
122
122
  await this.unassignButton.click();
123
123
  }
124
+ // The "Task completed" toast is a transient confirmation: the v2 webapp's
125
+ // notification store auto-removes it after 5s, and it is never rendered at
126
+ // all when the refreshed task list deselects the completed task before the
127
+ // completion state machine reaches CompletionSucceeded (which is what the
128
+ // nightly trace showed - the task was completed, but no toast ever entered
129
+ // the DOM). Accept the task's own completed state as well: the details panel
130
+ // only renders "Completion date" once the task has one, so this confirms the
131
+ // completion rather than weakening the check.
124
132
  async clickCompleteTaskButton() {
125
133
  await this.completeTaskButton.click({ timeout: 60000 });
126
- await (0, test_1.expect)(this.page.getByText('Task completed')).toBeVisible({
127
- timeout: 60000,
128
- });
134
+ await (0, test_1.expect)(this.page
135
+ .getByText('Task completed')
136
+ .or(this.detailsPanel.getByText('Completion date'))
137
+ .first()).toBeVisible({ timeout: 60000 });
129
138
  await this.page.reload();
130
139
  }
131
140
  async clickAddVariableButton() {
@@ -249,7 +249,11 @@ async function assertPageTextWithRetry(page, text, notVisible = false, timeout =
249
249
  }
250
250
  exports.assertPageTextWithRetry = assertPageTextWithRetry;
251
251
  async function completeTaskWithRetry(taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries = 3) {
252
+ const openTask = taskPanelPage.availableTasks
253
+ .getByText(taskName, { exact: true })
254
+ .first();
252
255
  for (let attempt = 0; attempt < maxRetries; attempt++) {
256
+ let completionRequested = false;
253
257
  try {
254
258
  await taskPanelPage.openTask(taskName);
255
259
  await (0, test_1.expect)(taskDetailsPage.detailsInfo.getByText(taskName, { exact: true })).toBeVisible();
@@ -257,11 +261,27 @@ async function completeTaskWithRetry(taskPanelPage, taskDetailsPage, taskName, t
257
261
  await taskDetailsPage.clickAssignToMeButton();
258
262
  }
259
263
  await (0, test_1.expect)(taskDetailsPage.detailsPanel.getByText(taskPriority)).toBeVisible();
264
+ completionRequested = true;
260
265
  await taskDetailsPage.clickCompleteTaskButton();
261
- await (0, test_1.expect)(taskPanelPage.availableTasks.getByText(taskName, { exact: true }).first()).not.toBeVisible({ timeout: 30000 });
266
+ await (0, test_1.expect)(openTask).not.toBeVisible({ timeout: 30000 });
262
267
  return;
263
268
  }
264
269
  catch (error) {
270
+ // Once the Complete Task click has gone out, the task may well have been
271
+ // completed even though its confirmation was missed. Retrying blindly
272
+ // re-enters openTask, which waits 120s per attempt for a task that no
273
+ // longer exists and exhausts the 12 min test timeout, so first check the
274
+ // durable signal: the task leaving the open task list.
275
+ if (completionRequested) {
276
+ const taskGone = await openTask
277
+ .waitFor({ state: 'hidden', timeout: 30000 })
278
+ .then(() => true)
279
+ .catch(() => false);
280
+ if (taskGone) {
281
+ console.warn(`Confirmation for completing task ${taskName} was missed, but the task left the open task list - treating it as completed.`);
282
+ return;
283
+ }
284
+ }
265
285
  if (attempt < maxRetries - 1) {
266
286
  console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}. Retrying...`);
267
287
  await (0, sleep_1.sleep)(2000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.939",
3
+ "version": "0.0.940",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",