@umbraco/playwright-testhelpers 2.0.0-beta.65 → 2.0.0-beta.66

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.
@@ -76,6 +76,51 @@ export declare class DataTypeUiHelper extends UiBaseLocators {
76
76
  private readonly typeToFilterIconsTxt;
77
77
  private readonly cardMedia;
78
78
  private readonly chooseStartNodeBtn;
79
+ private readonly addBlockBtn;
80
+ private readonly minAmountTxt;
81
+ private readonly maxAmountTxt;
82
+ private readonly amountErrorMessage;
83
+ private readonly singleBlockModeBtn;
84
+ private readonly liveEditingModeBtn;
85
+ private readonly inlineEditingModeBtn;
86
+ private readonly propertyEditorWidthTxt;
87
+ private readonly labelTextTxt;
88
+ private readonly overlaySizeOption;
89
+ private readonly chooseContentModelBtn;
90
+ private readonly chooseSettingsModelBtn;
91
+ private readonly contentModelNode;
92
+ private readonly settingsModelNode;
93
+ private readonly removeExactContentModelNodeBtn;
94
+ private readonly removeExactSettingsModelNodeBtn;
95
+ private readonly openBtn;
96
+ private readonly backgroundColorTxt;
97
+ private readonly iconColorTxt;
98
+ private readonly chooseCustomStylesheetBtn;
99
+ private readonly stylesheetRemoveBtn;
100
+ private readonly hideContentEditorBlockGridBtn;
101
+ private readonly hideContentEditorBlockListBtn;
102
+ private readonly customStylesheetLabel;
103
+ private readonly documentTypeWorkspace;
104
+ private readonly editorWidthTxt;
105
+ private readonly createButtonLabelTxt;
106
+ private readonly gridColumnsTxt;
107
+ private readonly showResizeOptionsBtn;
108
+ private readonly columnSpanOptions;
109
+ private readonly areasTabBtn;
110
+ private readonly availableRowSpansLowValueTxt;
111
+ private readonly availableRowSpansHighValueTxt;
112
+ private readonly areaGridColumnsTxt;
113
+ private readonly addAreaBtn;
114
+ private readonly blockAreaConfig;
115
+ private readonly aliasAliasTxt;
116
+ private readonly blockGridAreaWorkspaceSubmitBtn;
117
+ private readonly createLabelTxt;
118
+ private readonly minAllowedTxt;
119
+ private readonly maxAllowedTxt;
120
+ private readonly addSpecifiedAllowanceBtn;
121
+ private readonly advancedTabBtn;
122
+ private readonly allowBlockAtRootBtn;
123
+ private readonly allowInAreasBtn;
79
124
  constructor(page: Page);
80
125
  clickActionsMenuForDataType(name: string): Promise<void>;
81
126
  clickActionsMenuAtRoot(): Promise<void>;
@@ -166,4 +211,51 @@ export declare class DataTypeUiHelper extends UiBaseLocators {
166
211
  clickShowToggleLabelsSlider(): Promise<void>;
167
212
  enterLabelOnValue(value: string): Promise<void>;
168
213
  enterLabelOffValue(value: string): Promise<void>;
214
+ clickAddBlockButton(index?: number): Promise<void>;
215
+ clickRemoveBlockWithName(name: string): Promise<void>;
216
+ enterMinAmount(value: string): Promise<void>;
217
+ enterMaxAmount(value: string): Promise<void>;
218
+ doesAmountContainErrorMessageWitText(errorMessage: string): Promise<void>;
219
+ clickSingleBlockMode(): Promise<void>;
220
+ clickLiveEditingMode(): Promise<void>;
221
+ clickInlineEditingMode(): Promise<void>;
222
+ enterPropertyEditorWidth(width: string): Promise<void>;
223
+ goToBlockWithName(name: string): Promise<void>;
224
+ enterBlockLabelText(label: string): Promise<void>;
225
+ removeBlockLabelText(): Promise<void>;
226
+ clickAllowInRootForBlock(): Promise<void>;
227
+ clickAllowInAreasForBlock(): Promise<void>;
228
+ updateBlockOverlaySize(size: string): Promise<void>;
229
+ addBlockContentModel(elementName: string): Promise<void>;
230
+ addBlockSettingsModel(elementName: string): Promise<void>;
231
+ removeBlockContentModel(): Promise<void>;
232
+ removeBlockSettingsModel(): Promise<void>;
233
+ openBlockContentModel(): Promise<void>;
234
+ openBlockSettingsModel(): Promise<void>;
235
+ isElementWorkspaceOpenInBlock(elementTypeName: string): Promise<void>;
236
+ enterBlockBackgroundColor(color: string): Promise<void>;
237
+ enterBlockIconColor(color: string): Promise<void>;
238
+ chooseBlockCustomStylesheetWithName(name: string): Promise<void>;
239
+ clickRemoveCustomStylesheetWithName(name: string): Promise<void>;
240
+ clickBlockGridHideContentEditorButton(): Promise<void>;
241
+ clickBlockListHideContentEditorButton(): Promise<void>;
242
+ enterEditorWidth(value: string): Promise<void>;
243
+ enterCreateButtonLabel(value: string): Promise<void>;
244
+ enterGridColumns(value: number): Promise<void>;
245
+ clickShowResizeOptions(): Promise<void>;
246
+ clickAvailableColumnSpans(columnSpans: number[]): Promise<void>;
247
+ goToBlockAreasTab(): Promise<void>;
248
+ enterMinRowSpan(value: number): Promise<void>;
249
+ enterMaxRowSpan(value: number): Promise<void>;
250
+ enterGridColumnsForArea(value: number): Promise<void>;
251
+ addAreaButton(): Promise<void>;
252
+ goToAreaByAlias(alias: string): Promise<void>;
253
+ clickRemoveAreaByAlias(alias: string): Promise<void>;
254
+ enterAreaAlias(alias: string): Promise<void>;
255
+ clickAreaSubmitButton(): Promise<void>;
256
+ enterCreateButtonLabelInArea(value: string): Promise<void>;
257
+ enterMinAllowedInArea(value: number): Promise<void>;
258
+ enterMaxAllowedInArea(value: number): Promise<void>;
259
+ clickAddSpecifiedAllowanceButton(): Promise<void>;
260
+ goToBlockAdvancedTab(): Promise<void>;
169
261
  }
@@ -79,6 +79,51 @@ class DataTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
79
79
  typeToFilterIconsTxt;
80
80
  cardMedia;
81
81
  chooseStartNodeBtn;
82
+ addBlockBtn;
83
+ minAmountTxt;
84
+ maxAmountTxt;
85
+ amountErrorMessage;
86
+ singleBlockModeBtn;
87
+ liveEditingModeBtn;
88
+ inlineEditingModeBtn;
89
+ propertyEditorWidthTxt;
90
+ labelTextTxt;
91
+ overlaySizeOption;
92
+ chooseContentModelBtn;
93
+ chooseSettingsModelBtn;
94
+ contentModelNode;
95
+ settingsModelNode;
96
+ removeExactContentModelNodeBtn;
97
+ removeExactSettingsModelNodeBtn;
98
+ openBtn;
99
+ backgroundColorTxt;
100
+ iconColorTxt;
101
+ chooseCustomStylesheetBtn;
102
+ stylesheetRemoveBtn;
103
+ hideContentEditorBlockGridBtn;
104
+ hideContentEditorBlockListBtn;
105
+ customStylesheetLabel;
106
+ documentTypeWorkspace;
107
+ editorWidthTxt;
108
+ createButtonLabelTxt;
109
+ gridColumnsTxt;
110
+ showResizeOptionsBtn;
111
+ columnSpanOptions;
112
+ areasTabBtn;
113
+ availableRowSpansLowValueTxt;
114
+ availableRowSpansHighValueTxt;
115
+ areaGridColumnsTxt;
116
+ addAreaBtn;
117
+ blockAreaConfig;
118
+ aliasAliasTxt;
119
+ blockGridAreaWorkspaceSubmitBtn;
120
+ createLabelTxt;
121
+ minAllowedTxt;
122
+ maxAllowedTxt;
123
+ addSpecifiedAllowanceBtn;
124
+ advancedTabBtn;
125
+ allowBlockAtRootBtn;
126
+ allowInAreasBtn;
82
127
  constructor(page) {
83
128
  super(page);
84
129
  this.moveToBtn = page.locator('umb-entity-action').getByLabel('Move to');
@@ -171,6 +216,52 @@ class DataTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
171
216
  this.showToggleLabelsSlider = page.locator('umb-property[label="Show toggle labels"] #slider');
172
217
  this.labelOnTxt = page.locator('umb-property[label="Label On"] #input');
173
218
  this.labelOffTxt = page.locator('umb-property[label="Label Off"] #input');
219
+ // Block List Editor and Block Grid Editor
220
+ this.addBlockBtn = page.locator('umb-input-block-type #blocks').getByLabel('open');
221
+ this.minAmountTxt = page.getByLabel('Low value');
222
+ this.maxAmountTxt = page.getByLabel('High value');
223
+ this.amountErrorMessage = page.locator('[alias="validationLimit"] uui-form-validation-message');
224
+ this.singleBlockModeBtn = this.page.locator('umb-property-layout').filter({ hasText: 'Single block mode' }).locator('#slider');
225
+ this.liveEditingModeBtn = this.page.locator('umb-property-layout').filter({ hasText: 'Live editing' }).locator('#slider');
226
+ this.inlineEditingModeBtn = this.page.locator('umb-property-layout').filter({ hasText: 'Inline editing' }).locator('#slider');
227
+ this.propertyEditorWidthTxt = this.page.locator('umb-property-layout').filter({ hasText: 'Property editor width' }).locator('#input');
228
+ this.labelTextTxt = this.page.locator('[label="Label"]').locator('#input');
229
+ this.overlaySizeOption = this.page.locator('[label="Overlay size"]').locator('#native');
230
+ this.chooseContentModelBtn = this.page.locator('[alias="contentElementTypeKey"]').getByLabel('Choose');
231
+ this.chooseSettingsModelBtn = this.page.locator('[alias="settingsElementTypeKey"]').getByLabel('Choose');
232
+ this.contentModelNode = this.page.locator('[alias="contentElementTypeKey"]').locator('uui-ref-node-document-type');
233
+ this.settingsModelNode = this.page.locator('[alias="settingsElementTypeKey"]').locator('uui-ref-node-document-type');
234
+ this.removeExactContentModelNodeBtn = this.page.locator('[alias="contentElementTypeKey"]').getByLabel('Remove', { exact: true });
235
+ this.removeExactSettingsModelNodeBtn = this.page.locator('[alias="settingsElementTypeKey"]').getByLabel('Remove', { exact: true });
236
+ this.openBtn = this.page.getByLabel('Open', { exact: true });
237
+ this.backgroundColorTxt = this.page.locator('[label="Background color"]').locator('#input');
238
+ this.iconColorTxt = this.page.locator('[label="Icon color"]').locator('#input');
239
+ this.chooseCustomStylesheetBtn = this.page.locator('[label="Custom stylesheet"]').getByLabel('Choose');
240
+ this.stylesheetRemoveBtn = this.page.locator('uui-ref-node').getByLabel('Remove', { exact: true });
241
+ this.hideContentEditorBlockListBtn = this.page.locator('[alias="forceHideContentEditorInOverlay"]').locator('#slider');
242
+ this.hideContentEditorBlockGridBtn = this.page.locator('[alias="hideContentEditor"]').locator('#slider');
243
+ this.customStylesheetLabel = this.page.locator('[label="Custom stylesheet"]');
244
+ this.documentTypeWorkspace = this.page.locator('[alias="Umb.Workspace.DocumentType"]');
245
+ this.editorWidthTxt = this.page.locator('umb-property-layout').filter({ hasText: 'Editor width' }).locator('#input');
246
+ this.createButtonLabelTxt = this.page.locator('umb-property-layout').filter({ hasText: 'Create button label' }).locator('#input');
247
+ this.gridColumnsTxt = this.page.locator('umb-property-layout').filter({ hasText: 'Grid columns' }).locator('#input');
248
+ this.showResizeOptionsBtn = this.page.getByLabel('Show resize options');
249
+ this.columnSpanOptions = this.page.locator('[alias="columnSpanOptions"]');
250
+ this.areasTabBtn = this.page.getByRole('tab', { name: 'Areas' });
251
+ this.availableRowSpansLowValueTxt = this.page.locator('[label="Available row spans"]').getByLabel('Low value');
252
+ this.availableRowSpansHighValueTxt = this.page.locator('[label="Available row spans"]').getByLabel('High value');
253
+ this.areaGridColumnsTxt = this.page.locator('[alias="areaGridColumns"]').locator('#input');
254
+ this.addAreaBtn = this.page.getByLabel('Add area');
255
+ this.blockAreaConfig = this.page.locator('umb-block-area-config-entry');
256
+ this.aliasAliasTxt = this.page.locator('[alias="alias"]').locator('#input');
257
+ this.blockGridAreaWorkspaceSubmitBtn = this.page.locator('umb-block-grid-area-type-workspace-editor').getByLabel('Submit');
258
+ this.createLabelTxt = this.page.locator('[alias="createLabel"]').locator('#input');
259
+ this.minAllowedTxt = this.page.locator('[alias="minAllowed"]').locator('#input');
260
+ this.maxAllowedTxt = this.page.locator('[alias="maxAllowed"]').locator('#input');
261
+ this.addSpecifiedAllowanceBtn = this.page.locator('[alias="specifiedAllowance"]').getByLabel('Add');
262
+ this.advancedTabBtn = this.page.getByRole('tab', { name: 'Advanced' });
263
+ this.allowBlockAtRootBtn = this.page.locator('[alias="allowAtRoot"]');
264
+ this.allowInAreasBtn = this.page.locator('[alias="allowInAreas"]');
174
265
  }
175
266
  async clickActionsMenuForDataType(name) {
176
267
  await this.clickActionsMenuForName(name);
@@ -534,6 +625,205 @@ class DataTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
534
625
  await this.labelOffTxt.clear();
535
626
  await this.labelOffTxt.fill(value);
536
627
  }
628
+ // Block List Editor
629
+ async clickAddBlockButton(index = 0) {
630
+ await this.addBlockBtn.nth(index).click({ force: true });
631
+ }
632
+ async clickRemoveBlockWithName(name) {
633
+ await this.page.locator('umb-block-type-card', { hasText: name }).getByLabel('Remove block').click({ force: true });
634
+ }
635
+ async enterMinAmount(value) {
636
+ await this.minAmountTxt.clear();
637
+ await this.minAmountTxt.fill(value);
638
+ }
639
+ async enterMaxAmount(value) {
640
+ await this.maxAmountTxt.clear();
641
+ await this.maxAmountTxt.fill(value);
642
+ }
643
+ async doesAmountContainErrorMessageWitText(errorMessage) {
644
+ return await (0, test_1.expect)(this.amountErrorMessage).toContainText(errorMessage);
645
+ }
646
+ async clickSingleBlockMode() {
647
+ // We need to wait, otherwise this would be flaky
648
+ await this.singleBlockModeBtn.waitFor();
649
+ await this.singleBlockModeBtn.click({ force: true });
650
+ }
651
+ async clickLiveEditingMode() {
652
+ await this.liveEditingModeBtn.click({ force: true });
653
+ }
654
+ async clickInlineEditingMode() {
655
+ await this.inlineEditingModeBtn.click({ force: true });
656
+ }
657
+ async enterPropertyEditorWidth(width) {
658
+ await this.propertyEditorWidthTxt.clear();
659
+ await this.propertyEditorWidthTxt.fill(width);
660
+ }
661
+ async goToBlockWithName(name) {
662
+ await this.page.getByRole('link', { name: name }).click();
663
+ }
664
+ async enterBlockLabelText(label) {
665
+ await this.labelTextTxt.clear();
666
+ await this.labelTextTxt.fill(label);
667
+ }
668
+ async removeBlockLabelText() {
669
+ await this.labelTextTxt.clear();
670
+ }
671
+ async clickAllowInRootForBlock() {
672
+ await this.allowBlockAtRootBtn.click();
673
+ }
674
+ async clickAllowInAreasForBlock() {
675
+ await this.allowInAreasBtn.click();
676
+ }
677
+ async updateBlockOverlaySize(size) {
678
+ await this.overlaySizeOption.selectOption(size);
679
+ }
680
+ async addBlockContentModel(elementName) {
681
+ await this.chooseContentModelBtn.click();
682
+ await this.clickButtonWithName(elementName);
683
+ await this.clickChooseButton();
684
+ }
685
+ async addBlockSettingsModel(elementName) {
686
+ await this.chooseSettingsModelBtn.click();
687
+ await this.clickButtonWithName(elementName);
688
+ await this.clickChooseModalButton();
689
+ }
690
+ async removeBlockContentModel() {
691
+ await this.contentModelNode.hover();
692
+ await this.removeExactContentModelNodeBtn.click();
693
+ }
694
+ async removeBlockSettingsModel() {
695
+ await this.settingsModelNode.hover();
696
+ await this.removeExactSettingsModelNodeBtn.click();
697
+ }
698
+ async openBlockContentModel() {
699
+ await this.contentModelNode.hover();
700
+ await this.openBtn.click();
701
+ }
702
+ async openBlockSettingsModel() {
703
+ await this.settingsModelNode.hover();
704
+ await this.openBtn.click();
705
+ }
706
+ async isElementWorkspaceOpenInBlock(elementTypeName) {
707
+ return await (0, test_1.expect)(this.documentTypeWorkspace.filter({ hasText: elementTypeName })).toBeVisible();
708
+ }
709
+ async enterBlockBackgroundColor(color) {
710
+ await this.backgroundColorTxt.clear();
711
+ await this.backgroundColorTxt.fill(color);
712
+ }
713
+ async enterBlockIconColor(color) {
714
+ await this.iconColorTxt.clear();
715
+ await this.iconColorTxt.fill(color);
716
+ }
717
+ async chooseBlockCustomStylesheetWithName(name) {
718
+ await this.chooseCustomStylesheetBtn.click();
719
+ await this.clickCaretButtonForName('wwwroot');
720
+ await this.clickCaretButtonForName('css');
721
+ await this.page.getByLabel(name, { exact: true }).click();
722
+ await this.clickChooseModalButton();
723
+ }
724
+ async clickRemoveCustomStylesheetWithName(name) {
725
+ await this.customStylesheetLabel.locator('[name="' + name + '"]').click();
726
+ await this.stylesheetRemoveBtn.click();
727
+ await this.clickConfirmRemoveButton();
728
+ }
729
+ async clickBlockGridHideContentEditorButton() {
730
+ await this.hideContentEditorBlockGridBtn.click();
731
+ }
732
+ async clickBlockListHideContentEditorButton() {
733
+ await this.hideContentEditorBlockListBtn.click();
734
+ }
735
+ async enterEditorWidth(value) {
736
+ await this.editorWidthTxt.clear();
737
+ await this.editorWidthTxt.fill(value);
738
+ }
739
+ async enterCreateButtonLabel(value) {
740
+ await this.createButtonLabelTxt.clear();
741
+ await this.createButtonLabelTxt.fill(value);
742
+ }
743
+ async enterGridColumns(value) {
744
+ await this.gridColumnsTxt.clear();
745
+ if (value === undefined) {
746
+ return;
747
+ }
748
+ await this.gridColumnsTxt.fill(value.toString());
749
+ }
750
+ async clickShowResizeOptions() {
751
+ await this.showResizeOptionsBtn.click();
752
+ }
753
+ async clickAvailableColumnSpans(columnSpans) {
754
+ for (let index in columnSpans) {
755
+ await this.columnSpanOptions.getByLabel(columnSpans[index].toString(), { exact: true }).click();
756
+ }
757
+ }
758
+ async goToBlockAreasTab() {
759
+ await this.areasTabBtn.click();
760
+ }
761
+ async enterMinRowSpan(value) {
762
+ await this.availableRowSpansLowValueTxt.clear();
763
+ if (value === undefined) {
764
+ return;
765
+ }
766
+ await this.availableRowSpansLowValueTxt.fill(value.toString());
767
+ }
768
+ async enterMaxRowSpan(value) {
769
+ await this.availableRowSpansHighValueTxt.clear();
770
+ if (value === undefined) {
771
+ return;
772
+ }
773
+ await this.availableRowSpansHighValueTxt.fill(value.toString());
774
+ }
775
+ async enterGridColumnsForArea(value) {
776
+ await this.areaGridColumnsTxt.clear();
777
+ if (value === undefined) {
778
+ return;
779
+ }
780
+ await this.areaGridColumnsTxt.fill(value.toString());
781
+ }
782
+ async addAreaButton() {
783
+ await this.addAreaBtn.click();
784
+ }
785
+ async goToAreaByAlias(alias) {
786
+ await this.blockAreaConfig.filter({ hasText: alias }).getByLabel('edit').click({ force: true });
787
+ }
788
+ async clickRemoveAreaByAlias(alias) {
789
+ await this.blockAreaConfig.filter({ hasText: alias }).getByLabel('delete').click({ force: true });
790
+ await this.clickConfirmToDeleteButton();
791
+ }
792
+ async enterAreaAlias(alias) {
793
+ await this.aliasAliasTxt.clear();
794
+ await this.aliasAliasTxt.fill(alias);
795
+ }
796
+ async clickAreaSubmitButton() {
797
+ await this.blockGridAreaWorkspaceSubmitBtn.click();
798
+ await this.page.waitForTimeout(500);
799
+ }
800
+ async enterCreateButtonLabelInArea(value) {
801
+ await this.createLabelTxt.nth(1).clear();
802
+ if (value === undefined) {
803
+ return;
804
+ }
805
+ await this.createLabelTxt.nth(1).fill(value);
806
+ }
807
+ async enterMinAllowedInArea(value) {
808
+ await this.minAllowedTxt.clear();
809
+ if (value === undefined) {
810
+ return;
811
+ }
812
+ await this.minAllowedTxt.fill(value.toString());
813
+ }
814
+ async enterMaxAllowedInArea(value) {
815
+ await this.maxAllowedTxt.clear();
816
+ if (value === undefined) {
817
+ return;
818
+ }
819
+ await this.maxAllowedTxt.fill(value.toString());
820
+ }
821
+ async clickAddSpecifiedAllowanceButton() {
822
+ await this.addSpecifiedAllowanceBtn.click();
823
+ }
824
+ async goToBlockAdvancedTab() {
825
+ await this.advancedTabBtn.click();
826
+ }
537
827
  }
538
828
  exports.DataTypeUiHelper = DataTypeUiHelper;
539
829
  //# sourceMappingURL=DataTypeUiHelper.js.map