@umbraco/playwright-testhelpers 15.0.14 → 15.0.15

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.
@@ -16,4 +16,8 @@ export declare class ConstantHelper {
16
16
  static readonly validationMessages: {
17
17
  emptyLinkPicker: string;
18
18
  };
19
+ static readonly inputTypes: {
20
+ general: string;
21
+ tipTap: string;
22
+ };
19
23
  }
@@ -19,6 +19,10 @@ class ConstantHelper {
19
19
  static validationMessages = {
20
20
  emptyLinkPicker: 'Please enter an anchor or querystring, or select a published document or media item, or manually configure the URL',
21
21
  };
22
+ static inputTypes = {
23
+ general: 'input',
24
+ tipTap: 'umb-input-tiptap'
25
+ };
22
26
  }
23
27
  exports.ConstantHelper = ConstantHelper;
24
28
  //# sourceMappingURL=ConstantHelper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConstantHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ConstantHelper.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAElB,MAAM,CAAU,QAAQ,GAAG;QAChC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,aAAa;QACzB,KAAK,EAAE,OAAO;KACf,CAAA;IAEM,MAAM,CAAU,mBAAmB,GAAG;QAC3C,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,uBAAuB;KAClC,CAAA;IAEM,MAAM,CAAU,kBAAkB,GAAG;QAC1C,eAAe,EAAE,oHAAoH;KACtI,CAAA;;AApBH,wCAqBC","sourcesContent":["export class ConstantHelper {\n\n public static readonly sections = {\n content: \"Content\",\n media: \"Media\",\n settings: \"Settings\",\n packages: \"Packages\",\n members: \"Members\",\n dictionary: \"Translation\",\n users: \"Users\"\n }\n\n public static readonly testUserCredentials = {\n name: 'Test User',\n email: 'verySecureEmail@123.test',\n password: 'verySecurePassword123'\n }\n\n public static readonly validationMessages = {\n emptyLinkPicker: 'Please enter an anchor or querystring, or select a published document or media item, or manually configure the URL',\n }\n}"]}
1
+ {"version":3,"file":"ConstantHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ConstantHelper.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAElB,MAAM,CAAU,QAAQ,GAAG;QAChC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,aAAa;QACzB,KAAK,EAAE,OAAO;KACf,CAAA;IAEM,MAAM,CAAU,mBAAmB,GAAG;QAC3C,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,uBAAuB;KAClC,CAAA;IAEM,MAAM,CAAU,kBAAkB,GAAG;QAC1C,eAAe,EAAE,oHAAoH;KACtI,CAAA;IAEM,MAAM,CAAU,UAAU,GAAG;QAClC,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,kBAAkB;KAC3B,CAAA;;AAzBH,wCA0BC","sourcesContent":["export class ConstantHelper {\n\n public static readonly sections = {\n content: \"Content\",\n media: \"Media\",\n settings: \"Settings\",\n packages: \"Packages\",\n members: \"Members\",\n dictionary: \"Translation\",\n users: \"Users\"\n }\n\n public static readonly testUserCredentials = {\n name: 'Test User',\n email: 'verySecureEmail@123.test',\n password: 'verySecurePassword123'\n }\n\n public static readonly validationMessages = {\n emptyLinkPicker: 'Please enter an anchor or querystring, or select a published document or media item, or manually configure the URL',\n }\n\n public static readonly inputTypes = {\n general: 'input',\n tipTap: 'umb-input-tiptap'\n }\n}"]}
@@ -113,6 +113,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
113
113
  private readonly blockName;
114
114
  private readonly addBlockSettingsTabBtn;
115
115
  private readonly editBlockEntryBtn;
116
+ private readonly copyBlockEntryBtn;
116
117
  private readonly deleteBlockEntryBtn;
117
118
  private readonly blockGridEntry;
118
119
  private readonly blockListEntry;
@@ -120,6 +121,16 @@ export declare class ContentUiHelper extends UiBaseLocators {
120
121
  private readonly tipTapEditor;
121
122
  private readonly uploadedSvgThumbnail;
122
123
  private readonly linkPickerModal;
124
+ private readonly pasteFromClipboardBtn;
125
+ private readonly pasteBtn;
126
+ private readonly closeBtn;
127
+ private readonly workspaceEditTab;
128
+ private readonly workspaceEditProperties;
129
+ private readonly exactCopyBtn;
130
+ private readonly openActionsMenu;
131
+ private readonly replaceExactBtn;
132
+ private readonly clipboardEntryPicker;
133
+ private readonly blockWorkspaceEditTab;
123
134
  constructor(page: Page);
124
135
  enterContentName(name: string): Promise<void>;
125
136
  clickSaveAndPublishButton(): Promise<void>;
@@ -277,6 +288,24 @@ export declare class ContentUiHelper extends UiBaseLocators {
277
288
  clickDeleteBlockGridBlockButton(): Promise<void>;
278
289
  clickEditBlockListBlockButton(): Promise<void>;
279
290
  clickDeleteBlockListBlockButton(): Promise<void>;
291
+ clickCopyBlockListBlockButton(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>;
292
+ clickCopyBlockGridBlockButton(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>;
293
+ clickPasteFromClipboardButtonForProperty(groupName: string, propertyName: string): Promise<void>;
294
+ clickActionsMenuForProperty(groupName: string, propertyName: string): Promise<void>;
295
+ clickExactCopyButton(): Promise<void>;
296
+ clickExactReplaceButton(): Promise<void>;
297
+ doesClipboardHaveCopiedBlockWithName(contentName: string, propertyName: string, blockName: string, index?: number): Promise<void>;
298
+ doesClipboardHaveCopiedBlocks(contentName: string, propertyName: string, index?: number): Promise<void>;
299
+ doesClipboardContainCopiedBlocksCount(count: number): Promise<void>;
300
+ selectClipboardEntryWithName(contentName: string, propertyName: string, blockName: string, index?: number): Promise<void>;
301
+ selectClipboardEntriesWithName(contentName: string, propertyName: string, index?: number): Promise<void>;
302
+ goToBlockGridBlockWithName(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>;
303
+ goToBlockListBlockWithName(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>;
304
+ doesBlockEditorBlockWithNameContainValue(groupName: string, propertyName: string, inputType: string | undefined, value: any): Promise<void>;
305
+ clickCloseButton(): Promise<void>;
306
+ clickPasteButton(): Promise<void>;
307
+ doesBlockListPropertyHaveBlockAmount(groupName: string, propertyName: string, amount: number): Promise<void>;
308
+ doesBlockGridPropertyHaveBlockAmount(groupName: string, propertyName: string, amount: number): Promise<void>;
280
309
  enterRTETipTapEditor(value: string): Promise<void>;
281
310
  clickTipTapToolbarIconWithTitle(iconTitle: string): Promise<void>;
282
311
  doesUploadedSvgThumbnailHaveSrc(imageSrc: string): Promise<void>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ContentUiHelper = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const UiBaseLocators_1 = require("./UiBaseLocators");
6
+ const ConstantHelper_1 = require("./ConstantHelper");
6
7
  class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
7
8
  contentNameTxt;
8
9
  saveAndPublishBtn;
@@ -116,6 +117,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
116
117
  blockName;
117
118
  addBlockSettingsTabBtn;
118
119
  editBlockEntryBtn;
120
+ copyBlockEntryBtn;
119
121
  deleteBlockEntryBtn;
120
122
  blockGridEntry;
121
123
  blockListEntry;
@@ -123,8 +125,19 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
123
125
  tipTapEditor;
124
126
  uploadedSvgThumbnail;
125
127
  linkPickerModal;
128
+ pasteFromClipboardBtn;
129
+ pasteBtn;
130
+ closeBtn;
131
+ workspaceEditTab;
132
+ workspaceEditProperties;
133
+ exactCopyBtn;
134
+ openActionsMenu;
135
+ replaceExactBtn;
136
+ clipboardEntryPicker;
137
+ blockWorkspaceEditTab;
126
138
  constructor(page) {
127
139
  super(page);
140
+ this.closeBtn = page.getByRole('button', { name: 'Close', exact: true });
128
141
  this.linkPickerModal = page.locator('umb-link-picker-modal');
129
142
  this.contentNameTxt = page.locator('#name-input input');
130
143
  this.saveAndPublishBtn = page.getByLabel('Save And Publish');
@@ -242,9 +255,19 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
242
255
  this.blockName = page.locator('#editor [slot="name"]');
243
256
  this.addBlockSettingsTabBtn = page.locator('umb-body-layout').getByRole('tab', { name: 'Settings' });
244
257
  this.editBlockEntryBtn = page.locator('[label="edit"] svg');
258
+ this.copyBlockEntryBtn = page.getByLabel('Copy to clipboard');
259
+ this.exactCopyBtn = page.getByRole('button', { name: 'Copy', exact: true });
245
260
  this.deleteBlockEntryBtn = page.locator('[label="delete"] svg');
246
261
  this.blockGridEntry = page.locator('umb-block-grid-entry');
247
262
  this.blockListEntry = page.locator('umb-block-list-entry');
263
+ this.pasteFromClipboardBtn = page.getByLabel('Paste from clipboard');
264
+ this.pasteBtn = page.getByRole('button', { name: 'Paste', exact: true });
265
+ this.workspaceEditTab = page.locator('umb-content-workspace-view-edit-tab');
266
+ this.blockWorkspaceEditTab = page.locator('umb-block-workspace-view-edit-tab');
267
+ this.workspaceEditProperties = page.locator('umb-content-workspace-view-edit-properties');
268
+ this.openActionsMenu = page.getByLabel('Open actions menu');
269
+ this.replaceExactBtn = page.getByRole('button', { name: 'Replace', exact: true });
270
+ this.clipboardEntryPicker = page.locator('umb-clipboard-entry-picker');
248
271
  // TipTap
249
272
  this.tipTapPropertyEditor = page.locator('umb-property-editor-ui-tiptap');
250
273
  this.tipTapEditor = this.tipTapPropertyEditor.locator('#editor .tiptap');
@@ -731,12 +754,12 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
731
754
  await this.confirmEmptyRecycleBinBtn.click();
732
755
  }
733
756
  async isDocumentPropertyEditable(propertyName, isEditable = true) {
734
- const propertyLocator = this.documentWorkspace.locator('umb-property').filter({ hasText: propertyName }).locator('#input');
757
+ const propertyLocator = this.documentWorkspace.locator(this.property).filter({ hasText: propertyName }).locator('#input');
735
758
  await (0, test_1.expect)(propertyLocator).toBeVisible();
736
759
  await (0, test_1.expect)(propertyLocator).toBeEditable({ editable: isEditable });
737
760
  }
738
761
  async doesDocumentPropertyHaveValue(propertyName, value) {
739
- const propertyLocator = this.documentWorkspace.locator('umb-property').filter({ hasText: propertyName }).locator('#input');
762
+ const propertyLocator = this.documentWorkspace.locator(this.property).filter({ hasText: propertyName }).locator('#input');
740
763
  await (0, test_1.expect)(propertyLocator).toHaveValue(value);
741
764
  }
742
765
  async isDocumentTreeEmpty() {
@@ -906,6 +929,82 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
906
929
  await (0, test_1.expect)(this.deleteBlockEntryBtn).toBeVisible();
907
930
  await this.deleteBlockEntryBtn.click();
908
931
  }
932
+ async clickCopyBlockListBlockButton(groupName, propertyName, blockName, index = 0) {
933
+ const blockListBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockListEntry).nth(index).filter({ hasText: blockName });
934
+ await blockListBlock.hover();
935
+ await (0, test_1.expect)(blockListBlock.locator(this.copyBlockEntryBtn)).toBeVisible();
936
+ await blockListBlock.locator(this.copyBlockEntryBtn).click({ force: true });
937
+ }
938
+ async clickCopyBlockGridBlockButton(groupName, propertyName, blockName, index = 0) {
939
+ const blockGridBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockGridEntry).nth(index).filter({ hasText: blockName });
940
+ await blockGridBlock.hover();
941
+ await (0, test_1.expect)(blockGridBlock.locator(this.copyBlockEntryBtn)).toBeVisible();
942
+ await blockGridBlock.locator(this.copyBlockEntryBtn).click({ force: true });
943
+ }
944
+ async clickPasteFromClipboardButtonForProperty(groupName, propertyName) {
945
+ const property = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.property).filter({ hasText: propertyName });
946
+ await (0, test_1.expect)(property).toBeVisible();
947
+ await (0, test_1.expect)(property.locator(this.pasteFromClipboardBtn)).toBeVisible();
948
+ await property.locator(this.pasteFromClipboardBtn).click({ force: true });
949
+ }
950
+ async clickActionsMenuForProperty(groupName, propertyName) {
951
+ const property = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName });
952
+ await property.hover();
953
+ await (0, test_1.expect)(property.locator(this.openActionsMenu)).toBeVisible();
954
+ await property.locator(this.openActionsMenu).click({ force: true });
955
+ }
956
+ async clickExactCopyButton() {
957
+ await (0, test_1.expect)(this.exactCopyBtn).toBeVisible();
958
+ await this.exactCopyBtn.click();
959
+ }
960
+ async clickExactReplaceButton() {
961
+ await (0, test_1.expect)(this.replaceExactBtn).toBeVisible();
962
+ await this.replaceExactBtn.click();
963
+ }
964
+ async doesClipboardHaveCopiedBlockWithName(contentName, propertyName, blockName, index = 0) {
965
+ await (0, test_1.expect)(this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName} - ${blockName}`).nth(index)).toBeVisible();
966
+ }
967
+ async doesClipboardHaveCopiedBlocks(contentName, propertyName, index = 0) {
968
+ await (0, test_1.expect)(this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName}`).nth(index)).toBeVisible();
969
+ }
970
+ async doesClipboardContainCopiedBlocksCount(count) {
971
+ await (0, test_1.expect)(this.clipboardEntryPicker.locator(this.menuItem)).toHaveCount(count);
972
+ }
973
+ async selectClipboardEntryWithName(contentName, propertyName, blockName, index = 0) {
974
+ await this.doesClipboardHaveCopiedBlockWithName(contentName, propertyName, blockName, index);
975
+ await this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName} - ${blockName}`).nth(index).click();
976
+ }
977
+ async selectClipboardEntriesWithName(contentName, propertyName, index = 0) {
978
+ await this.doesClipboardHaveCopiedBlocks(contentName, propertyName, index);
979
+ await this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName}`).nth(index).click();
980
+ }
981
+ async goToBlockGridBlockWithName(groupName, propertyName, blockName, index = 0) {
982
+ const blockGridBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockGridEntry).nth(index).filter({ hasText: blockName });
983
+ await (0, test_1.expect)(blockGridBlock).toBeVisible();
984
+ await blockGridBlock.click();
985
+ }
986
+ async goToBlockListBlockWithName(groupName, propertyName, blockName, index = 0) {
987
+ const blocklistBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockListEntry).nth(index).filter({ hasText: blockName });
988
+ await (0, test_1.expect)(blocklistBlock).toBeVisible();
989
+ await blocklistBlock.click();
990
+ }
991
+ async doesBlockEditorBlockWithNameContainValue(groupName, propertyName, inputType = ConstantHelper_1.ConstantHelper.inputTypes.general, value) {
992
+ await (0, test_1.expect)(this.blockWorkspaceEditTab.filter({ hasText: groupName }).locator(this.property).filter({ hasText: propertyName }).locator(inputType)).toContainText(value);
993
+ }
994
+ async clickCloseButton() {
995
+ await (0, test_1.expect)(this.closeBtn).toBeVisible();
996
+ await this.closeBtn.click();
997
+ }
998
+ async clickPasteButton() {
999
+ await (0, test_1.expect)(this.pasteBtn).toBeVisible();
1000
+ await this.pasteBtn.click({ force: true });
1001
+ }
1002
+ async doesBlockListPropertyHaveBlockAmount(groupName, propertyName, amount) {
1003
+ await (0, test_1.expect)(this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockListEntry)).toHaveCount(amount);
1004
+ }
1005
+ async doesBlockGridPropertyHaveBlockAmount(groupName, propertyName, amount) {
1006
+ await (0, test_1.expect)(this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockGridEntry)).toHaveCount(amount);
1007
+ }
909
1008
  // TipTap
910
1009
  async enterRTETipTapEditor(value) {
911
1010
  await (0, test_1.expect)(this.tipTapEditor).toBeVisible();