@camunda/e2e-test-suite 0.0.1735 → 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
@@ -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.1735",
3
+ "version": "0.0.1736",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",