@camunda/e2e-test-suite 0.0.1315 → 0.0.1316

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.
@@ -324,9 +324,7 @@ class ModelerHomePage {
324
324
  async clickDiagramTypeDropdown() {
325
325
  await this.enterResourceContainer();
326
326
  const dropdown = this.processApplicationPage.createNewDropdown;
327
- await (0, test_1.expect)(dropdown).toBeVisible({
328
- timeout: 60000,
329
- });
327
+ await this.processApplicationPage.waitForCreateMenu();
330
328
  await dropdown.click({ timeout: 120000 });
331
329
  }
332
330
  // Opens the create menu at workspace root, which is the only place process
@@ -17,6 +17,8 @@ declare class ProcessApplicationPage {
17
17
  constructor(page: Page);
18
18
  private pageReady;
19
19
  waitForProcessApplication(timeout?: number): Promise<void>;
20
+ waitForCreateMenu(timeout?: number): Promise<void>;
21
+ private waitWithReload;
20
22
  clickCreateProcessApplicationButton(): Promise<void>;
21
23
  clickCreateProcessApplicationOption(): Promise<void>;
22
24
  nameNewProcessApplication(name: string): Promise<void>;
@@ -112,7 +112,40 @@ class ProcessApplicationPage {
112
112
  return this.folderExplorer.or(this.breadcrumb).first();
113
113
  }
114
114
  async waitForProcessApplication(timeout = 90000) {
115
- await (0, test_1.expect)(this.pageReady()).toBeVisible({ timeout });
115
+ await this.waitWithReload(this.pageReady(), timeout);
116
+ }
117
+ // Waits for the create menu inside the folder explorer, reloading when Hub
118
+ // rendered its load-error state instead.
119
+ async waitForCreateMenu(timeout = 60000) {
120
+ await this.waitWithReload(this.createNewDropdown, timeout);
121
+ }
122
+ // Hub's project/workspace endpoints occasionally stall ~30s and answer
123
+ // 404/500; the page then shows an error boundary ("Something went wrong" /
124
+ // "Try again") or a "Couldn't retrieve your project" / "Could not fetch the
125
+ // workspace information" toast and never renders the content. The failed
126
+ // query is not retried by Hub itself, so waiting longer cannot help --
127
+ // reload (a valid recovery on a normal app route) and wait again.
128
+ //
129
+ // The whole recovery, reloads included, stays inside `timeout` via an
130
+ // absolute deadline: reload() otherwise inherits the 120s navigationTimeout
131
+ // and two slow reloads would eat the test budget during an outage. The last
132
+ // attempt is a plain assertion so a persistent outage still fails loudly.
133
+ async waitWithReload(target, timeout, attempts = 3) {
134
+ const deadline = Date.now() + timeout;
135
+ const perAttempt = Math.ceil(timeout / attempts);
136
+ const remaining = () => Math.max(deadline - Date.now(), 1000);
137
+ for (let attempt = 1; attempt < attempts; attempt++) {
138
+ const ready = await target
139
+ .waitFor({ state: 'visible', timeout: Math.min(perAttempt, remaining()) })
140
+ .then(() => true)
141
+ .catch(() => false);
142
+ if (ready) {
143
+ return;
144
+ }
145
+ console.warn(`Process application content did not render (attempt ${attempt}/${attempts}); reloading.`);
146
+ await this.page.reload({ waitUntil: 'load', timeout: remaining() });
147
+ }
148
+ await (0, test_1.expect)(target).toBeVisible({ timeout: remaining() });
116
149
  }
117
150
  async clickCreateProcessApplicationButton() {
118
151
  await (0, test_1.expect)(this.createProcessApplicationButton).toBeVisible({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1315",
3
+ "version": "0.0.1316",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",