@camunda/e2e-test-suite 0.0.1764 → 0.0.1766

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.
@@ -16,6 +16,7 @@ declare class TaskPanelPage {
16
16
  constructor(page: Page);
17
17
  taskLink(processName: string): Locator;
18
18
  openTask(name: string, assignButton?: boolean, fallbackName?: string): Promise<void>;
19
+ private revealTaskInPanel;
19
20
  filterBy(option: 'All open' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
20
21
  private openFilterControls;
21
22
  private static appliedFilterUrl;
@@ -100,6 +100,7 @@ class TaskPanelPage {
100
100
  // Removed waitForLoadState('networkidle') — Tasklist polls
101
101
  // continuously, so networkidle never fires; the click below
102
102
  // already has a 4s timeout that auto-waits for the locator.
103
+ await this.revealTaskInPanel(taskLocator);
103
104
  await taskLocator.nth(0).click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
104
105
  if (assignButton) {
105
106
  await (0, test_1.expect)(this.assignToMeButton).toBeVisible({
@@ -120,6 +121,39 @@ class TaskPanelPage {
120
121
  }
121
122
  }
122
123
  }
124
+ // The task panel renders only a window of cards and loads the next page when
125
+ // the last one is scrolled into view, so a task completed early sits below
126
+ // that window and is absent from the DOM until the panel is scrolled down to
127
+ // it. openTask otherwise reloads to the top every attempt and never descends,
128
+ // leaving a buried task — e.g. the first-completed one in a Completed list
129
+ // crowded by parallel runs — unreachable. Scroll until the task renders or the
130
+ // list stops growing (it is then genuinely absent, and the caller's click
131
+ // surfaces that rather than this masking it).
132
+ async revealTaskInPanel(taskLocator) {
133
+ const cards = this.availableTasks.locator('article');
134
+ // A reload can leave the first window still fetching; wait for the first
135
+ // card, bounded so a genuinely empty list still exits via count === 0.
136
+ await cards
137
+ .first()
138
+ .waitFor({ state: 'attached', timeout: 5000 })
139
+ .catch(() => false);
140
+ let previousCount = 0;
141
+ for (let i = 0; i < 30; i++) {
142
+ if ((await taskLocator.count()) > 0) {
143
+ return;
144
+ }
145
+ const count = await cards.count();
146
+ if (count === 0 || count === previousCount) {
147
+ return;
148
+ }
149
+ previousCount = count;
150
+ await cards.nth(count - 1).scrollIntoViewIfNeeded();
151
+ await cards
152
+ .nth(count)
153
+ .waitFor({ state: 'attached', timeout: 5000 })
154
+ .catch(() => false);
155
+ }
156
+ }
123
157
  async filterBy(option) {
124
158
  // Both shells list the options only once their control is open, so open it
125
159
  // first and then pick from whichever of the two the deployed build renders:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1764",
3
+ "version": "0.0.1766",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",