@umbraco/playwright-testhelpers 16.0.11 → 16.0.13

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.
Files changed (29) hide show
  1. package/dist/lib/helpers/ContentUiHelper.js +2 -2
  2. package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
  3. package/dist/lib/helpers/CurrentUserProfileUiHelper.js +1 -1
  4. package/dist/lib/helpers/CurrentUserProfileUiHelper.js.map +1 -1
  5. package/dist/lib/helpers/DataTypeUiHelper.js +4 -4
  6. package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
  7. package/dist/lib/helpers/DictionaryUiHelper.js +1 -1
  8. package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
  9. package/dist/lib/helpers/LanguageUiHelper.d.ts +1 -0
  10. package/dist/lib/helpers/LanguageUiHelper.js +3 -2
  11. package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
  12. package/dist/lib/helpers/MediaUiHelper.js +1 -1
  13. package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
  14. package/dist/lib/helpers/MemberGroupUiHelper.js +1 -1
  15. package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -1
  16. package/dist/lib/helpers/MemberUiHelper.d.ts +2 -0
  17. package/dist/lib/helpers/MemberUiHelper.js +6 -0
  18. package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
  19. package/dist/lib/helpers/PartialViewUiHelper.js +2 -2
  20. package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
  21. package/dist/lib/helpers/ScriptUiHelper.js +2 -2
  22. package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
  23. package/dist/lib/helpers/StylesheetUiHelper.js +1 -1
  24. package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
  25. package/dist/lib/helpers/UiBaseLocators.d.ts +24 -3
  26. package/dist/lib/helpers/UiBaseLocators.js +87 -20
  27. package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +1 -1
@@ -73,7 +73,6 @@ class UiBaseLocators {
73
73
  aliasNameTxt;
74
74
  deleteFolderThreeDotsBtn;
75
75
  createLink;
76
- actionMenucreateBtn;
77
76
  insertValueBtn;
78
77
  insertPartialViewBtn;
79
78
  insertDictionaryItemBtn;
@@ -146,6 +145,8 @@ class UiBaseLocators {
146
145
  entityItemRef;
147
146
  validationMessage;
148
147
  successStateIcon;
148
+ entityAction;
149
+ openEntityAction;
149
150
  constructor(page) {
150
151
  this.page = page;
151
152
  this.saveBtn = page.getByLabel('Save', { exact: true });
@@ -180,7 +181,6 @@ class UiBaseLocators {
180
181
  this.renameModalBtn = page.locator('umb-rename-modal').getByLabel('Rename');
181
182
  this.createBtn = page.getByRole('button', { name: /^Create(…)?$/ });
182
183
  this.actionsMenuContainer = page.locator('uui-scroll-container');
183
- this.actionMenucreateBtn = this.actionsMenuContainer.getByRole('button', { name: /^Create(…)?$/ });
184
184
  this.successState = page.locator('[state="success"]');
185
185
  this.chooseModalBtn = this.sidebarModal.locator('[look="primary"]').getByLabel('Choose');
186
186
  this.addBtn = page.getByRole('button', { name: 'Add', exact: true });
@@ -289,19 +289,18 @@ class UiBaseLocators {
289
289
  this.entityItemRef = this.confirmActionModalEntityReferences.locator('umb-entity-item-ref');
290
290
  this.validationMessage = page.locator('umb-form-validation-message').locator('#messages');
291
291
  this.successStateIcon = this.successState.locator('#state');
292
- }
293
- async clickActionsMenuForNameInSectionSidebar(name) {
294
- await this.sectionSidebar.locator('[label="' + name + '"]').hover();
295
- await this.sectionSidebar.locator('[label="' + name + '"] >> [label="Open actions menu"]').first().click();
292
+ // Entity Action
293
+ this.entityAction = page.locator('umb-entity-action-list umb-entity-action');
294
+ this.openEntityAction = page.locator('#action-modal[open]').locator(this.entityAction);
296
295
  }
297
296
  async clickActionsMenuForName(name) {
298
- await (0, test_1.expect)(this.page.locator('[label="' + name + '"]')).toBeVisible();
299
- await this.page.locator('[label="' + name + '"]').hover();
300
- await this.page.locator('[label="' + name + '"] >> [label="Open actions menu"]').first().click();
297
+ await (0, test_1.expect)(this.page.locator('uui-menu-item[label="' + name + '"]')).toBeVisible();
298
+ await this.page.locator('uui-menu-item[label="' + name + '"]').hover();
299
+ await this.page.locator('uui-menu-item[label="' + name + '"] #action-modal').first().click();
301
300
  }
302
301
  async isActionsMenuForNameVisible(name, isVisible = true) {
303
- await this.page.locator('[label="' + name + '"]').click();
304
- await (0, test_1.expect)(this.page.locator('[label="' + name + '"] >> [label="Open actions menu"]')).toBeVisible({ visible: isVisible });
302
+ await this.page.locator('uui-menu-item[label="' + name + '"]').click();
303
+ await (0, test_1.expect)(this.page.locator('uui-menu-item[label="' + name + '"] #action-modal').first()).toBeVisible({ visible: isVisible });
305
304
  }
306
305
  async clickCaretButtonForName(name) {
307
306
  await this.isCaretButtonWithNameVisible(name);
@@ -318,7 +317,7 @@ class UiBaseLocators {
318
317
  await (0, test_1.expect)(this.page.getByLabel(treeName, { exact: true })).toBeVisible();
319
318
  await this.page.waitForTimeout(500);
320
319
  await this.clickActionsMenuForName(treeName);
321
- await this.clickReloadChildrenButton();
320
+ await this.clickReloadChildrenActionMenuOption();
322
321
  const menuItem = this.page.locator('uui-menu-item[label="' + treeName + '"]');
323
322
  const isCaretButtonOpen = await menuItem.getAttribute('show-children');
324
323
  if (isCaretButtonOpen === null) {
@@ -502,7 +501,7 @@ class UiBaseLocators {
502
501
  await ddlOption.click();
503
502
  }
504
503
  async createFolder(folderName) {
505
- await this.clickActionsMenuCreateButton();
504
+ await this.clickCreateActionMenuOption();
506
505
  await this.clickNewFolderThreeDotsButton();
507
506
  await this.enterFolderName(folderName);
508
507
  await this.clickConfirmCreateFolderButton();
@@ -527,7 +526,7 @@ class UiBaseLocators {
527
526
  await (0, test_1.expect)(this.queryBuilderShowCode).toContainText(code, { timeout: 10000 });
528
527
  }
529
528
  async deleteFolder() {
530
- await this.clickDeleteButton();
529
+ await this.clickDeleteActionMenuOption();
531
530
  await this.clickConfirmToDeleteButton();
532
531
  }
533
532
  async clickDeleteExactButton() {
@@ -590,10 +589,6 @@ class UiBaseLocators {
590
589
  await (0, test_1.expect)(this.createBtn).toBeVisible();
591
590
  await this.createBtn.click();
592
591
  }
593
- async clickActionsMenuCreateButton() {
594
- await (0, test_1.expect)(this.actionMenucreateBtn).toBeVisible();
595
- await this.actionMenucreateBtn.click();
596
- }
597
592
  async clickAddButton() {
598
593
  await (0, test_1.expect)(this.addBtn).toBeVisible();
599
594
  await this.addBtn.click();
@@ -705,12 +700,13 @@ class UiBaseLocators {
705
700
  return await (0, test_1.expect)(this.groupLabel).toHaveValue(value);
706
701
  }
707
702
  async rename(newName) {
708
- await this.clickRenameButton();
703
+ await this.clickRenameActionMenuOption();
709
704
  await (0, test_1.expect)(this.newNameTxt).toBeVisible();
710
705
  await this.newNameTxt.click();
711
706
  await this.newNameTxt.clear();
712
707
  await this.newNameTxt.fill(newName);
713
708
  await this.renameModalBtn.click();
709
+ await this.page.waitForTimeout(500);
714
710
  }
715
711
  async isSuccessButtonWithTextVisible(text) {
716
712
  return await (0, test_1.expect)(this.successState.filter({ hasText: text })).toBeVisible();
@@ -772,7 +768,7 @@ class UiBaseLocators {
772
768
  await this.renameBtn.click();
773
769
  }
774
770
  async clickDeleteAndConfirmButton() {
775
- await this.clickDeleteButton();
771
+ await this.clickDeleteActionMenuOption();
776
772
  await this.clickConfirmToDeleteButton();
777
773
  }
778
774
  async clickDeleteButton() {
@@ -1043,6 +1039,77 @@ class UiBaseLocators {
1043
1039
  async isSuccessStateIconVisible() {
1044
1040
  await (0, test_1.expect)(this.successStateIcon).toBeVisible();
1045
1041
  }
1042
+ // Entity Action
1043
+ async clickEntityActionWithName(name) {
1044
+ const regex = new RegExp(`^entity-action:.*${name}$`);
1045
+ const entityActionLocator = this.openEntityAction.getByTestId(regex).first();
1046
+ await (0, test_1.expect)(entityActionLocator).toBeVisible();
1047
+ await entityActionLocator.click();
1048
+ }
1049
+ async clickCreateActionMenuOption() {
1050
+ await this.clickEntityActionWithName('Create');
1051
+ }
1052
+ async clickTrashActionMenuOption() {
1053
+ await this.clickEntityActionWithName('Trash');
1054
+ }
1055
+ async clickMoveToActionMenuOption() {
1056
+ await this.clickEntityActionWithName('MoveTo');
1057
+ }
1058
+ async clickCreateBlueprintActionMenuOption() {
1059
+ await this.clickEntityActionWithName('CreateBlueprint');
1060
+ }
1061
+ async clickDuplicateToActionMenuOption() {
1062
+ await this.clickEntityActionWithName('DuplicateTo');
1063
+ }
1064
+ async clickPublishActionMenuOption() {
1065
+ await this.clickEntityActionWithName('Publish');
1066
+ }
1067
+ async clickUnpublishActionMenuOption() {
1068
+ await this.clickEntityActionWithName('Unpublish');
1069
+ }
1070
+ async clickRollbackActionMenuOption() {
1071
+ await this.clickEntityActionWithName('Rollback');
1072
+ }
1073
+ async clickCultureAndHostnamesActionMenuOption() {
1074
+ await this.clickEntityActionWithName('CultureAndHostnames');
1075
+ }
1076
+ async clickPublicAccessActionMenuOption() {
1077
+ await this.clickEntityActionWithName('PublicAccess');
1078
+ }
1079
+ async clickSortChildrenActionMenuOption() {
1080
+ await this.clickEntityActionWithName('SortChildrenOf');
1081
+ }
1082
+ async clickNotificationsActionMenuOption() {
1083
+ await this.clickEntityActionWithName('Notifications');
1084
+ }
1085
+ async clickReloadChildrenActionMenuOption() {
1086
+ await this.clickEntityActionWithName('ReloadChildrenOf');
1087
+ }
1088
+ async clickDeleteActionMenuOption() {
1089
+ await this.clickEntityActionWithName('Delete');
1090
+ }
1091
+ async clickRestoreActionMenuOption() {
1092
+ await this.clickEntityActionWithName('Restore');
1093
+ }
1094
+ async clickRenameActionMenuOption() {
1095
+ await this.clickEntityActionWithName('Rename');
1096
+ }
1097
+ async clickCreateOptionsActionMenuOption() {
1098
+ await this.clickEntityActionWithName('CreateOptions');
1099
+ }
1100
+ async clickExportActionMenuOption() {
1101
+ await this.clickEntityActionWithName('Export');
1102
+ }
1103
+ async clickImportActionMenuOption() {
1104
+ await this.clickEntityActionWithName('Import');
1105
+ }
1106
+ async clickUpdateActionMenuOption() {
1107
+ await this.clickEntityActionWithName('Update');
1108
+ }
1109
+ async clickModalMenuItemWithName(name) {
1110
+ await (0, test_1.expect)(this.sidebarModal.locator('uui-menu-item[label="' + name + '"]')).toBeVisible();
1111
+ await this.sidebarModal.locator('uui-menu-item[label="' + name + '"]').click();
1112
+ }
1046
1113
  }
1047
1114
  exports.UiBaseLocators = UiBaseLocators;
1048
1115
  //# sourceMappingURL=UiBaseLocators.js.map