@camunda/e2e-test-suite 0.0.455 → 0.0.456

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.
@@ -18,7 +18,7 @@ declare class TaskPanelPage {
18
18
  scrollToFirstTask(name: string): Promise<void>;
19
19
  clickCollapseFilter(): Promise<void>;
20
20
  clickProcessesTab(): Promise<void>;
21
- taskCount(name: string): Promise<number>;
21
+ taskCount(name: string, waitForStable?: boolean): Promise<number>;
22
22
  clickTasksTab(): Promise<void>;
23
23
  }
24
24
  export { TaskPanelPage };
@@ -83,8 +83,30 @@ class TaskPanelPage {
83
83
  await (0, test_1.expect)(this.processesPageTab).toBeVisible();
84
84
  await this.processesPageTab.click();
85
85
  }
86
- async taskCount(name) {
86
+ async taskCount(name, waitForStable = true) {
87
87
  await this.page.waitForLoadState('networkidle');
88
+ if (waitForStable) {
89
+ // Wait for the task list to stabilize: poll until count is unchanged for 2s
90
+ let previousCount = -1;
91
+ let stableIterations = 0;
92
+ const maxAttempts = 15; // 15 * 1s = 15s max wait
93
+ for (let i = 0; i < maxAttempts; i++) {
94
+ const currentCount = await this.availableTasks
95
+ .getByText(name, { exact: true })
96
+ .count();
97
+ if (currentCount === previousCount) {
98
+ stableIterations++;
99
+ if (stableIterations >= 2) {
100
+ return currentCount;
101
+ }
102
+ }
103
+ else {
104
+ stableIterations = 0;
105
+ previousCount = currentCount;
106
+ }
107
+ await this.page.waitForTimeout(1000);
108
+ }
109
+ }
88
110
  return this.availableTasks.getByText(name, { exact: true }).count();
89
111
  }
90
112
  async clickTasksTab() {
@@ -18,7 +18,7 @@ declare class TaskPanelPage {
18
18
  scrollToFirstTask(name: string): Promise<void>;
19
19
  clickCollapseFilter(): Promise<void>;
20
20
  clickProcessesTab(): Promise<void>;
21
- taskCount(name: string): Promise<number>;
21
+ taskCount(name: string, waitForStable?: boolean): Promise<number>;
22
22
  clickTasksTab(): Promise<void>;
23
23
  }
24
24
  export { TaskPanelPage };
@@ -82,8 +82,30 @@ class TaskPanelPage {
82
82
  await (0, test_1.expect)(this.processesPageTab).toBeVisible();
83
83
  await this.processesPageTab.click();
84
84
  }
85
- async taskCount(name) {
85
+ async taskCount(name, waitForStable = true) {
86
86
  await this.page.waitForLoadState('networkidle');
87
+ if (waitForStable) {
88
+ // Wait for the task list to stabilize: poll until count is unchanged for 2s
89
+ let previousCount = -1;
90
+ let stableIterations = 0;
91
+ const maxAttempts = 15; // 15 * 1s = 15s max wait
92
+ for (let i = 0; i < maxAttempts; i++) {
93
+ const currentCount = await this.availableTasks
94
+ .getByText(name, { exact: true })
95
+ .count();
96
+ if (currentCount === previousCount) {
97
+ stableIterations++;
98
+ if (stableIterations >= 2) {
99
+ return currentCount;
100
+ }
101
+ }
102
+ else {
103
+ stableIterations = 0;
104
+ previousCount = currentCount;
105
+ }
106
+ await this.page.waitForTimeout(1000);
107
+ }
108
+ }
87
109
  return this.availableTasks.getByText(name, { exact: true }).count();
88
110
  }
89
111
  async clickTasksTab() {
@@ -18,7 +18,7 @@ declare class TaskPanelPage {
18
18
  scrollToFirstTask(name: string): Promise<void>;
19
19
  clickCollapseFilter(): Promise<void>;
20
20
  clickProcessesTab(): Promise<void>;
21
- taskCount(name: string): Promise<number>;
21
+ taskCount(name: string, waitForStable?: boolean): Promise<number>;
22
22
  clickTasksTab(): Promise<void>;
23
23
  }
24
24
  export { TaskPanelPage };
@@ -83,8 +83,30 @@ class TaskPanelPage {
83
83
  await (0, test_1.expect)(this.processesPageTab).toBeVisible();
84
84
  await this.processesPageTab.click();
85
85
  }
86
- async taskCount(name) {
86
+ async taskCount(name, waitForStable = true) {
87
87
  await this.page.waitForLoadState('networkidle');
88
+ if (waitForStable) {
89
+ // Wait for the task list to stabilize: poll until count is unchanged for 2s
90
+ let previousCount = -1;
91
+ let stableIterations = 0;
92
+ const maxAttempts = 15; // 15 * 1s = 15s max wait
93
+ for (let i = 0; i < maxAttempts; i++) {
94
+ const currentCount = await this.availableTasks
95
+ .getByText(name, { exact: true })
96
+ .count();
97
+ if (currentCount === previousCount) {
98
+ stableIterations++;
99
+ if (stableIterations >= 2) {
100
+ return currentCount;
101
+ }
102
+ }
103
+ else {
104
+ stableIterations = 0;
105
+ previousCount = currentCount;
106
+ }
107
+ await this.page.waitForTimeout(1000);
108
+ }
109
+ }
88
110
  return this.availableTasks.getByText(name, { exact: true }).count();
89
111
  }
90
112
  async clickTasksTab() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.455",
3
+ "version": "0.0.456",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",