@umbraco/playwright-testhelpers 15.0.28 → 15.0.30

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 (42) hide show
  1. package/dist/lib/helpers/ContentUiHelper.d.ts +16 -0
  2. package/dist/lib/helpers/ContentUiHelper.js +80 -5
  3. package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
  4. package/dist/lib/helpers/DataTypeApiHelper.d.ts +5 -0
  5. package/dist/lib/helpers/DataTypeApiHelper.js +54 -0
  6. package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
  7. package/dist/lib/helpers/DataTypeUiHelper.d.ts +29 -29
  8. package/dist/lib/helpers/DataTypeUiHelper.js +69 -69
  9. package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
  10. package/dist/lib/helpers/DocumentApiHelper.d.ts +1 -0
  11. package/dist/lib/helpers/DocumentApiHelper.js +7 -0
  12. package/dist/lib/helpers/DocumentApiHelper.js.map +1 -1
  13. package/dist/lib/helpers/DocumentTypeUiHelper.d.ts +2 -2
  14. package/dist/lib/helpers/DocumentTypeUiHelper.js +5 -5
  15. package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
  16. package/dist/lib/helpers/FormsUiHelper.js +7 -7
  17. package/dist/lib/helpers/FormsUiHelper.js.map +1 -1
  18. package/dist/lib/helpers/LanguageUiHelper.js +2 -2
  19. package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
  20. package/dist/lib/helpers/MemberUiHelper.d.ts +6 -6
  21. package/dist/lib/helpers/MemberUiHelper.js +12 -12
  22. package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
  23. package/dist/lib/helpers/NotificationConstantHelper.d.ts +1 -0
  24. package/dist/lib/helpers/NotificationConstantHelper.js +2 -1
  25. package/dist/lib/helpers/NotificationConstantHelper.js.map +1 -1
  26. package/dist/lib/helpers/ProfilingUiHelper.d.ts +3 -3
  27. package/dist/lib/helpers/ProfilingUiHelper.js +5 -5
  28. package/dist/lib/helpers/ProfilingUiHelper.js.map +1 -1
  29. package/dist/lib/helpers/RelationTypeUiHelper.d.ts +2 -2
  30. package/dist/lib/helpers/RelationTypeUiHelper.js +4 -4
  31. package/dist/lib/helpers/RelationTypeUiHelper.js.map +1 -1
  32. package/dist/lib/helpers/TelemetryDataUiHelper.d.ts +1 -1
  33. package/dist/lib/helpers/TelemetryDataUiHelper.js +4 -4
  34. package/dist/lib/helpers/TelemetryDataUiHelper.js.map +1 -1
  35. package/dist/lib/helpers/UiBaseLocators.d.ts +2 -2
  36. package/dist/lib/helpers/UiBaseLocators.js +4 -4
  37. package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
  38. package/dist/lib/helpers/UserUiHelper.d.ts +4 -4
  39. package/dist/lib/helpers/UserUiHelper.js +8 -8
  40. package/dist/lib/helpers/UserUiHelper.js.map +1 -1
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +1 -1
@@ -140,6 +140,10 @@ export declare class ContentUiHelper extends UiBaseLocators {
140
140
  private readonly rteBlockInline;
141
141
  private readonly backofficeModalContainer;
142
142
  private readonly rteBlock;
143
+ private readonly blockGridAreasContainer;
144
+ private readonly blockGridBlock;
145
+ private readonly blockGridEntries;
146
+ private readonly inlineCreateBtn;
143
147
  constructor(page: Page);
144
148
  enterContentName(name: string): Promise<void>;
145
149
  clickSaveAndPublishButton(): Promise<void>;
@@ -309,6 +313,18 @@ export declare class ContentUiHelper extends UiBaseLocators {
309
313
  clickSelectBlockElementInAreaWithName(elementTypeName: string): Promise<void>;
310
314
  clickBlockElementWithName(elementTypeName: string): Promise<void>;
311
315
  enterPropertyValue(propertyName: string, value: string): Promise<void>;
316
+ doesBlockContainBlockInAreaWithName(blockWithAreaName: string, areaName: string, blockInAreaName: string, index?: number): Promise<void>;
317
+ doesBlockContainBlockCountInArea(blockWithAreaName: string, areaName: string, blocksInAreaCount: number, index?: number): Promise<void>;
318
+ doesBlockContainCountOfBlockInArea(blockWithAreaName: string, areaName: string, blockInAreaName: string, count: number, index?: number): Promise<void>;
319
+ getBlockAtRootDataElementKey(blockName: string, index?: number): Promise<string | null>;
320
+ getBlockAreaKeyFromParentBlockDataElementKey(parentKey: string, index?: number): Promise<string | null>;
321
+ getBlockDataElementKeyInArea(parentBlockName: string, areaName: string, blockName: string, parentIndex?: number, childIndex?: number): Promise<string | null>;
322
+ removeBlockFromArea(parentBlockName: string, areaName: string, blockName: string, parentIndex?: number, childIndex?: number): Promise<void>;
323
+ doesBlockAreaContainColumnSpan(blockWithAreaName: string, areaName: string, columnSpan: number, index?: number): Promise<void>;
324
+ doesBlockAreaContainRowSpan(blockWithAreaName: string, areaName: string, rowSpan: number, index?: number): Promise<void>;
325
+ clickInlineAddToAreaButton(parentBlockName: string, areaName: string, parentIndex?: number, buttonIndex?: number): Promise<void>;
326
+ addBlockToAreasWithExistingBlock(blockWithAreaName: string, areaName: string, parentIndex?: number, addToIndex?: number): Promise<void>;
327
+ doesBlockGridBlockWithAreaContainCreateLabel(blockWithAreaName: string, createLabel: string, index?: number): Promise<void>;
312
328
  doesPropertyContainValue(propertyName: string, value: string): Promise<void>;
313
329
  clickCreateButtonForModalWithElementTypeNameAndGroupName(headlineName: string, groupName: string): Promise<void>;
314
330
  clickUpdateButtonForModalWithElementTypeNameAndGroupName(headlineName: string, groupName: string): Promise<void>;
@@ -144,6 +144,10 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
144
144
  rteBlockInline;
145
145
  backofficeModalContainer;
146
146
  rteBlock;
147
+ blockGridAreasContainer;
148
+ blockGridBlock;
149
+ blockGridEntries;
150
+ inlineCreateBtn;
147
151
  constructor(page) {
148
152
  super(page);
149
153
  this.saveContentBtn = page.locator('[data-mark="workspace-action:Umb.WorkspaceAction.Document.Save"]');
@@ -176,7 +180,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
176
180
  this.linkTitleTxt = this.linkPickerModal.getByLabel('Title');
177
181
  this.tagItems = page.locator('uui-tag');
178
182
  this.removeFilesBtn = page.locator('umb-input-upload-field [label="Remove file(s)"]');
179
- this.toggleBtn = page.locator('umb-property-editor-ui-toggle #slider');
183
+ this.toggleBtn = page.locator('umb-property-editor-ui-toggle #toggle');
180
184
  this.toggleInput = page.locator('umb-property-editor-ui-toggle span');
181
185
  this.documentTypeWorkspace = this.sidebarModal.locator('umb-document-type-workspace-editor');
182
186
  this.addMultipleTextStringBtn = page.locator('umb-input-multiple-text-string').getByLabel('Add');
@@ -270,6 +274,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
270
274
  this.exactCopyBtn = page.getByRole('button', { name: 'Copy', exact: true });
271
275
  this.deleteBlockEntryBtn = page.locator('[label="delete"] svg');
272
276
  this.blockGridEntry = page.locator('umb-block-grid-entry');
277
+ this.blockGridBlock = page.locator('umb-block-grid-block');
273
278
  this.blockListEntry = page.locator('umb-block-list-entry');
274
279
  this.pasteFromClipboardBtn = page.getByLabel('Paste from clipboard');
275
280
  this.pasteBtn = page.getByRole('button', { name: 'Paste', exact: true });
@@ -279,6 +284,9 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
279
284
  this.openActionsMenu = page.getByLabel('Open actions menu');
280
285
  this.replaceExactBtn = page.getByRole('button', { name: 'Replace', exact: true });
281
286
  this.clipboardEntryPicker = page.locator('umb-clipboard-entry-picker');
287
+ this.blockGridAreasContainer = page.locator('umb-block-grid-areas-container');
288
+ this.blockGridEntries = page.locator('umb-block-grid-entries');
289
+ this.inlineCreateBtn = page.locator('uui-button-inline-create');
282
290
  // TipTap
283
291
  this.tipTapPropertyEditor = page.locator('umb-property-editor-ui-tiptap');
284
292
  this.tipTapEditor = this.tipTapPropertyEditor.locator('#editor .tiptap');
@@ -1000,8 +1008,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
1000
1008
  await this.page.getByRole('button', { name: elementTypeName, exact: true }).click();
1001
1009
  }
1002
1010
  async clickSelectBlockElementInAreaWithName(elementTypeName) {
1003
- await (0, test_1.expect)(this.page.getByRole('link', { name: elementTypeName, exact: true })).toBeVisible();
1004
- await this.page.getByRole('link', { name: elementTypeName, exact: true }).click();
1011
+ await (0, test_1.expect)(this.container.getByRole('button', { name: elementTypeName, exact: true })).toBeVisible();
1012
+ await this.container.getByRole('button', { name: elementTypeName, exact: true }).click();
1005
1013
  }
1006
1014
  async clickBlockElementWithName(elementTypeName) {
1007
1015
  await (0, test_1.expect)(this.page.getByRole('link', { name: elementTypeName, exact: true })).toBeVisible();
@@ -1013,6 +1021,73 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
1013
1021
  await property.locator('input').clear();
1014
1022
  await property.locator('input').fill(value);
1015
1023
  }
1024
+ async doesBlockContainBlockInAreaWithName(blockWithAreaName, areaName, blockInAreaName, index = 0) {
1025
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
1026
+ const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1027
+ const blockInArea = area.locator(this.blockGridEntry.filter({ hasText: blockInAreaName }));
1028
+ await (0, test_1.expect)(blockInArea).toBeVisible();
1029
+ }
1030
+ async doesBlockContainBlockCountInArea(blockWithAreaName, areaName, blocksInAreaCount, index = 0) {
1031
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
1032
+ const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1033
+ const blocks = area.locator(this.blockGridEntry);
1034
+ await (0, test_1.expect)(blocks).toHaveCount(blocksInAreaCount);
1035
+ }
1036
+ async doesBlockContainCountOfBlockInArea(blockWithAreaName, areaName, blockInAreaName, count, index = 0) {
1037
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
1038
+ const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1039
+ const blockInArea = area.locator(this.blockGridEntry.filter({ hasText: blockInAreaName }));
1040
+ await (0, test_1.expect)(blockInArea).toHaveCount(count);
1041
+ }
1042
+ async getBlockAtRootDataElementKey(blockName, index = 0) {
1043
+ const blockGridEntrySelector = 'umb-block-grid-entry';
1044
+ return this.blockGridEntries.locator(`.umb-block-grid__layout-container > ${blockGridEntrySelector}`).filter({ hasText: blockName }).nth(index).getAttribute('data-element-key');
1045
+ }
1046
+ async getBlockAreaKeyFromParentBlockDataElementKey(parentKey, index = 0) {
1047
+ const block = this.page.locator(`[data-element-key="${parentKey}"]`);
1048
+ return block.locator(this.blockGridAreasContainer).locator('.umb-block-grid__area-container > umb-block-grid-entries').nth(index).getAttribute('area-key');
1049
+ }
1050
+ async getBlockDataElementKeyInArea(parentBlockName, areaName, blockName, parentIndex = 0, childIndex = 0) {
1051
+ const parentBlock = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: parentBlockName })).nth(parentIndex);
1052
+ const area = parentBlock.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1053
+ const block = area.locator(this.blockGridEntry.filter({ hasText: blockName })).nth(childIndex);
1054
+ return block.getAttribute('data-element-key');
1055
+ }
1056
+ async removeBlockFromArea(parentBlockName, areaName, blockName, parentIndex = 0, childIndex = 0) {
1057
+ const parentBlock = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: parentBlockName })).nth(parentIndex);
1058
+ const area = parentBlock.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1059
+ const block = area.locator(this.blockGridEntry.filter({ hasText: blockName })).nth(childIndex);
1060
+ await block.hover();
1061
+ await block.getByLabel('delete').click({ force: true });
1062
+ }
1063
+ async doesBlockAreaContainColumnSpan(blockWithAreaName, areaName, columnSpan, index = 0) {
1064
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
1065
+ const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1066
+ await (0, test_1.expect)(area).toHaveAttribute('data-area-col-span', columnSpan.toString());
1067
+ }
1068
+ async doesBlockAreaContainRowSpan(blockWithAreaName, areaName, rowSpan, index = 0) {
1069
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
1070
+ const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1071
+ await (0, test_1.expect)(area).toHaveAttribute('data-area-row-span', rowSpan.toString());
1072
+ }
1073
+ async clickInlineAddToAreaButton(parentBlockName, areaName, parentIndex = 0, buttonIndex = 1) {
1074
+ const parentBlock = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: parentBlockName })).nth(parentIndex);
1075
+ const area = parentBlock.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1076
+ await area.locator(this.inlineCreateBtn).nth(buttonIndex).click();
1077
+ }
1078
+ async addBlockToAreasWithExistingBlock(blockWithAreaName, areaName, parentIndex = 0, addToIndex = 0) {
1079
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock).filter({ hasText: blockWithAreaName }).nth(parentIndex);
1080
+ await (0, test_1.expect)(blockWithArea).toBeVisible();
1081
+ await blockWithArea.hover();
1082
+ const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
1083
+ const addBlockBtn = area.locator(this.inlineCreateBtn).nth(addToIndex);
1084
+ await addBlockBtn.hover({ force: true });
1085
+ await addBlockBtn.click({ force: true });
1086
+ }
1087
+ async doesBlockGridBlockWithAreaContainCreateLabel(blockWithAreaName, createLabel, index = 0) {
1088
+ const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
1089
+ return (0, test_1.expect)(blockWithArea.locator(this.blockGridAreasContainer).getByLabel(createLabel)).toBeVisible();
1090
+ }
1016
1091
  async doesPropertyContainValue(propertyName, value) {
1017
1092
  await (0, test_1.expect)(this.property.filter({ hasText: propertyName }).locator('input')).toHaveValue(value);
1018
1093
  }
@@ -1021,8 +1096,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
1021
1096
  await this.blockWorkspace.filter({ hasText: 'Add ' + headlineName }).filter({ hasText: groupName }).getByLabel('Create').click();
1022
1097
  }
1023
1098
  async clickUpdateButtonForModalWithElementTypeNameAndGroupName(headlineName, groupName) {
1024
- await (0, test_1.expect)(this.blockWorkspace.filter({ hasText: 'Edit ' + headlineName }).filter({ hasText: groupName }).getByLabel('Update')).toBeVisible();
1025
- await this.blockWorkspace.filter({ hasText: 'Edit ' + headlineName }).filter({ hasText: groupName }).getByLabel('Update').click();
1099
+ await (0, test_1.expect)(this.blockWorkspace.filter({ hasText: 'Edit ' + headlineName }).filter({ hasText: groupName }).locator(this.updateBtn)).toBeVisible();
1100
+ await this.blockWorkspace.filter({ hasText: 'Edit ' + headlineName }).filter({ hasText: groupName }).locator(this.updateBtn).click();
1026
1101
  }
1027
1102
  async clickExactCopyButton() {
1028
1103
  await (0, test_1.expect)(this.exactCopyBtn).toBeVisible();