@camunda/e2e-test-suite 0.0.1013 → 0.0.1014

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.
@@ -1,6 +1,7 @@
1
1
  import { Page, Locator } from '@playwright/test';
2
2
  declare class ModelerHomePage {
3
3
  private defaultFolderName;
4
+ private defaultNewProjectName;
4
5
  private page;
5
6
  private processApplicationPage;
6
7
  private processApplicationUrl?;
@@ -29,10 +30,15 @@ declare class ModelerHomePage {
29
30
  readonly closeButton: Locator;
30
31
  readonly optionsButton: Locator;
31
32
  readonly formNameBreadcrumb: (formName: string) => Locator;
33
+ readonly breadcrumbProjectMenu: Locator;
34
+ readonly renameProjectMenuItem: Locator;
35
+ readonly defaultNamedProjectRow: Locator;
36
+ readonly renameMenuItem: Locator;
32
37
  constructor(page: Page);
33
38
  dismissOverlays(): Promise<void>;
34
39
  clickCreateNewProjectButton(): Promise<void>;
35
40
  enterNewProjectName(name: string): Promise<void>;
41
+ private openProjectRenameEditor;
36
42
  enterIdpApplicationName(name: string): Promise<void>;
37
43
  clickChooseBpmnTemplateButton(): Promise<void>;
38
44
  reload(): Promise<void>;
@@ -8,6 +8,8 @@ const randomName_1 = require("../../utils/randomName");
8
8
  const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
9
9
  class ModelerHomePage {
10
10
  defaultFolderName = 'Cross Component Test Project';
11
+ // The name hub gives a project on create, before the inline rename commits.
12
+ defaultNewProjectName = 'New project';
11
13
  page;
12
14
  // Since camunda/camunda-hub#25831 files and folders cannot sit at a
13
15
  // workspace ("project" in today's UI) root -- only process applications and
@@ -46,6 +48,10 @@ class ModelerHomePage {
46
48
  closeButton;
47
49
  optionsButton;
48
50
  formNameBreadcrumb;
51
+ breadcrumbProjectMenu;
52
+ renameProjectMenuItem;
53
+ defaultNamedProjectRow;
54
+ renameMenuItem;
49
55
  constructor(page) {
50
56
  this.page = page;
51
57
  this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
@@ -104,6 +110,14 @@ class ModelerHomePage {
104
110
  this.formNameBreadcrumb = (formName) => page.locator('button[data-test="breadcrumb-form"]', {
105
111
  hasText: formName,
106
112
  });
113
+ this.breadcrumbProjectMenu = page.locator('[data-test="breadcrumb-project-menu"]');
114
+ this.renameProjectMenuItem = page.locator('[data-test="rename-project"]');
115
+ // EntityTable stamps `entity-<row id>` on the row, and on the projects list
116
+ // the row id is the project's name (camunda-hub
117
+ // frontend/apps/hub/src/components/entity-table/EntityTable.tsx), so this
118
+ // addresses the still-unnamed project the create flow just added.
119
+ this.defaultNamedProjectRow = page.locator(`[data-test="entity-${this.defaultNewProjectName}"]`);
120
+ this.renameMenuItem = page.getByRole('menuitem', { name: 'Rename' });
107
121
  }
108
122
  async dismissOverlays() {
109
123
  for (const locator of [
@@ -149,6 +163,13 @@ class ModelerHomePage {
149
163
  if (await committedProjectName.first().isVisible()) {
150
164
  return;
151
165
  }
166
+ // Bounded, not instantaneous: the editor can still be mounting, and
167
+ // reading that as "closed" would send the recovery to the projects-list
168
+ // branch while the browser sits on the project page, where the row it
169
+ // wants does not exist.
170
+ if (!(await this.becameVisible(this.projectNameInput.first(), 10000))) {
171
+ await this.openProjectRenameEditor();
172
+ }
152
173
  await this.projectNameInput.click({ timeout: 15000 });
153
174
  await this.projectNameInput.fill(name);
154
175
  // Confirm the value actually landed in the edit field before committing;
@@ -163,6 +184,32 @@ class ModelerHomePage {
163
184
  await (0, test_1.expect)(committedProjectName.first()).toBeVisible({ timeout: 15000 });
164
185
  }).toPass({ timeout: 120000 });
165
186
  }
187
+ // Reopens the inline name editor when the create flow has left it closed.
188
+ // Two shapes, both hub's own (frontend/apps/hub/src/app/pages/project/
189
+ // ProjectHeader.tsx and .../home/features/projects-list/EntityAction.tsx):
190
+ // inside the project the breadcrumb dropdown carries a Rename item, and on
191
+ // the projects list the row's overflow menu carries one that toggles the row
192
+ // into edit mode. Both mount the same InlineEditable, so the caller keeps
193
+ // filling `[data-test="editable-input"]` either way.
194
+ //
195
+ // `breadcrumb-project-menu` and not `breadcrumb-project`: the latter is the
196
+ // loading/text fallback hub renders before the project has loaded, and
197
+ // clicking it opens nothing. Hub's own suite draws the same distinction.
198
+ async openProjectRenameEditor() {
199
+ if (await this.becameVisible(this.breadcrumbProjectMenu, 10000)) {
200
+ await this.breadcrumbProjectMenu.click({ timeout: 10000 });
201
+ await this.renameProjectMenuItem.click({ timeout: 10000 });
202
+ return;
203
+ }
204
+ // Still on the projects list: hub created the project but never navigated
205
+ // into it, so the breadcrumb editor was never mounted at all. Rename the
206
+ // row in place rather than clicking "New project" again, which would leave
207
+ // a second, permanently unnamed project behind in the org.
208
+ await this.defaultNamedProjectRow
209
+ .locator('[data-test="entity-context-dropdown"]')
210
+ .click({ timeout: 30000 });
211
+ await this.renameMenuItem.click({ timeout: 10000 });
212
+ }
166
213
  async enterIdpApplicationName(name) {
167
214
  await this.idpApplicationNameInput.click({ timeout: 60000 });
168
215
  await this.idpApplicationNameInput.fill(name);
@@ -423,6 +470,20 @@ class ModelerHomePage {
423
470
  }
424
471
  await this.clickCreateNewProjectButton();
425
472
  await this.enterNewProjectName(this.defaultFolderName);
473
+ // Both branches must leave the browser inside the workspace: the callers
474
+ // go straight on to clickDiagramTypeDropdown(), whose create control only
475
+ // exists there. Creating normally navigates into the new project, but when
476
+ // hub leaves the browser on the projects list the rename happens in the row
477
+ // and no navigation follows.
478
+ //
479
+ // Keyed on "New project", which hub renders only on the projects list and
480
+ // never inside an open project, so it answers which view we are on
481
+ // directly. The folder tile is the wrong signal: on a slow list render it
482
+ // is still absent, which would read as "already inside" and skip a hop
483
+ // that was needed.
484
+ if (await this.becameVisible(this.createNewProjectButton, 5000)) {
485
+ await this.clickCrossComponentProjectFolder();
486
+ }
426
487
  }
427
488
  async clickManageButton(retries = 3) {
428
489
  await this.optionsButton.click({ timeout: 30000 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1013",
3
+ "version": "0.0.1014",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",