@umbraco/playwright-testhelpers 15.0.20 → 15.0.21

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 (32) hide show
  1. package/dist/lib/helpers/ContentUiHelper.d.ts +5 -1
  2. package/dist/lib/helpers/ContentUiHelper.js +37 -20
  3. package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
  4. package/dist/lib/helpers/DataTypeUiHelper.d.ts +2 -2
  5. package/dist/lib/helpers/DataTypeUiHelper.js +11 -11
  6. package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
  7. package/dist/lib/helpers/DictionaryUiHelper.js +3 -3
  8. package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
  9. package/dist/lib/helpers/DocumentTypeUiHelper.js +1 -1
  10. package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
  11. package/dist/lib/helpers/FormsUiHelper.js +4 -4
  12. package/dist/lib/helpers/FormsUiHelper.js.map +1 -1
  13. package/dist/lib/helpers/MediaTypeUiHelper.js +1 -1
  14. package/dist/lib/helpers/MediaTypeUiHelper.js.map +1 -1
  15. package/dist/lib/helpers/MediaUiHelper.js +2 -2
  16. package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
  17. package/dist/lib/helpers/PartialViewUiHelper.d.ts +2 -0
  18. package/dist/lib/helpers/PartialViewUiHelper.js +8 -0
  19. package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
  20. package/dist/lib/helpers/ScriptUiHelper.d.ts +2 -0
  21. package/dist/lib/helpers/ScriptUiHelper.js +8 -0
  22. package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
  23. package/dist/lib/helpers/StylesheetUiHelper.d.ts +2 -0
  24. package/dist/lib/helpers/StylesheetUiHelper.js +8 -0
  25. package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
  26. package/dist/lib/helpers/UiBaseLocators.js +10 -8
  27. package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
  28. package/dist/lib/helpers/UserUiHelper.d.ts +1 -1
  29. package/dist/lib/helpers/UserUiHelper.js +4 -3
  30. package/dist/lib/helpers/UserUiHelper.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +1 -1
@@ -134,6 +134,8 @@ export declare class ContentUiHelper extends UiBaseLocators {
134
134
  private readonly insertBlockBtn;
135
135
  private readonly validationMessage;
136
136
  private readonly blockWorkspace;
137
+ private readonly saveContentBtn;
138
+ private readonly splitView;
137
139
  constructor(page: Page);
138
140
  enterContentName(name: string): Promise<void>;
139
141
  clickSaveAndPublishButton(): Promise<void>;
@@ -147,6 +149,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
147
149
  clickCaretButtonForContentName(name: string): Promise<void>;
148
150
  waitForModalVisible(): Promise<void>;
149
151
  waitForModalHidden(): Promise<void>;
152
+ clickSaveButtonForContent(): Promise<void>;
150
153
  enterTextstring(text: string): Promise<void>;
151
154
  doesContentTreeHaveName(contentName: string): Promise<void>;
152
155
  enterRichTextArea(value: string): Promise<void>;
@@ -256,6 +259,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
256
259
  clickConfirmEmptyRecycleBinButton(): Promise<void>;
257
260
  isDocumentPropertyEditable(propertyName: string, isEditable?: boolean): Promise<void>;
258
261
  doesDocumentPropertyHaveValue(propertyName: string, value: string): Promise<void>;
262
+ clickContentTab(): Promise<void>;
259
263
  isDocumentTreeEmpty(): Promise<void>;
260
264
  doesDocumentWorkspaceContainName(name: string): Promise<void>;
261
265
  doesDocumentWorkspaceHaveText(text: string): Promise<void>;
@@ -283,7 +287,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
283
287
  clickManualLinkButton(): Promise<void>;
284
288
  clickAddBlockElementButton(): Promise<void>;
285
289
  isAddBlockElementButtonVisible(isVisible?: boolean): Promise<void>;
286
- isAddBlockElementButtonWithLabelVisible(label: string, isVisible?: boolean): Promise<void>;
290
+ isAddBlockElementButtonWithLabelVisible(blockName: string, label: string, isVisible?: boolean): Promise<void>;
287
291
  doesFormValidationMessageContainText(text: string): Promise<void>;
288
292
  doesBlockElementHaveName(name: string): Promise<void>;
289
293
  clickAddBlockSettingsTabButton(): Promise<void>;
@@ -138,18 +138,21 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
138
138
  insertBlockBtn;
139
139
  validationMessage;
140
140
  blockWorkspace;
141
+ saveContentBtn;
142
+ splitView;
141
143
  constructor(page) {
142
144
  super(page);
145
+ this.saveContentBtn = page.locator('[data-mark="workspace-action:Umb.WorkspaceAction.Document.Save"]');
143
146
  this.closeBtn = page.getByRole('button', { name: 'Close', exact: true });
144
147
  this.linkPickerModal = page.locator('umb-link-picker-modal');
145
148
  this.contentNameTxt = page.locator('#name-input input');
146
149
  this.saveAndPublishBtn = page.getByLabel('Save And Publish');
147
- this.publishBtn = page.getByLabel(/^Publish(\.\.\.)?$/);
148
- this.unpublishBtn = page.getByLabel(/^Unpublish(\.\.\.)?$/);
150
+ this.publishBtn = page.getByLabel(/^Publish()?$/);
151
+ this.unpublishBtn = page.getByLabel(/^Unpublish()?$/);
149
152
  this.actionMenuForContentBtn = page.locator('#header [label="Open actions menu"]');
150
153
  this.openedModal = page.locator('uui-modal-container[backdrop]');
151
154
  this.textstringTxt = page.locator('umb-property-editor-ui-text-box #input');
152
- this.reloadChildrenThreeDotsBtn = page.getByRole('button', { name: 'Reload children...' });
155
+ this.reloadChildrenThreeDotsBtn = page.getByRole('button', { name: 'Reload children' });
153
156
  this.contentTree = page.locator('umb-tree[alias="Umb.Tree.Document"]');
154
157
  this.richTextAreaTxt = page.frameLocator('iframe[title="Rich Text Area"]').locator('#tinymce');
155
158
  this.textAreaTxt = page.locator('umb-property-editor-ui-textarea textarea');
@@ -158,12 +161,13 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
158
161
  this.menuItemTree = page.locator('umb-menu-item-tree-default');
159
162
  this.confirmToUnpublishBtn = page.locator('umb-document-unpublish-modal').getByLabel('Unpublish');
160
163
  this.dropdown = page.locator('select#native');
161
- this.setADateTxt = page.getByLabel('Set a date...');
164
+ this.splitView = page.locator('#splitViews');
165
+ this.setADateTxt = page.getByLabel('Set a date…');
162
166
  this.chooseMediaPickerBtn = page.locator('umb-property-editor-ui-media-picker #btn-add');
163
167
  this.chooseMemberPickerBtn = page.locator('umb-property-editor-ui-member-picker #btn-add');
164
168
  this.numericTxt = page.locator('umb-property-editor-ui-number input');
165
169
  this.addMultiURLPickerBtn = page.locator('umb-property-editor-ui-multi-url-picker #btn-add');
166
- this.linkTxt = page.getByLabel('Enter a URL...', { exact: true });
170
+ this.linkTxt = page.getByLabel('Enter a URL', { exact: true });
167
171
  this.anchorQuerystringTxt = page.getByLabel('#value or ?key=value');
168
172
  this.linkTitleTxt = this.linkPickerModal.getByLabel('Title');
169
173
  this.tagItems = page.locator('uui-tag');
@@ -197,7 +201,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
197
201
  this.addTemplateBtn = this.generalItem.filter({ hasText: 'Template' }).locator('#button');
198
202
  this.id = this.generalItem.filter({ hasText: 'Id' }).locator('span');
199
203
  // Culture and Hostname
200
- this.cultureAndHostnamesBtn = page.getByLabel(/^Culture and Hostnames(\.\.\.)?$/);
204
+ this.cultureAndHostnamesBtn = page.getByLabel(/^Culture and Hostnames()?$/);
201
205
  this.cultureLanguageDropdownBox = page.locator('[headline="Culture"]').getByLabel('combobox-input');
202
206
  this.addNewDomainBtn = page.getByLabel('Add new domain');
203
207
  this.domainTxt = page.getByLabel('Domain', { exact: true });
@@ -207,17 +211,17 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
207
211
  this.saveModalBtn = this.sidebarModal.getByLabel('Save', { exact: true });
208
212
  this.resetFocalPointBtn = this.page.getByLabel('Reset focal point');
209
213
  // List View
210
- this.enterNameInContainerTxt = this.container.getByLabel('Enter a name...');
214
+ this.enterNameInContainerTxt = this.container.getByLabel('Enter a name');
211
215
  this.listView = page.locator('umb-document-table-collection-view');
212
216
  this.nameBtn = page.getByRole('button', { name: 'Name' });
213
217
  this.listViewTableRow = this.listView.locator('uui-table-row');
214
- this.publishSelectedListItems = page.getByRole('button', { name: /^Publish(\.\.\.)?$/ });
215
- this.unpublishSelectedListItems = page.getByRole('button', { name: /^Unpublish(\.\.\.)?$/ });
216
- this.duplicateToSelectedListItems = page.getByRole('button', { name: /^Duplicate to(\.\.\.)?$/ });
217
- this.moveToSelectedListItems = page.getByRole('button', { name: /^Move to(\.\.\.)?$/ });
218
- this.trashSelectedListItems = page.getByRole('button', { name: /^Trash(\.\.\.)?$/ });
218
+ this.publishSelectedListItems = page.getByRole('button', { name: /^Publish()?$/ });
219
+ this.unpublishSelectedListItems = page.getByRole('button', { name: /^Unpublish()?$/ });
220
+ this.duplicateToSelectedListItems = page.getByRole('button', { name: /^Duplicate to()?$/ });
221
+ this.moveToSelectedListItems = page.getByRole('button', { name: /^Move to()?$/ });
222
+ this.trashSelectedListItems = page.getByRole('button', { name: /^Trash()?$/ });
219
223
  this.modalContent = page.locator('umb-tree-picker-modal');
220
- this.trashBtn = page.getByLabel(/^Trash(\.\.\.)?$/);
224
+ this.trashBtn = page.getByLabel(/^Trash()?$/);
221
225
  this.exactTrashBtn = page.getByRole('button', { name: 'Trash', exact: true });
222
226
  this.documentListView = page.locator('umb-document-table-collection-view');
223
227
  this.documentGridView = page.locator('umb-document-grid-collection-view');
@@ -232,7 +236,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
232
236
  this.duplicateBtn = page.getByLabel('Duplicate', { exact: true });
233
237
  this.contentTreeRefreshBtn = page.locator('#header').getByLabel('#actions_refreshNode');
234
238
  this.sortChildrenBtn = page.getByRole('button', { name: 'Sort children' });
235
- this.rollbackBtn = page.getByRole('button', { name: 'Rollback' });
239
+ this.rollbackBtn = page.getByRole('button', { name: 'Rollback', exact: true });
236
240
  this.rollbackContainerBtn = this.container.getByLabel('Rollback');
237
241
  this.publicAccessBtn = page.getByRole('button', { name: 'Public Access' });
238
242
  this.uuiCheckbox = page.locator('uui-checkbox');
@@ -253,7 +257,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
253
257
  this.umbDocumentCollection = page.locator('umb-document-collection');
254
258
  this.documentTableColumnName = this.listView.locator('umb-document-table-column-name');
255
259
  //Block Grid - Block List
256
- this.addBlockElementBtn = page.locator('uui-button-group uui-button').first().locator('a#button');
260
+ this.addBlockElementBtn = page.locator('uui-button-group uui-button').first().filter({ has: page.locator('a#button') });
257
261
  this.formValidationMessage = page.locator('#splitViews umb-form-validation-message #messages');
258
262
  this.blockName = page.locator('#editor [slot="name"]');
259
263
  this.addBlockSettingsTabBtn = page.locator('umb-body-layout').getByRole('tab', { name: 'Settings' });
@@ -283,6 +287,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
283
287
  await (0, test_1.expect)(this.contentNameTxt).toBeVisible();
284
288
  await this.contentNameTxt.clear();
285
289
  await this.contentNameTxt.fill(name);
290
+ await (0, test_1.expect)(this.contentNameTxt).toHaveValue(name);
286
291
  }
287
292
  async clickSaveAndPublishButton() {
288
293
  await (0, test_1.expect)(this.saveAndPublishBtn).toBeVisible();
@@ -321,6 +326,10 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
321
326
  async waitForModalHidden() {
322
327
  await this.openedModal.waitFor({ state: 'hidden' });
323
328
  }
329
+ async clickSaveButtonForContent() {
330
+ await (0, test_1.expect)(this.saveContentBtn).toBeVisible();
331
+ await this.saveContentBtn.click();
332
+ }
324
333
  async enterTextstring(text) {
325
334
  await (0, test_1.expect)(this.textstringTxt).toBeVisible();
326
335
  await this.textstringTxt.clear();
@@ -461,7 +470,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
461
470
  await (0, test_1.expect)(this.documentTreeItem.locator('[label="' + parentName + '"]').getByLabel(childName)).toBeVisible({ visible: isVisible });
462
471
  }
463
472
  async removeContentPicker(contentPickerName) {
464
- const contentPickerLocator = this.page.locator('[name="' + contentPickerName + '"]');
473
+ const contentPickerLocator = this.page.locator('umb-entity-item-ref').filter({ has: this.page.locator('[name="' + contentPickerName + '"]') });
465
474
  await contentPickerLocator.hover();
466
475
  await contentPickerLocator.getByLabel('Remove').click();
467
476
  await this.clickConfirmRemoveButton();
@@ -519,7 +528,9 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
519
528
  await this.sidebarModal.getByText(memberName, { exact: true }).click();
520
529
  }
521
530
  async removeMemberPickerByName(memberName) {
522
- await this.page.locator('[name="' + memberName + '"]').getByLabel('Remove').click();
531
+ const mediaPickerLocator = this.page.locator('umb-entity-item-ref').filter({ has: this.page.locator('[name="' + memberName + '"]') });
532
+ await mediaPickerLocator.hover();
533
+ await mediaPickerLocator.getByLabel('Remove').click();
523
534
  await this.clickConfirmRemoveButton();
524
535
  }
525
536
  // Numeric
@@ -540,6 +551,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
540
551
  await this.enterTagTxt.press('Enter');
541
552
  }
542
553
  async removeTagByName(tagName) {
554
+ await (0, test_1.expect)(this.tagItems.filter({ hasText: tagName }).locator('svg')).toBeVisible();
543
555
  await this.tagItems.filter({ hasText: tagName }).locator('svg').click();
544
556
  }
545
557
  // Multi URL Picker
@@ -585,11 +597,13 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
585
597
  }
586
598
  // Upload
587
599
  async clickRemoveFilesButton() {
600
+ await (0, test_1.expect)(this.removeFilesBtn).toBeVisible();
588
601
  await this.removeFilesBtn.click();
589
602
  }
590
603
  // True/false
591
604
  async clickToggleButton() {
592
- await this.toggleBtn.click();
605
+ await (0, test_1.expect)(this.toggleBtn).toBeVisible();
606
+ await this.toggleBtn.click({ force: true });
593
607
  }
594
608
  async doesToggleHaveLabel(label) {
595
609
  return await (0, test_1.expect)(this.toggleInput).toHaveAttribute('aria-label', label);
@@ -768,6 +782,9 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
768
782
  const propertyLocator = this.documentWorkspace.locator(this.property).filter({ hasText: propertyName }).locator('#input');
769
783
  await (0, test_1.expect)(propertyLocator).toHaveValue(value);
770
784
  }
785
+ async clickContentTab() {
786
+ await this.splitView.getByRole('tab', { name: 'Content' }).click();
787
+ }
771
788
  async isDocumentTreeEmpty() {
772
789
  await (0, test_1.expect)(this.documentTreeItem).toHaveCount(0);
773
790
  }
@@ -898,8 +915,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
898
915
  async isAddBlockElementButtonVisible(isVisible = true) {
899
916
  await (0, test_1.expect)(this.addBlockElementBtn).toBeVisible({ visible: isVisible });
900
917
  }
901
- async isAddBlockElementButtonWithLabelVisible(label, isVisible = true) {
902
- await (0, test_1.expect)(this.addBlockElementBtn.getByLabel(label)).toBeVisible({ visible: isVisible });
918
+ async isAddBlockElementButtonWithLabelVisible(blockName, label, isVisible = true) {
919
+ await (0, test_1.expect)(this.property.filter({ hasText: blockName }).locator(this.addBlockElementBtn).filter({ hasText: label })).toBeVisible({ visible: isVisible });
903
920
  }
904
921
  async doesFormValidationMessageContainText(text) {
905
922
  await (0, test_1.expect)(this.formValidationMessage).toContainText(text);