@camunda/e2e-test-suite 0.0.1735 → 0.0.1737

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
@@ -51,6 +51,8 @@ declare class ModelerHomePage {
51
51
  readonly renameProjectMenuItem: Locator;
52
52
  readonly defaultNamedProjectRow: Locator;
53
53
  readonly renameMenuItem: Locator;
54
+ readonly newEntityNameInput: Locator;
55
+ readonly newEntityNameSubmitButton: Locator;
54
56
  constructor(page: Page);
55
57
  dismissOverlays(): Promise<void>;
56
58
  clickCreateNewProjectButton(): Promise<void>;
@@ -65,6 +67,7 @@ declare class ModelerHomePage {
65
67
  clickWorkspaceDiagramTypeDropdown(): Promise<void>;
66
68
  clickBpmnTemplateOption(): Promise<void>;
67
69
  clickFormOption(): Promise<void>;
70
+ private confirmNewEntityName;
68
71
  enterFormName(name: string): Promise<void>;
69
72
  openFormRenameEditor(): Promise<void>;
70
73
  enterFormNameWithRetry(name: string): Promise<void>;
@@ -75,6 +75,8 @@ class ModelerHomePage {
75
75
  renameProjectMenuItem;
76
76
  defaultNamedProjectRow;
77
77
  renameMenuItem;
78
+ newEntityNameInput;
79
+ newEntityNameSubmitButton;
78
80
  constructor(page) {
79
81
  this.page = page;
80
82
  this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
@@ -264,6 +266,10 @@ class ModelerHomePage {
264
266
  // addresses the still-unnamed project the create flow just added.
265
267
  this.defaultNamedProjectRow = page.locator(`[data-test="entity-${this.defaultNewProjectName}"]`);
266
268
  this.renameMenuItem = page.getByRole('menuitem', { name: 'Rename' });
269
+ // camunda-hub #31596 asks for the resource name up front: a create-menu item
270
+ // now opens this dialog (NewEntityNameDialog) before the resource exists.
271
+ this.newEntityNameInput = page.locator('[data-test="new-entity-name-input"]');
272
+ this.newEntityNameSubmitButton = page.locator('[data-test="new-entity-name-submit"]');
267
273
  }
268
274
  async dismissOverlays() {
269
275
  // Before the generic pass, for the same reason
@@ -459,10 +465,21 @@ class ModelerHomePage {
459
465
  async clickBpmnTemplateOption() {
460
466
  const maxAttempts = 3;
461
467
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
462
- await (0, test_1.expect)(this.bpmnTemplateOption).toBeVisible({
463
- timeout: 15000,
468
+ // A failed create keeps the naming dialog open; resubmit it rather than
469
+ // reopening a menu the dialog's overlay covers.
470
+ if (!(await this.newEntityNameInput.isVisible())) {
471
+ await (0, test_1.expect)(this.bpmnTemplateOption).toBeVisible({
472
+ timeout: 15000,
473
+ });
474
+ await this.bpmnTemplateOption.click();
475
+ }
476
+ // #31596: confirm the naming dialog so the diagram is created and opens.
477
+ await this.confirmNewEntityName().catch((error) => {
478
+ if (attempt === maxAttempts) {
479
+ throw error;
480
+ }
481
+ return false;
464
482
  });
465
- await this.bpmnTemplateOption.click();
466
483
  const opened = await this.page
467
484
  .waitForURL(/\/diagrams\//, { timeout: 60000 })
468
485
  .then(() => true)
@@ -471,12 +488,31 @@ class ModelerHomePage {
471
488
  return;
472
489
  }
473
490
  console.warn(`No diagram opened on attempt ${attempt}; re-opening the create menu.`);
474
- await this.clickDiagramTypeDropdown();
491
+ if (!(await this.newEntityNameInput.isVisible())) {
492
+ await this.clickDiagramTypeDropdown();
493
+ }
475
494
  }
476
495
  }
477
496
  async clickFormOption() {
478
497
  await this.formTemplateOption.click();
479
498
  }
499
+ // camunda-hub #31596 asks for the resource name up front: a create-menu item
500
+ // now opens this dialog (NewEntityNameDialog) before the resource exists,
501
+ // instead of creating a placeholder renamed afterwards. Fills `name` when
502
+ // given, else accepts the prefilled default; returns false on a build that
503
+ // predates the dialog so the caller falls back to the old rename flow.
504
+ async confirmNewEntityName(name) {
505
+ if (!(await this.becameVisible(this.newEntityNameInput, 15000))) {
506
+ return false;
507
+ }
508
+ if (name !== undefined) {
509
+ await this.newEntityNameInput.fill(name, { timeout: 30000 });
510
+ await (0, test_1.expect)(this.newEntityNameInput).toHaveValue(name, { timeout: 5000 });
511
+ }
512
+ await this.newEntityNameSubmitButton.click({ timeout: 10000 });
513
+ await (0, test_1.expect)(this.newEntityNameInput).toBeHidden({ timeout: 30000 });
514
+ return true;
515
+ }
480
516
  // The legacy shell opens a fresh form with its breadcrumb name in inline-edit
481
517
  // mode. Nav-v2 has no inline editing: the form stays "New form" until renamed
482
518
  // through the crumb's "<name> actions" kebab and the shared rename dialog.
@@ -489,6 +525,14 @@ class ModelerHomePage {
489
525
  if (await this.formNameBreadcrumb(name).isVisible()) {
490
526
  return;
491
527
  }
528
+ // #31596: the form is named in this create dialog instead of being
529
+ // created as "New form" and renamed through the breadcrumb.
530
+ if (await this.confirmNewEntityName(name)) {
531
+ await (0, test_1.expect)(this.formNameBreadcrumb(name)).toBeVisible({
532
+ timeout: 30000,
533
+ });
534
+ return;
535
+ }
492
536
  const editorOpen = await this.becameVisible(this.formNameInput.or(this.renameInput).first(), 15000);
493
537
  if (!editorOpen) {
494
538
  await this.openFormRenameEditor();
@@ -148,6 +148,7 @@ declare class ModelerCreatePage {
148
148
  clickDiagramBreadcrumb(): Promise<void>;
149
149
  clickEditDiagramNameButton(): Promise<void>;
150
150
  enterDiagramName(name: string): Promise<void>;
151
+ private isDiagramNameEditorOpen;
151
152
  clickVariableInput(): Promise<void>;
152
153
  fillVariableInput(variable: string): Promise<void>;
153
154
  clickEmbedFormButton(): Promise<void>;
@@ -964,6 +964,12 @@ class ModelerCreatePage {
964
964
  const maxAttempts = 3;
965
965
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
966
966
  try {
967
+ // Since hub names files in a dialog before creating them (camunda-hub
968
+ // #31596) the inline editor no longer opens on a new diagram.
969
+ if (attempt === 1 && !(await this.isDiagramNameEditorOpen())) {
970
+ await this.clickDiagramBreadcrumb();
971
+ await this.clickEditDiagramNameButton();
972
+ }
967
973
  // The design-system nav's Rename opens a modal dialog
968
974
  // (RenameDialogDs.tsx) instead of the legacy inline breadcrumb
969
975
  // editor -- fill and submit whichever is actually open.
@@ -1000,6 +1006,15 @@ class ModelerCreatePage {
1000
1006
  }
1001
1007
  }
1002
1008
  }
1009
+ async isDiagramNameEditorOpen() {
1010
+ if (await this.renameDialog.isVisible().catch(() => false)) {
1011
+ return true;
1012
+ }
1013
+ return this.diagramNameInput
1014
+ .waitFor({ state: 'visible', timeout: 10000 })
1015
+ .then(() => this.diagramNameInput.isEditable())
1016
+ .catch(() => false);
1017
+ }
1003
1018
  async clickVariableInput() {
1004
1019
  await this.variableInput.click({ timeout: 60000 });
1005
1020
  }
@@ -60,6 +60,7 @@ declare class ModelerHomePage {
60
60
  clickBpmnTemplateOption(): Promise<void>;
61
61
  clickIdpApplicationTemplateOption(): Promise<void>;
62
62
  clickFormOption(): Promise<void>;
63
+ private confirmNewEntityNameDialog;
63
64
  enterFormName(name: string): Promise<void>;
64
65
  openFormRenameEditor(): Promise<void>;
65
66
  clickProjectBreadcrumb(): Promise<void>;
@@ -353,12 +353,24 @@ class ModelerHomePage {
353
353
  await this.page.waitForTimeout(3000);
354
354
  await this.bpmnTemplateOption.click({ force: true, timeout: 60000 });
355
355
  }
356
+ await this.confirmNewEntityNameDialog();
356
357
  }
357
358
  async clickIdpApplicationTemplateOption() {
358
359
  await this.idpTemplateOption.click({ timeout: 120000 });
359
360
  }
360
361
  async clickFormOption() {
361
362
  await this.formTemplateOption.click();
363
+ await this.confirmNewEntityNameDialog();
364
+ }
365
+ // Hub asks for a name before creating a file (camunda-hub #31596). Callers
366
+ // rename the file afterwards, so accept the prefilled default.
367
+ async confirmNewEntityNameDialog() {
368
+ const submit = this.page.locator('[data-test="new-entity-name-submit"]');
369
+ if (!(await this.becameVisible(submit, 15000))) {
370
+ return;
371
+ }
372
+ await submit.click({ timeout: 30000 });
373
+ await (0, test_1.expect)(submit).toBeHidden({ timeout: 60000 });
362
374
  }
363
375
  // Right after a form is created the hub renders its breadcrumb name in
364
376
  // inline-edit mode, but once the form store finishes loading it re-renders
@@ -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
@@ -1051,11 +1051,11 @@ class ModelerCreatePage {
1051
1051
  }
1052
1052
  async fillStartEventVariablesForDocHandling(zeebeUrl, zeebeClientId, zeebeClientSecret) {
1053
1053
  console.log(`URL: ${zeebeUrl}, ClientId: ${zeebeClientId}, Secret: ${zeebeClientSecret}`);
1054
- (0, test_1.expect)(this.connectorsDocHandlingStartEventElement).toBeVisible({
1054
+ await (0, test_1.expect)(this.connectorsDocHandlingStartEventElement).toBeVisible({
1055
1055
  timeout: 60000,
1056
1056
  });
1057
1057
  await this.connectorsDocHandlingStartEventElement.click();
1058
- (0, test_1.expect)(this.startEventVariableInputWithThreeVariables).toBeVisible({
1058
+ await (0, test_1.expect)(this.startEventVariableInputWithThreeVariables).toBeVisible({
1059
1059
  timeout: 60000,
1060
1060
  });
1061
1061
  await this.startEventVariableInputWithThreeVariables.click();
@@ -554,13 +554,16 @@ async function publishRestConnectorTemplateToProject(page, modelerHomePage) {
554
554
  async function modelAndRunConnectorsDocHandlingDiagram(modelerCreatePage, modelerHomePage, processName, page, connectorMarketplacePage, zeebeUrl, zeebeClientId, zeebeClientSecret, endpoint, tenant = '') {
555
555
  await modelerHomePage.clickCrossComponentProjectFolder();
556
556
  await publishRestConnectorTemplateToProject(page, modelerHomePage);
557
+ // Upload a uniquely named copy: parallel workers sharing one diagram
558
+ // overwrite each other's name, process id and connector settings live.
559
+ const bpmnContent = (0, fileUpload_1.readResourceFile)('SM-8.9/SM_Document_Handling_Connectors_User_Flow.bpmn').replaceAll('SM_Document_Handling_Connectors_User_Flow', processName);
557
560
  await modelerHomePage.clickDiagramTypeDropdown();
558
561
  await modelerHomePage.clickUploadFilesButton();
559
- await (0, fileUpload_1.uploadFile)(page, 'SM-8.9/SM_Document_Handling_Connectors_User_Flow.bpmn');
560
- await modelerHomePage.clickProcessDiagram('SM_Document_Handling_Connectors_User_Flow');
561
- await modelerCreatePage.clickDiagramBreadcrumb();
562
- await modelerCreatePage.clickEditDiagramNameButton();
563
- await modelerCreatePage.enterDiagramName(processName);
562
+ await (0, fileUpload_1.uploadFileContent)(page, {
563
+ name: `${processName}.bpmn`,
564
+ buffer: Buffer.from(bpmnContent),
565
+ });
566
+ await modelerHomePage.clickProcessDiagram(processName);
564
567
  await modelerCreatePage.clickGeneralPropertiesPanel();
565
568
  await modelerCreatePage.clickNameInput();
566
569
  await modelerCreatePage.fillNameInput(processName);
@@ -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.1737",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",