@camunda/e2e-test-suite 0.0.958 → 0.0.959

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.
@@ -225,6 +225,7 @@ async function assertPageTextWithRetry(page, text, notVisible = false, timeout =
225
225
  exports.assertPageTextWithRetry = assertPageTextWithRetry;
226
226
  async function completeTaskWithRetry(taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries = 3) {
227
227
  for (let attempt = 0; attempt < maxRetries; attempt++) {
228
+ let completeClicked = false;
228
229
  try {
229
230
  await taskPanelPage.openTask(taskName);
230
231
  await (0, test_1.expect)(taskDetailsPage.detailsInfo.getByText(taskName, { exact: true })).toBeVisible();
@@ -232,11 +233,30 @@ async function completeTaskWithRetry(taskPanelPage, taskDetailsPage, taskName, t
232
233
  await taskDetailsPage.clickAssignToMeButton();
233
234
  }
234
235
  await (0, test_1.expect)(taskDetailsPage.detailsPanel.getByText(taskPriority)).toBeVisible();
236
+ completeClicked = true;
235
237
  await taskDetailsPage.clickCompleteTaskButton();
236
238
  await (0, test_1.expect)(taskPanelPage.availableTasks.getByText(taskName, { exact: true }).first()).not.toBeVisible({ timeout: 30000 });
237
239
  return;
238
240
  }
239
241
  catch (error) {
242
+ // A throw after the Complete click does not mean the task is still open:
243
+ // clickCompleteTaskButton gates on the transient "Task completed" toast,
244
+ // which can auto-dismiss before the assertion polls. Retrying then calls
245
+ // openTask for a task that no longer exists, which can never succeed and
246
+ // spends openTask's full 10 x 120s reload budget before giving up --
247
+ // enough to exhaust the whole test timeout. Re-check the authoritative
248
+ // signal (the task leaving the list) before deciding to retry.
249
+ if (completeClicked) {
250
+ const taskGone = await taskPanelPage.availableTasks
251
+ .getByText(taskName, { exact: true })
252
+ .first()
253
+ .waitFor({ state: 'hidden', timeout: 30000 })
254
+ .then(() => true)
255
+ .catch(() => false);
256
+ if (taskGone) {
257
+ return;
258
+ }
259
+ }
240
260
  if (attempt < maxRetries - 1) {
241
261
  console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}. Retrying...`);
242
262
  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.958",
3
+ "version": "0.0.959",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",