@camunda/e2e-test-suite 0.0.1734 → 0.0.1736

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.
@@ -20,6 +20,7 @@ declare class ModelerHomePage {
20
20
  readonly diagramTypeDropdown: Locator;
21
21
  readonly bpmnTemplateOption: Locator;
22
22
  readonly formTemplateOption: Locator;
23
+ readonly newEntityNameSubmit: Locator;
23
24
  readonly projectBreadcrumb: Locator;
24
25
  readonly workspaceBreadcrumb: Locator;
25
26
  readonly openOrganizationsButton: Locator;
@@ -65,6 +66,7 @@ declare class ModelerHomePage {
65
66
  clickWorkspaceDiagramTypeDropdown(): Promise<void>;
66
67
  clickBpmnTemplateOption(): Promise<void>;
67
68
  clickFormOption(): Promise<void>;
69
+ private confirmNewEntityNameDialog;
68
70
  enterFormName(name: string): Promise<void>;
69
71
  openFormRenameEditor(): Promise<void>;
70
72
  enterFormNameWithRetry(name: string): Promise<void>;
@@ -44,6 +44,7 @@ class ModelerHomePage {
44
44
  diagramTypeDropdown;
45
45
  bpmnTemplateOption;
46
46
  formTemplateOption;
47
+ newEntityNameSubmit;
47
48
  projectBreadcrumb;
48
49
  workspaceBreadcrumb;
49
50
  openOrganizationsButton;
@@ -165,6 +166,7 @@ class ModelerHomePage {
165
166
  // day that variant ships.
166
167
  this.bpmnTemplateOption = page.locator('[data-test="create-bpmn-diagram"]');
167
168
  this.formTemplateOption = page.locator('[data-test="create-form"]');
169
+ this.newEntityNameSubmit = page.locator('[data-test="new-entity-name-submit"]');
168
170
  this.projectBreadcrumb = page.locator('[data-test="breadcrumb-project"]');
169
171
  // Kept separate from projectBreadcrumb, which now means "the container my
170
172
  // resources live in". When hub's workspaces terminology flag flips,
@@ -463,6 +465,7 @@ class ModelerHomePage {
463
465
  timeout: 15000,
464
466
  });
465
467
  await this.bpmnTemplateOption.click();
468
+ await this.confirmNewEntityNameDialog();
466
469
  const opened = await this.page
467
470
  .waitForURL(/\/diagrams\//, { timeout: 60000 })
468
471
  .then(() => true)
@@ -476,6 +479,20 @@ class ModelerHomePage {
476
479
  }
477
480
  async clickFormOption() {
478
481
  await this.formTemplateOption.click();
482
+ await this.confirmNewEntityNameDialog();
483
+ }
484
+ // Hub's pre-create name dialog: keep the default (callers rename later; the
485
+ // form flow waits on "New form"). A failed create leaves it open, so resubmit.
486
+ async confirmNewEntityNameDialog() {
487
+ if (!(await this.becameVisible(this.newEntityNameSubmit, 15000))) {
488
+ return;
489
+ }
490
+ await (0, test_1.expect)(async () => {
491
+ if (await this.newEntityNameSubmit.isVisible()) {
492
+ await this.newEntityNameSubmit.click({ timeout: 10000 });
493
+ }
494
+ await (0, test_1.expect)(this.newEntityNameSubmit).toBeHidden({ timeout: 30000 });
495
+ }).toPass({ timeout: 120000, intervals: [1000, 2000, 5000] });
479
496
  }
480
497
  // The legacy shell opens a fresh form with its breadcrumb name in inline-edit
481
498
  // mode. Nav-v2 has no inline editing: the form stays "New form" until renamed
@@ -19,6 +19,8 @@ declare class ModelerHomePage {
19
19
  readonly diagramTypeDropdown: Locator;
20
20
  readonly bpmnTemplateOption: Locator;
21
21
  readonly formTemplateOption: Locator;
22
+ readonly newEntityNameInput: Locator;
23
+ readonly newEntityNameSubmit: Locator;
22
24
  readonly diagramPropertiesPanel: Locator;
23
25
  readonly projectBreadcrumb: Locator;
24
26
  readonly workspaceBreadcrumb: Locator;
@@ -64,6 +66,7 @@ declare class ModelerHomePage {
64
66
  clickBpmnTemplateOption(): Promise<void>;
65
67
  clickFormOption(): Promise<void>;
66
68
  enterFormName(name: string): Promise<void>;
69
+ private submitNewEntityName;
67
70
  clickProjectBreadcrumb(): Promise<void>;
68
71
  clickWorkspaceBreadcrumb(): Promise<void>;
69
72
  enterResourceContainer(name?: string): Promise<void>;
@@ -45,6 +45,8 @@ class ModelerHomePage {
45
45
  diagramTypeDropdown;
46
46
  bpmnTemplateOption;
47
47
  formTemplateOption;
48
+ newEntityNameInput;
49
+ newEntityNameSubmit;
48
50
  // Same group the spec asserts on ModelerCreatePage: it is what proves the
49
51
  // BPMN editor opened, and clickBpmnTemplateOption() has to know that here.
50
52
  diagramPropertiesPanel;
@@ -171,6 +173,10 @@ class ModelerHomePage {
171
173
  // day that variant ships.
172
174
  this.bpmnTemplateOption = page.locator('[data-test="create-bpmn-diagram"]');
173
175
  this.formTemplateOption = page.locator('[data-test="create-form"]');
176
+ // Hub asks for the name in a dialog before it creates a file
177
+ // (camunda-hub NewEntityNameDialog.tsx).
178
+ this.newEntityNameInput = page.locator('[data-test="new-entity-name-input"]');
179
+ this.newEntityNameSubmit = page.locator('[data-test="new-entity-name-submit"]');
174
180
  this.diagramPropertiesPanel = page.locator('[data-group-id="group-general"]');
175
181
  // Hub's breadcrumbs carry no data-test at all (confirmed by a DOM audit of
176
182
  // a live run: none of the seven breadcrumb-* ids this file used are
@@ -707,6 +713,9 @@ class ModelerHomePage {
707
713
  // 30s rather than the old 120s: the option is proven visible above, so a
708
714
  // longer click budget only ate the time the retry below needs.
709
715
  await this.bpmnTemplateOption.click({ timeout: 30000 });
716
+ // The specs rename the diagram later through enterDiagramName, so keep
717
+ // Hub's former default rather than its project-name suggestion.
718
+ await this.submitNewEntityName('New BPMN diagram');
710
719
  await (0, test_1.expect)(this.diagramPropertiesPanel).toBeVisible({ timeout: 60000 });
711
720
  }).toPass({ timeout: 240000, intervals: [1000, 2000, 5000] });
712
721
  }
@@ -720,9 +729,28 @@ class ModelerHomePage {
720
729
  }
721
730
  async enterFormName(name) {
722
731
  await (0, sessionRecovery_1.recoverStuckModelerLogin)(this.page);
732
+ if (await this.submitNewEntityName(name)) {
733
+ await (0, test_1.expect)((0, hubResourceRename_1.hubBreadcrumbs)(this.page).getByText(name)).toBeVisible({
734
+ timeout: 60000,
735
+ });
736
+ return;
737
+ }
723
738
  // "New form" is the server default the form still carries at this point.
724
739
  await (0, hubResourceRename_1.renameHubResource)(this.page, 'New form', name);
725
740
  }
741
+ // Returns false when no naming dialog opened, i.e. a shell that still
742
+ // creates the file straight away under a placeholder name.
743
+ async submitNewEntityName(name) {
744
+ if (!(await this.becameVisible(this.newEntityNameInput, 10000))) {
745
+ return false;
746
+ }
747
+ await this.newEntityNameInput.fill(name);
748
+ await (0, test_1.expect)(this.newEntityNameInput).toHaveValue(name, { timeout: 10000 });
749
+ await (0, test_1.expect)(this.newEntityNameSubmit).toBeEnabled({ timeout: 15000 });
750
+ await this.newEntityNameSubmit.click({ timeout: 15000 });
751
+ await (0, test_1.expect)(this.newEntityNameInput).toBeHidden({ timeout: 60000 });
752
+ return true;
753
+ }
726
754
  // Kept under its original name because it is what the existing call sites
727
755
  // already mean: "go back to where my resources live". That is now the
728
756
  // process application, not the workspace root.
@@ -47,6 +47,8 @@ declare class ModelerHomePage {
47
47
  readonly renameFormMenuItem: Locator;
48
48
  readonly renameInput: Locator;
49
49
  readonly renameSubmitButton: Locator;
50
+ readonly newEntityNameInput: Locator;
51
+ readonly newEntityNameSubmitButton: Locator;
50
52
  constructor(page: Page);
51
53
  dismissBlockingDialog(): Promise<void>;
52
54
  private dismissUncataloguedDialog;
@@ -63,6 +65,7 @@ declare class ModelerHomePage {
63
65
  startIdpApplicationCreation(): Promise<void>;
64
66
  clickBpmnTemplateOption(): Promise<void>;
65
67
  clickFormOption(): Promise<void>;
68
+ private confirmNewEntityName;
66
69
  enterFormName(name: string): Promise<void>;
67
70
  openFormRenameEditor(): Promise<void>;
68
71
  clickProjectBreadcrumb(): Promise<void>;
@@ -71,6 +71,8 @@ class ModelerHomePage {
71
71
  renameFormMenuItem;
72
72
  renameInput;
73
73
  renameSubmitButton;
74
+ newEntityNameInput;
75
+ newEntityNameSubmitButton;
74
76
  constructor(page) {
75
77
  this.page = page;
76
78
  this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
@@ -257,6 +259,10 @@ class ModelerHomePage {
257
259
  // instead of the legacy inline breadcrumb editor.
258
260
  this.renameInput = page.locator('[data-test="rename-input"]');
259
261
  this.renameSubmitButton = page.locator('[data-test="rename-submit"]');
262
+ // Hub asks for a name before creating a file from "Create new"
263
+ // (camunda-hub NewEntityNameDialog.tsx).
264
+ this.newEntityNameInput = page.locator('[data-test="new-entity-name-input"]');
265
+ this.newEntityNameSubmitButton = page.locator('[data-test="new-entity-name-submit"]');
260
266
  }
261
267
  // An announcement dialog renders over the projects list and swallows every
262
268
  // click on it: Playwright reports the project link as visible, enabled and
@@ -448,9 +454,25 @@ class ModelerHomePage {
448
454
  timeout: 15000,
449
455
  });
450
456
  await this.bpmnTemplateOption.click();
457
+ await this.confirmNewEntityName();
451
458
  }
452
459
  async clickFormOption() {
453
460
  await this.formTemplateOption.click();
461
+ await this.confirmNewEntityName();
462
+ }
463
+ // Keeps the dialog's prefilled name: callers rename the resource afterwards,
464
+ // and the form flow waits on the default "New form" crumb. A failed create
465
+ // leaves the dialog open with Create re-enabled, so submit again.
466
+ async confirmNewEntityName() {
467
+ if (!(await this.becameVisible(this.newEntityNameInput, 15000))) {
468
+ return;
469
+ }
470
+ await (0, test_1.expect)(async () => {
471
+ if (await this.newEntityNameSubmitButton.isVisible()) {
472
+ await this.newEntityNameSubmitButton.click({ timeout: 10000 });
473
+ }
474
+ await (0, test_1.expect)(this.newEntityNameInput).toBeHidden({ timeout: 30000 });
475
+ }).toPass({ timeout: 120000, intervals: [1000, 2000, 5000] });
454
476
  }
455
477
  // The legacy shell opens a fresh form with its breadcrumb name in inline-edit
456
478
  // mode. Nav-v2 has no inline editing: the form stays "New form" until renamed
@@ -37,6 +37,27 @@ function breadcrumbActionsButton(page) {
37
37
  // `currentName` is the server default the resource still carries (e.g.
38
38
  // "New form", "New BPMN diagram"); it is what the gate matches on.
39
39
  async function renameHubResource(page, currentName, newName) {
40
+ // Since camunda-hub#31620 a blank resource is named up front in a "Create
41
+ // <type>" dialog and created under that name, so there is no placeholder
42
+ // resource to rename afterwards. When that dialog is what the create action
43
+ // opened, set the name and confirm here; the resource is then created and
44
+ // opened directly.
45
+ const nameDialogInput = page.locator('[data-test="new-entity-name-input"]');
46
+ const nameDialogSubmit = page.locator('[data-test="new-entity-name-submit"]');
47
+ const hasNameDialog = await nameDialogInput
48
+ .waitFor({ state: 'visible', timeout: 30000 })
49
+ .then(() => true)
50
+ .catch(() => false);
51
+ if (hasNameDialog) {
52
+ await nameDialogInput.fill(newName);
53
+ await (0, test_1.expect)(nameDialogInput).toHaveValue(newName, { timeout: 15000 });
54
+ await (0, test_1.expect)(nameDialogSubmit).toBeEnabled({ timeout: 15000 });
55
+ await nameDialogSubmit.click({ timeout: 15000 });
56
+ // The dialog closes only once the create request resolves; a failed create
57
+ // keeps it open with an error, so its disappearance is the success signal.
58
+ await (0, test_1.expect)(nameDialogInput).toBeHidden({ timeout: 30000 });
59
+ return;
60
+ }
40
61
  const breadcrumbs = hubBreadcrumbs(page);
41
62
  const trigger = breadcrumbActionsButton(page);
42
63
  const renameInput = page.locator('[data-test="rename-input"]');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1734",
3
+ "version": "0.0.1736",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",