@camunda/e2e-test-suite 0.0.836 → 0.0.838

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.
@@ -97,9 +97,24 @@ class ModelerHomePage {
97
97
  });
98
98
  }
99
99
  async enterNewProjectName(name) {
100
- await this.projectNameInput.click({ timeout: 60000 });
101
- await this.projectNameInput.fill(name);
102
- await this.projectNameInput.press('Enter');
100
+ // The inline rename silently drops the value when the editable title field
101
+ // is not yet in edit mode as fill() runs, leaving the project named
102
+ // "New project". Re-enter until the field reflects the requested name.
103
+ //
104
+ // Once the rename commits, the editable input unmounts and the title
105
+ // renders as a static heading (`[title="<name>"]`) instead. A retry that
106
+ // still assumes `[data-test="editable-input"]` is clickable then hangs on
107
+ // an element that will never reappear, even though the rename already
108
+ // succeeded. Treat the static title becoming visible as success.
109
+ await (0, test_1.expect)(async () => {
110
+ if (await this.page.getByTitle(name, { exact: true }).isVisible()) {
111
+ return;
112
+ }
113
+ await this.projectNameInput.click({ timeout: 60000 });
114
+ await this.projectNameInput.fill(name);
115
+ await this.projectNameInput.press('Enter');
116
+ await (0, test_1.expect)(this.projectNameInput).toHaveValue(name, { timeout: 5000 });
117
+ }).toPass({ timeout: 120000 });
103
118
  }
104
119
  async enterIdpApplicationName(name) {
105
120
  await this.idpApplicationNameInput.click({ timeout: 60000 });
@@ -201,15 +216,51 @@ class ModelerHomePage {
201
216
  });
202
217
  }
203
218
  async createCrossComponentProjectFolder() {
204
- await (0, sleep_1.sleep)(15000);
205
- await this.dismissOverlays();
206
- if (await this.crossComponentProjectFolder.isVisible()) {
207
- console.log('Cross Component Project folder already exists. Clicking into it');
208
- await this.clickCrossComponentProjectFolder();
209
- return;
219
+ // Retry the whole create+rename sequence, not just the inline rename.
220
+ // enterNewProjectName only retries typing the name; if the "New project"
221
+ // click never puts the new project into inline-edit mode (the editable
222
+ // input never renders, common when the modeler backend is slow), that
223
+ // retry can never recover. Re-clicking "New project" on the next attempt
224
+ // gives the edit field a fresh chance to appear. Mirrors the SM
225
+ // createCrossComponentProjectFolder retry.
226
+ const maxAttempts = 3;
227
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
228
+ await (0, sleep_1.sleep)(attempt === 0 ? 15000 : 5000);
229
+ await this.dismissOverlays();
230
+ // The project may already exist (a sibling user's setup, or a previous
231
+ // attempt that created it but tripped on the rename check). Detect it in
232
+ // BOTH view states before trying to create, otherwise we click "New
233
+ // project" — which does not exist inside an open project — and fail:
234
+ // - on Home it shows as a folder tile (crossComponentProjectFolder);
235
+ // - if a previous step already opened it, the page is INSIDE the project
236
+ // (project breadcrumb visible), where the tile is not rendered, so it
237
+ // already exists and we are done.
238
+ if (await this.crossComponentProjectFolder.isVisible()) {
239
+ console.log('Cross Component Project folder already exists. Clicking into it');
240
+ await this.clickCrossComponentProjectFolder();
241
+ return;
242
+ }
243
+ if (await this.projectBreadcrumb.isVisible().catch(() => false)) {
244
+ console.log('Already inside the Cross Component Project folder; it exists');
245
+ return;
246
+ }
247
+ try {
248
+ await this.clickCreateNewProjectButton();
249
+ await this.enterNewProjectName(this.defaultFolderName);
250
+ return;
251
+ }
252
+ catch (error) {
253
+ if (attempt >= maxAttempts - 1) {
254
+ throw error;
255
+ }
256
+ // A prior attempt may have created and opened the project but failed
257
+ // the rename check. Return Home so the next attempt's existence check
258
+ // sees the folder tile instead of trying to create it again from
259
+ // inside the project (where there is no "New project" button).
260
+ await this.clickHomeBreadcrumb().catch(() => { });
261
+ console.log(`createCrossComponentProjectFolder attempt ${attempt + 1} failed; retrying...`);
262
+ }
210
263
  }
211
- await this.clickCreateNewProjectButton();
212
- await this.enterNewProjectName(this.defaultFolderName);
213
264
  }
214
265
  async clickManageButton(retries = 3) {
215
266
  await this.optionsButton.click({ timeout: 30000 });
@@ -187,8 +187,19 @@ class ModelerHomePage {
187
187
  catch (error) {
188
188
  attempts++;
189
189
  if (attempts < maxAttempts) {
190
- console.log(`Attempt ${attempts} failed. Reloading page and retrying...`);
191
- await this.page.reload();
190
+ console.log(`Attempt ${attempts} failed. Re-navigating to Modeler and retrying...`);
191
+ // A transient web-modeler 500 on login right after the OAuth callback
192
+ // logs the user out and leaves the page on the Keycloak login form. A
193
+ // bare page.reload() then just reloads the login page and never
194
+ // re-authenticates, so every remaining attempt waits out its timeout
195
+ // on the login screen. Re-run the full navigation+login instead so a
196
+ // recovered backend can complete the login on the next attempt.
197
+ try {
198
+ await new NavigationPage_1.NavigationPage(this.page).goToModeler();
199
+ }
200
+ catch (navError) {
201
+ console.log(`Re-navigation to Modeler failed: ${navError}`);
202
+ }
192
203
  await this.page.waitForLoadState('networkidle');
193
204
  }
194
205
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.836",
3
+ "version": "0.0.838",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",