@camunda/e2e-test-suite 0.0.1136 → 0.0.1138

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.
@@ -136,13 +136,67 @@ class PlayPage {
136
136
  if (attempts >= maxRetries - 1)
137
137
  throw error;
138
138
  await this.page.reload();
139
+ // A reload drops the Modeler back on the Implement tab (the same
140
+ // trap clickStartInstanceButton's catch block already handles), so
141
+ // the retry would otherwise wait out its whole 180s budget against
142
+ // DOM that can never hold the instance details -- which is why the
143
+ // nightly still failed on "process instance key" despite this loop.
144
+ // Re-open Play first.
145
+ if (await this.playTab.isVisible({ timeout: 30000 }).catch(() => false)) {
146
+ await this.playTab.click();
147
+ }
148
+ // The details panel only renders once an instance exists. The one way
149
+ // it never rendered is that the start click resolved against a
150
+ // re-laid-out (briefly detached) overlay and was silently lost --
151
+ // clickLocatorWithRetry only retries a click that *throws*. Re-issue
152
+ // the start so the retry has an instance to show; if one is already
153
+ // running the assertions below simply pass on it.
154
+ const startTrigger = this.configureTestPanelStartButton
155
+ .or(this.startInstanceOverlayButton)
156
+ .first();
157
+ if (await startTrigger.isVisible({ timeout: 30000 }).catch(() => false)) {
158
+ await this.clickStartInstanceButton();
159
+ }
139
160
  attempts++;
140
161
  }
141
162
  }
142
163
  }
143
164
  async waitForNextElementToBeActive(historyItem) {
144
- await (0, test_1.expect)(this.page.getByText(new RegExp(`^${historyItem}`, 'i'))).toBeVisible({
165
+ // Same lost-click hazard waitForProcessToBeCompleted documents for the
166
+ // final task, one step earlier: the complete-job overlay is pinned to the
167
+ // active element and is re-laid-out (briefly detached) on every instance
168
+ // update from the cluster, so a click landing in that window resolves
169
+ // against a stale node without throwing. clickLocatorWithRetry only
170
+ // retries a click that *throws*, so the job stays pending and the sole
171
+ // symptom is this locator timing out on the element that consequently
172
+ // never became active -- exactly the nightly failure on 'service-task*'.
173
+ //
174
+ // Once the next element has stayed absent well past any normal Play
175
+ // advance latency AND a complete-job overlay is still sitting enabled on
176
+ // the canvas, the previous click demonstrably did not land, so re-issue
177
+ // it. The grace period matters: it keeps us from completing the job of
178
+ // the very element we are waiting for during the brief window where its
179
+ // overlay has rendered but its history entry has not. The assertion is
180
+ // unchanged -- this still only passes on a visible history entry.
181
+ const element = this.page.getByText(new RegExp(`^${historyItem}`, 'i'));
182
+ const recoveryGraceMs = 60000;
183
+ const startedAt = Date.now();
184
+ await (0, test_1.expect)(async () => {
185
+ if (Date.now() - startedAt > recoveryGraceMs) {
186
+ const isPreviousJobStillPending = (await this.completeJobButton.isVisible().catch(() => false)) &&
187
+ (await this.completeJobButton.isEnabled().catch(() => false));
188
+ // Re-check immediately before clicking: if the element became active
189
+ // in the meantime, the pending overlay is its own and must be left
190
+ // alone for the caller's next step.
191
+ if (isPreviousJobStillPending &&
192
+ !(await element.isVisible().catch(() => false))) {
193
+ await this.completeJobButton.click({ timeout: 30000 });
194
+ }
195
+ }
196
+ await (0, test_1.expect)(element).toBeVisible({ timeout: 15000 });
197
+ }).toPass({
145
198
  timeout: maxWaitTimeSeconds,
199
+ intervals: [5000, 10000, 15000],
146
200
  });
147
201
  }
148
202
  async waitForProcessToBeCompleted() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1136",
3
+ "version": "0.0.1138",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",