@camunda/e2e-test-suite 0.0.550 → 0.0.552

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.
@@ -37,9 +37,10 @@ class TaskPanelPage {
37
37
  });
38
38
  }
39
39
  async openTask(name, assignButton = true) {
40
- for (let attempt = 1; attempt <= 30; attempt++) {
40
+ const maxAttempts = 10;
41
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
41
42
  try {
42
- await this.page.waitForLoadState('networkidle');
43
+ await this.page.waitForLoadState('domcontentloaded');
43
44
  await this.availableTasks
44
45
  .getByText(name, { exact: true })
45
46
  .nth(0)
@@ -52,13 +53,13 @@ class TaskPanelPage {
52
53
  return;
53
54
  }
54
55
  catch (error) {
55
- if (attempt < 30) {
56
+ if (attempt < maxAttempts) {
56
57
  console.warn(`Attempt ${attempt} failed. Reloading page...`);
57
58
  await this.page.reload();
58
- await this.page.waitForLoadState('networkidle');
59
+ await this.page.waitForLoadState('domcontentloaded');
59
60
  }
60
61
  else {
61
- throw new Error(`Failed to open task "${name}" after ${attempt} attempts: ${error}`);
62
+ throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
62
63
  }
63
64
  }
64
65
  }
@@ -84,7 +85,7 @@ class TaskPanelPage {
84
85
  await this.processesPageTab.click();
85
86
  }
86
87
  async taskCount(name, waitForStable = true) {
87
- await this.page.waitForLoadState('networkidle');
88
+ await this.page.waitForLoadState('domcontentloaded');
88
89
  if (waitForStable) {
89
90
  // Wait for the task list to stabilize: poll until count is unchanged for 2s
90
91
  let previousCount = -1;
@@ -38,12 +38,14 @@ class TaskPanelPage {
38
38
  });
39
39
  }
40
40
  async openTask(name, assignButton = true) {
41
- for (let attempt = 1; attempt <= 30; attempt++) {
41
+ const maxAttempts = 10;
42
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
42
43
  try {
44
+ await this.page.waitForLoadState('domcontentloaded');
43
45
  await this.availableTasks
44
46
  .getByText(name, { exact: true })
45
47
  .nth(0)
46
- .click({ timeout: constants_1._1_SECOND_IN_MS * 4 }); // This is 4 seconds simple to handle resource contention on the host machine.
48
+ .click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
47
49
  if (assignButton) {
48
50
  await (0, test_1.expect)(this.assignToMeButton).toBeVisible({
49
51
  timeout: constants_1._1_SECOND_IN_MS * 10,
@@ -52,12 +54,13 @@ class TaskPanelPage {
52
54
  return;
53
55
  }
54
56
  catch (error) {
55
- if (attempt < 30) {
57
+ if (attempt < maxAttempts) {
56
58
  console.warn(`Attempt ${attempt} failed. Reloading page...`);
57
59
  await this.page.reload();
60
+ await this.page.waitForLoadState('domcontentloaded');
58
61
  }
59
62
  else {
60
- throw new Error(`Failed to open task "${name}" after 3 attempts: ${error}`);
63
+ throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
61
64
  }
62
65
  }
63
66
  }
@@ -25,33 +25,51 @@ async function createAndRunProcess(modelerHomePage, modelerCreatePage, processNa
25
25
  await modelerHomePage.clickProjectBreadcrumb();
26
26
  }
27
27
  exports.createAndRunProcess = createAndRunProcess;
28
- async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries = 3) {
28
+ async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries = 5) {
29
29
  for (let attempt = 0; attempt < maxRetries; attempt++) {
30
30
  try {
31
- await taskPanelPage.openTask(taskName);
31
+ await page.waitForLoadState('domcontentloaded');
32
32
  await (0, sleep_1.sleep)(1000);
33
- await (0, test_1.expect)(taskDetailsPage.assignToMeButton).toBeVisible({
34
- timeout: 10000,
35
- });
36
- await taskDetailsPage.clickAssignToMeButton();
37
- await (0, sleep_1.sleep)(1000);
38
- await (0, test_1.expect)(taskDetailsPage.detailsPanel.getByText(taskPriority)).toBeVisible();
33
+ // Wait for task to appear in the list before trying to open it
34
+ const taskLocator = taskPanelPage.availableTasks
35
+ .getByText(taskName, { exact: true })
36
+ .first();
37
+ try {
38
+ await taskLocator.waitFor({ state: 'visible', timeout: 10000 });
39
+ }
40
+ catch {
41
+ throw new Error(`Task ${taskName} not found in available tasks`);
42
+ }
43
+ await taskPanelPage.openTask(taskName, false);
44
+ await (0, sleep_1.sleep)(500);
45
+ await (0, test_1.expect)(taskDetailsPage.detailsPanel).toBeVisible({ timeout: 30000 });
46
+ // Only assign if not already assigned (handles retry after partial success)
47
+ if (!(await taskDetailsPage.assignedToMeText.isVisible({ timeout: 5000 }))) {
48
+ await (0, test_1.expect)(taskDetailsPage.assignToMeButton).toBeVisible({
49
+ timeout: 10000,
50
+ });
51
+ await taskDetailsPage.clickAssignToMeButton();
52
+ }
53
+ await (0, sleep_1.sleep)(500);
54
+ await (0, test_1.expect)(taskDetailsPage.detailsPanel.getByText(taskPriority)).toBeVisible({ timeout: 30000 });
39
55
  await taskDetailsPage.clickCompleteTaskButton();
40
56
  await (0, test_1.expect)(page.getByText('Task completed').first()).toBeVisible({
41
57
  timeout: 200000,
42
58
  });
43
59
  await (0, test_1.expect)(taskPanelPage.availableTasks.getByText(taskName, { exact: true }).first()).not.toBeVisible({ timeout: 10000 });
44
- await (0, sleep_1.sleep)(1000);
60
+ console.log(`Successfully completed task: ${taskName}`);
45
61
  return;
46
62
  }
47
63
  catch (error) {
64
+ console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}:`, error instanceof Error ? error.message : error);
48
65
  if (attempt < maxRetries - 1) {
49
66
  await page.reload();
50
- console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}. Retrying...`);
67
+ await page.waitForLoadState('domcontentloaded');
68
+ await (0, sleep_1.sleep)(1000);
51
69
  }
52
70
  else {
53
71
  console.error(error);
54
- throw new Error(`Assertion failed after ${maxRetries} attempts`);
72
+ throw new Error(`Assertion failed after ${maxRetries} attempts for task ${taskName}`);
55
73
  }
56
74
  }
57
75
  }
@@ -37,7 +37,8 @@ class TaskPanelPage {
37
37
  });
38
38
  }
39
39
  async openTask(name, assignButton = true) {
40
- for (let attempt = 1; attempt <= 30; attempt++) {
40
+ const maxAttempts = 10;
41
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
41
42
  try {
42
43
  await this.availableTasks
43
44
  .getByText(name, { exact: true })
@@ -51,13 +52,13 @@ class TaskPanelPage {
51
52
  return;
52
53
  }
53
54
  catch (error) {
54
- if (attempt < 30) {
55
+ if (attempt < maxAttempts) {
55
56
  console.warn(`Attempt ${attempt} failed. Reloading page...`);
56
57
  await this.page.reload();
57
- await this.page.waitForLoadState('networkidle');
58
+ await this.page.waitForLoadState('domcontentloaded');
58
59
  }
59
60
  else {
60
- throw new Error(`Failed to open task "${name}" after 3 attempts: ${error}`);
61
+ throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
61
62
  }
62
63
  }
63
64
  }
@@ -83,7 +84,7 @@ class TaskPanelPage {
83
84
  await this.processesPageTab.click();
84
85
  }
85
86
  async taskCount(name, waitForStable = true) {
86
- await this.page.waitForLoadState('networkidle');
87
+ await this.page.waitForLoadState('domcontentloaded');
87
88
  if (waitForStable) {
88
89
  // Wait for the task list to stabilize: poll until count is unchanged for 2s
89
90
  let previousCount = -1;
@@ -37,9 +37,10 @@ class TaskPanelPage {
37
37
  });
38
38
  }
39
39
  async openTask(name, assignButton = true) {
40
- for (let attempt = 1; attempt <= 30; attempt++) {
40
+ const maxAttempts = 10;
41
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
41
42
  try {
42
- await this.page.waitForLoadState('networkidle');
43
+ await this.page.waitForLoadState('domcontentloaded');
43
44
  await this.availableTasks
44
45
  .getByText(name, { exact: true })
45
46
  .nth(0)
@@ -52,13 +53,13 @@ class TaskPanelPage {
52
53
  return;
53
54
  }
54
55
  catch (error) {
55
- if (attempt < 30) {
56
+ if (attempt < maxAttempts) {
56
57
  console.warn(`Attempt ${attempt} failed. Reloading page...`);
57
58
  await this.page.reload();
58
- await this.page.waitForLoadState('networkidle');
59
+ await this.page.waitForLoadState('domcontentloaded');
59
60
  }
60
61
  else {
61
- throw new Error(`Failed to open task "${name}" after ${attempt} attempts: ${error}`);
62
+ throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
62
63
  }
63
64
  }
64
65
  }
@@ -84,7 +85,7 @@ class TaskPanelPage {
84
85
  await this.processesPageTab.click();
85
86
  }
86
87
  async taskCount(name, waitForStable = true) {
87
- await this.page.waitForLoadState('networkidle');
88
+ await this.page.waitForLoadState('domcontentloaded');
88
89
  if (waitForStable) {
89
90
  // Wait for the task list to stabilize: poll until count is unchanged for 2s
90
91
  let previousCount = -1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.550",
3
+ "version": "0.0.552",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",