-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDataTypeUiHelper.ts
1179 lines (1008 loc) · 46.2 KB
/
DataTypeUiHelper.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import {Page, Locator, expect} from "@playwright/test";
import {UiBaseLocators} from "./UiBaseLocators";
export class DataTypeUiHelper extends UiBaseLocators {
private readonly moveToBtn: Locator;
private readonly duplicateToBtn: Locator;
private readonly newDataTypeBtn: Locator;
private readonly dataTypeNameTxt: Locator;
private readonly createDataTypeFolderBtn: Locator;
private readonly updateDataTypeFolderBtn: Locator;
private readonly includeLabelsToggle: Locator;
private readonly addColorBtn: Locator;
private readonly colorValueTxt: Locator;
private readonly offsetTimeToggle: Locator;
private readonly dateFormatTxt: Locator;
private readonly pageSizeTxt: Locator;
private readonly ascendingRadioBtn: Locator;
private readonly descendingRadioBtn: Locator;
private readonly chooseColumnsDisplayedBtn: Locator;
private readonly workspaceViewName: Locator;
private readonly orderByDropDownBox: Locator;
private readonly showWorkspaceViewFirstToggle: Locator;
private readonly editInInfiniteEditorToggle: Locator;
private readonly aliasTxt: Locator;
private readonly widthTxt: Locator;
private readonly heightTxt: Locator;
private readonly addCropBtn: Locator;
private readonly saveCropBtn: Locator;
private readonly minimumTxt: Locator;
private readonly maximumTxt: Locator;
private readonly stepSizeTxt: Locator;
private readonly optionTxt: Locator;
private readonly addOptionBtn: Locator;
private readonly maximumAllowedCharsTxt: Locator;
private readonly numberOfRowsTxt: Locator;
private readonly minHeightTxt: Locator;
private readonly maxHeightTxt: Locator;
private readonly acceptedFileExtensionsTxt: Locator;
private readonly addAcceptedFileExtensionsBtn: Locator;
private readonly minimumNumberOfItemsTxt: Locator;
private readonly maximumNumberOfItemsTxt: Locator;
private readonly ignoreUserStartNodesToggle: Locator;
private readonly overlaySizeDropDownBox: Locator;
private readonly hideAnchorQueryStringInputToggle: Locator;
private readonly pickMultipleItemsToggle: Locator;
private readonly enableFocalPointToggle: Locator;
private readonly amountLowValueTxt: Locator;
private readonly amountHighValueTxt: Locator;
private readonly toolbarCheckboxes: Locator;
private readonly addStylesheetBtn: Locator;
private readonly dimensionsWidthTxt: Locator;
private readonly dimensionsHeightTxt: Locator;
private readonly maxImageSizeTxt: Locator;
private readonly hideLabelToggle: Locator;
private readonly defineTagGroupTxt: Locator;
private readonly showOpenButtonToggle: Locator;
private readonly enableMultipleChoiceToggle: Locator;
private readonly addOptionsBtn: Locator;
private readonly presetValueToggle: Locator;
private readonly showToggleLabelsToggle: Locator;
private readonly labelOnTxt: Locator;
private readonly labelOffTxt: Locator;
private readonly labelTxt: Locator;
private readonly chooseAcceptedTypesBtn: Locator;
private readonly chooseWithPlusBtn: Locator;
private readonly storageTypeDropDownBox: Locator;
private readonly allowDecimalsToggle: Locator;
private readonly chooseLayoutsBtn: Locator;
private readonly columnsDisplayedItems: Locator;
private readonly layoutsItems: Locator;
private readonly inlineRadioBtn: Locator;
private readonly duplicateBtn: Locator;
private readonly addWithPlusBtn: Locator;
private readonly selectAPropertyEditorBtn: Locator;
private readonly typeToFilterTxt: Locator;
private readonly chooseStartNodeBtn: Locator;
private readonly addBlockBtn: Locator;
private readonly minAmountTxt: Locator;
private readonly maxAmountTxt: Locator;
private readonly singleBlockModeBtn: Locator;
private readonly liveEditingModeBtn: Locator;
private readonly inlineEditingModeBtn: Locator;
private readonly propertyEditorWidthTxt: Locator;
private readonly labelTextTxt: Locator;
private readonly overlaySizeOption: Locator;
private readonly chooseContentModelBtn: Locator;
private readonly chooseSettingsModelBtn: Locator;
private readonly contentModelNode: Locator;
private readonly settingsModelNode: Locator;
private readonly removeExactContentModelNodeBtn: Locator;
private readonly removeExactSettingsModelNodeBtn: Locator;
private readonly openBtn: Locator;
private readonly backgroundColorBtn: Locator;
private readonly backgroundColorTxt: Locator;
private readonly chooseCustomStylesheetBtn: Locator;
private readonly iconColorBtn: Locator;
private readonly iconColorTxt: Locator;
private readonly stylesheetRemoveBtn: Locator;
private readonly hideContentEditorBlockGridBtn: Locator;
private readonly hideContentEditorBlockListBtn: Locator;
private readonly customStylesheetLabel: Locator;
private readonly documentTypeWorkspace: Locator;
private readonly editorWidthTxt: Locator;
private readonly createButtonLabelTxt: Locator;
private readonly gridColumnsTxt: Locator;
private readonly showResizeOptionsBtn: Locator;
private readonly columnSpanOptions: Locator;
private readonly areasTabBtn: Locator;
private readonly availableRowSpansLowValueTxt: Locator;
private readonly availableRowSpansHighValueTxt: Locator;
private readonly areaGridColumnsTxt: Locator;
private readonly addAreaBtn: Locator;
private readonly blockAreaConfig: Locator;
private readonly aliasAliasTxt: Locator;
private readonly blockGridAreaWorkspaceSubmitBtn: Locator;
private readonly createLabelTxt: Locator;
private readonly minAllowedTxt: Locator;
private readonly maxAllowedTxt: Locator;
private readonly addSpecifiedAllowanceBtn: Locator;
private readonly advancedTabBtn: Locator;
private readonly allowBlockAtRootBtn: Locator;
private readonly allowInAreasBtn: Locator;
private readonly chooseThumbnailAlias: Locator;
private readonly expandChildItemsForMediaBtn: Locator;
private readonly tiptapToolbarConfiguration: Locator;
private readonly addGroupToolbarBtn: Locator;
private readonly addRowToolbarBtn: Locator;
private readonly tiptapExtensionsConfiguration: Locator;
private readonly propertyEditor: Locator;
private readonly selectIconBtn: Locator;
private readonly newFolderBtn: Locator;
private readonly dataTypeBtn: Locator;
private readonly dataTypesMenu: Locator;
constructor(page: Page) {
super(page);
this.moveToBtn = this.actionsMenuContainer.getByLabel('Move to');
this.duplicateToBtn = this.actionsMenuContainer.getByLabel(/^Duplicate to(…)?$/);
this.newDataTypeBtn = page.getByRole('link', {name: 'Data Type', exact: true});
this.dataTypeNameTxt = page.locator('umb-data-type-workspace-editor #nameInput #input');
this.createDataTypeFolderBtn = page.getByLabel('Create folder');
this.newFolderBtn = page.locator('[name="Folder"]');
this.updateDataTypeFolderBtn = page.getByLabel('Update folder');
this.ignoreUserStartNodesToggle = page.locator('[data-mark="property:ignoreUserStartNodes"] #toggle');
this.duplicateBtn = this.sidebarModal.getByLabel('Duplicate', {exact: true});
this.selectAPropertyEditorBtn = page.getByLabel('Select a property editor');
this.typeToFilterTxt = page.locator('#filter #input');
// Approved Color
this.includeLabelsToggle = page.locator('#toggle');
this.addColorBtn = page.getByLabel('Add');
this.colorValueTxt = page.getByPlaceholder('Value').getByRole('textbox');
// Date Picker
this.offsetTimeToggle = page.locator('umb-property[label="Offset time"] #toggle');
this.dateFormatTxt = page.locator('[data-mark="property:format"] #input');
// List View
this.pageSizeTxt = page.locator('[data-mark="property:pageSize"] #input');
this.ascendingRadioBtn = page.locator('uui-radio[label="Ascending [a-z]"] #button');
this.descendingRadioBtn = page.locator('uui-radio[label="Descending [z-a]"] #button');
this.chooseColumnsDisplayedBtn = page.locator('[data-mark="property:includeProperties"]').getByLabel('Choose');
this.columnsDisplayedItems = page.locator('[data-mark="property:includeProperties"] .layout-item');
this.workspaceViewName = page.locator('[data-mark="property:tabName"] #input');
this.showWorkspaceViewFirstToggle = page.locator('[data-mark="property:showContentFirst"] #toggle');
this.editInInfiniteEditorToggle = page.locator('umb-property[label="Edit in Infinite Editor"] #toggle');
this.orderByDropDownBox = page.locator('[data-mark="property:orderBy"] select');
this.chooseLayoutsBtn = page.locator('[data-mark="property:layouts"]').getByLabel('Choose');
this.layoutsItems = page.locator('[data-mark="property:layouts"] .layout-item');
// Image Cropper
this.labelTxt = page.getByLabel('Label', {exact: true});
this.aliasTxt = page.getByLabel('Alias', {exact: true});
this.widthTxt = page.getByLabel('Width', {exact: true});
this.heightTxt = page.getByLabel('Height', {exact: true});
this.addCropBtn = page.getByLabel('Add', {exact: true});
this.saveCropBtn = page.locator('[alias="crops"]').getByLabel('Save');
// Numeric
this.minimumTxt = page.locator('[data-mark="property:min"] #input');
this.maximumTxt = page.locator('[data-mark="property:max"] #input');
this.stepSizeTxt = page.locator('[data-mark="property:step"] #input');
this.allowDecimalsToggle = page.locator('umb-property[label="Allow decimals"] #toggle');
// Radiobox
this.optionTxt = page.locator('[data-mark="property:items"] #input');
this.addOptionBtn = page.locator('[data-mark="property:items"]').getByLabel('Add', {exact: true});
// Textarea - Textstring
this.maximumAllowedCharsTxt = page.locator('[data-mark="property:maxChars"] #input');
this.numberOfRowsTxt = page.locator('[data-mark="property:rows"] #input');
this.minHeightTxt = page.locator('[data-mark="property:minHeight"] #input');
this.maxHeightTxt = page.locator('[data-mark="property:maxHeight"] #input');
// Upload
this.acceptedFileExtensionsTxt = page.locator('[data-mark="property:fileExtensions"] #input');
this.addAcceptedFileExtensionsBtn = page.locator('[data-mark="property:fileExtensions"]').getByLabel('Add', {exact: true});
// Multi URL Picker
this.minimumNumberOfItemsTxt = page.locator('[data-mark="property:minNumber"] #input');
this.maximumNumberOfItemsTxt = page.locator('[data-mark="property:maxNumber"] #input');
this.overlaySizeDropDownBox = page.locator('[data-mark="property:overlaySize"] select');
this.hideAnchorQueryStringInputToggle = page.locator('[data-mark="property:hideAnchor"] #toggle');
// Media Picker
this.pickMultipleItemsToggle = page.locator('[data-mark="property:multiple"] #toggle');
this.enableFocalPointToggle = page.locator('[data-mark="property:enableLocalFocalPoint"] #toggle');
this.amountLowValueTxt = page.locator('[data-mark="property:validationLimit"]').getByLabel('Low value');
this.amountHighValueTxt = page.locator('[data-mark="property:validationLimit"]').getByLabel('High value');
this.chooseAcceptedTypesBtn = page.locator('[data-mark="property:filter"]').getByLabel('Choose');
this.chooseWithPlusBtn = page.locator('#btn-add').filter({hasText: 'Choose'});
this.chooseStartNodeBtn = page.locator('[data-mark="property:startNodeId"] #btn-add');
// Rich Editor
this.toolbarCheckboxes = page.locator('[data-mark="property:toolbar"] uui-checkbox');
this.addStylesheetBtn = page.locator('[data-mark="property:stylesheets"]').getByLabel('Add stylesheet');
this.dimensionsWidthTxt = page.locator('[data-mark="property:dimensions"]').getByLabel('Width');
this.dimensionsHeightTxt = page.locator('[data-mark="property:dimensions"]').getByLabel('Height');
this.maxImageSizeTxt = page.locator('[data-mark="property:maxImageSize"] #input');
this.hideLabelToggle = page.locator('[data-mark="property:hideLabel"] #toggle');
this.inlineRadioBtn = page.locator('[data-mark="property:mode"] uui-radio[value="Inline"]');
this.addWithPlusBtn = page.locator('[data-mark="property:blocks"] #add-button');
// Tags
this.defineTagGroupTxt = page.locator('[data-mark="property:group"] #input');
this.storageTypeDropDownBox = page.locator('#native');
// Content Picker
this.showOpenButtonToggle = page.locator('[data-mark="property:showOpenButton"] #toggle');
// Dropdown
this.enableMultipleChoiceToggle = page.locator('[data-mark="property:multiple"] #toggle');
this.addOptionsBtn = page.locator('[data-mark="property:items"]').getByLabel('Add', {exact: true});
// True/false
this.presetValueToggle = page.locator('[data-mark="property:default"] #toggle');
this.showToggleLabelsToggle = page.locator('[data-mark="property:showLabels"] #toggle');
this.labelOnTxt = page.locator('[data-mark="property:labelOn"] #input');
this.labelOffTxt = page.locator('[data-mark="property:labelOff"] #input');
// Block List Editor and Block Grid Editor
this.addBlockBtn = page.locator('umb-input-block-type #blocks').getByLabel('open');
this.minAmountTxt = page.getByLabel('Low value');
this.maxAmountTxt = page.getByLabel('High value');
this.singleBlockModeBtn = this.page.locator('umb-property-layout').filter({hasText: 'Single block mode'}).locator('#toggle');
this.liveEditingModeBtn = this.page.locator('umb-property-layout').filter({hasText: 'Live editing'}).locator('#toggle');
this.inlineEditingModeBtn = this.page.locator('umb-property-layout').filter({hasText: 'Inline editing'}).locator('#toggle');
this.propertyEditorWidthTxt = this.page.locator('umb-property-layout').filter({hasText: 'Property editor width'}).locator('#input');
this.labelTextTxt = this.page.locator('[label="Label"]').locator('#input');
this.overlaySizeOption = this.page.locator('[label="Overlay editor size"]').locator('#native');
this.chooseContentModelBtn = this.page.locator('[alias="contentElementTypeKey"]').getByLabel('Choose');
this.chooseSettingsModelBtn = this.page.locator('[alias="settingsElementTypeKey"]').getByLabel('Choose');
this.contentModelNode = this.page.locator('[alias="contentElementTypeKey"]').locator('uui-ref-node-document-type');
this.settingsModelNode = this.page.locator('[alias="settingsElementTypeKey"]').locator('uui-ref-node-document-type')
this.removeExactContentModelNodeBtn = this.page.locator('[alias="contentElementTypeKey"]').getByLabel('Remove', {exact: true});
this.removeExactSettingsModelNodeBtn = this.page.locator('[alias="settingsElementTypeKey"]').getByLabel('Remove', {exact: true});
this.openBtn = this.page.getByLabel('Open', {exact: true});
this.backgroundColorBtn = this.page.locator('umb-property-layout').filter({hasText: 'Background color'}).getByLabel('Eye dropper');
this.backgroundColorTxt = this.page.locator('[label="Background color"]').locator('[label="Eye dropper"]').locator('#input');
this.iconColorBtn = this.page.locator('umb-property-layout').filter({hasText: 'Icon color'}).getByLabel('Eye dropper');
this.iconColorTxt = this.page.locator('[label="Icon color"]').locator('[label="Eye dropper"]').locator('#input');
this.stylesheetRemoveBtn = this.page.locator('uui-ref-node').getByLabel('Remove', {exact: true});
this.hideContentEditorBlockListBtn = this.page.locator('[alias="forceHideContentEditorInOverlay"]').locator('#toggle');
this.hideContentEditorBlockGridBtn = this.page.locator('[alias="hideContentEditor"]').locator('#toggle');
this.customStylesheetLabel = this.page.locator('[label="Custom stylesheet"]');
this.chooseThumbnailAlias = this.page.locator('[alias="thumbnail"]').getByLabel('Choose');
this.documentTypeWorkspace = this.page.locator('umb-document-type-workspace-editor');
this.editorWidthTxt = this.page.locator('umb-property-layout').filter({hasText: 'Editor width'}).locator('#input');
this.createButtonLabelTxt = this.page.locator('umb-property-layout').filter({hasText: 'Create button label'}).locator('#input');
this.gridColumnsTxt = this.page.locator('umb-property-layout').filter({hasText: 'Grid columns'}).locator('#input');
this.showResizeOptionsBtn = this.page.getByLabel('Show resize options');
this.columnSpanOptions = this.page.locator('[alias="columnSpanOptions"]');
this.areasTabBtn = this.page.getByRole('tab', {name: 'Areas'});
this.availableRowSpansLowValueTxt = this.page.locator('[label="Available row spans"]').getByLabel('Low value');
this.availableRowSpansHighValueTxt = this.page.locator('[label="Available row spans"]').getByLabel('High value');
this.areaGridColumnsTxt = this.page.locator('[alias="areaGridColumns"]').locator('#input');
this.addAreaBtn = this.page.getByLabel('Add area');
this.blockAreaConfig = this.page.locator('umb-block-area-config-entry');
this.aliasAliasTxt = this.page.locator('[alias="alias"]').locator('#input');
this.blockGridAreaWorkspaceSubmitBtn = this.page.locator('umb-block-grid-area-type-workspace-editor').getByLabel('Submit');
this.createLabelTxt = this.page.locator('[alias="createLabel"]').locator('#input');
this.minAllowedTxt = this.page.locator('#container').getByLabel('Low value');
this.maxAllowedTxt = this.page.locator('#container').getByLabel('High value');
this.addSpecifiedAllowanceBtn = this.page.locator('[alias="specifiedAllowance"]').getByLabel('Add');
this.advancedTabBtn = this.page.getByRole('tab', {name: 'Advanced'});
this.allowBlockAtRootBtn = this.page.locator('[alias="allowAtRoot"]');
this.allowInAreasBtn = this.page.locator('[alias="allowInAreas"]');
this.expandChildItemsForMediaBtn = this.page.getByLabel('Expand child items for media', {exact: true});
this.chooseCustomStylesheetBtn = this.page.locator('[label="Custom stylesheet"]').getByLabel('Choose');
// Tiptap
this.tiptapToolbarConfiguration = this.page.locator('umb-property-editor-ui-tiptap-toolbar-configuration');
this.addGroupToolbarBtn = this.tiptapToolbarConfiguration.locator('uui-button').filter({hasText: 'Add group'});
this.addRowToolbarBtn = this.tiptapToolbarConfiguration.locator('uui-button').filter({hasText: 'Add row'});
this.tiptapExtensionsConfiguration = this.page.locator('umb-property-editor-ui-tiptap-extensions-configuration');
this.propertyEditor = this.page.locator('umb-ref-property-editor-ui');
this.selectIconBtn = page.getByLabel('Select icon');
this.dataTypeBtn = this.createOptionActionListModal.locator('[name="Data Type"]');
this.dataTypesMenu = page.locator('#menu-item').getByRole('link', {name: 'Data Types'});
}
async clickActionsMenuForDataType(name: string) {
await this.clickActionsMenuForNameInSectionSidebar(name);
}
async clickActionsMenuAtRoot() {
await this.clickActionsMenuForDataType('Data Types');
}
async clickRootFolderCaretButton() {
await this.clickCaretButtonForName('Data Types');
}
async createDataTypeFolder(folderName: string) {
await this.clickActionsMenuCreateButton();
await this.clickFolderButton();
await this.enterFolderName(folderName);
await this.clickConfirmCreateFolderButton();
}
async goToDataType(dataTypeName: string) {
await this.clickRootFolderCaretButton();
await expect(this.sectionSidebar.getByLabel(dataTypeName, {exact: true})).toBeVisible();
await this.sectionSidebar.getByLabel(dataTypeName, {exact: true}).click();
}
async clickMoveToButton() {
await expect(this.moveToBtn).toBeVisible();
await this.moveToBtn.click();
}
async clickDuplicateToButton() {
await expect(this.duplicateToBtn).toBeVisible();
await this.duplicateToBtn.click();
}
async clickNewDataTypeButton() {
await this.newDataTypeBtn.click();
}
async clickNewDataTypeFolderButton() {
await this.newFolderBtn.click();
}
async enterDataTypeName(name: string) {
await this.dataTypeNameTxt.click();
await this.dataTypeNameTxt.clear();
await this.dataTypeNameTxt.fill(name);
}
async clickCreateFolderButton() {
await this.createDataTypeFolderBtn.click();
}
async clickUpdateFolderButton() {
await this.updateDataTypeFolderBtn.click();
}
async deleteDataType(name: string) {
await this.clickActionsMenuForDataType(name);
await this.clickDeleteAndConfirmButton();
}
async deleteDataTypeFolder(folderName: string) {
await this.clickActionsMenuForDataType(folderName);
await this.deleteFolder();
}
async moveDataTypeToFolder(folderName: string) {
await this.clickMoveToButton();
await expect(this.modalCaretBtn).toBeVisible();
await this.modalCaretBtn.click();
await this.sidebarModal.getByText(folderName, {exact: true}).click();
await this.chooseModalBtn.click();
}
async duplicateDataTypeToFolder(folderName: string) {
await this.clickDuplicateToButton();
await expect(this.modalCaretBtn).toBeVisible();
await this.modalCaretBtn.click();
await this.sidebarModal.getByText(folderName, {exact: true}).click();
await this.duplicateBtn.click();
}
async addMediaStartNode(mediaName: string) {
await this.mediaCardItems.filter({hasText: mediaName}).click();
await this.clickChooseModalButton();
}
async addContentStartNode(contentName: string) {
await this.clickTextButtonWithName(contentName);
await this.chooseModalBtn.click();
}
async clickSelectAPropertyEditorButton() {
await this.selectAPropertyEditorBtn.click();
}
async selectAPropertyEditor(propertyName: string, filterKeyword?: string) {
await this.typeToFilterTxt.fill(filterKeyword ? filterKeyword : propertyName);
await this.clickTextButtonWithName(propertyName);
}
// Approved Color
async clickIncludeLabelsToggle() {
await this.includeLabelsToggle.click();
}
async removeColorByValue(value: string) {
await this.page.locator('[value="' + value + '"] uui-button svg').click();
await this.confirmToDeleteBtn.click();
}
async addColor(value: string) {
await this.addColorBtn.click();
await this.colorValueTxt.clear();
await this.colorValueTxt.fill(value);
}
// Label
async changeValueType(valueType: string) {
await this.page.getByLabel('Select a value type').selectOption({label: valueType});
}
// Date Picker
async clickOffsetTimeToggle() {
await this.offsetTimeToggle.click();
}
async enterDateFormatValue(value: string) {
await this.dateFormatTxt.clear();
await this.dateFormatTxt.fill(value);
}
// List View
async enterPageSizeValue(value: string) {
await this.pageSizeTxt.clear();
await this.pageSizeTxt.fill(value);
}
async chooseOrderDirection(isAscending: boolean) {
if (isAscending) {
await this.ascendingRadioBtn.click();
} else {
await this.descendingRadioBtn.click();
}
}
async addColumnDisplayed(contentType: string, contentName: string, propertyAlias: string) {
await this.chooseColumnsDisplayedBtn.click();
await this.clickTextButtonWithName(contentType);
await this.clickTextButtonWithName(contentName);
await this.clickChooseContainerButton();
await this.clickTextButtonWithName(propertyAlias);
}
async removeColumnDisplayed(propertyAlias: string) {
await this.columnsDisplayedItems.filter({has: this.page.getByText(propertyAlias, {exact: true})}).getByText('Remove').click();
}
async addLayouts(layoutName: string) {
await expect(this.chooseLayoutsBtn).toBeVisible();
await this.chooseLayoutsBtn.click();
await expect(this.page.locator('[name="' + layoutName + '"]')).toBeVisible();
await this.page.locator('[name="' + layoutName + '"]').click();
}
async removeLayouts(layoutAlias: string) {
await this.layoutsItems.filter({has: this.page.getByText(layoutAlias, {exact: true})}).getByText('Remove').click();
}
async chooseOrderByValue(value: string) {
await this.orderByDropDownBox.selectOption({label: value});
}
async enterWorkspaceViewName(name: string) {
await this.workspaceViewName.clear();
await this.workspaceViewName.fill(name);
}
async clickShowContentWorkspaceViewFirstToggle() {
await this.showWorkspaceViewFirstToggle.click();
}
async clickEditInInfiniteEditorToggle() {
await this.editInInfiniteEditorToggle.click();
}
async clickBulkActionPermissionsToggleByValue(value: string) {
await this.page.locator("uui-toggle[label='" + value + "'] #toggle").click();
}
async clickSelectIconButton() {
await expect(this.selectIconBtn).toBeVisible();
// Force click is needed
await this.selectIconBtn.click({force: true});
}
async chooseWorkspaceViewIconByValue(value: string) {
await this.page.locator('[label="' + value + '"] svg').click();
await this.submitBtn.click();
}
// Image Cropper
async enterCropValues(label: string, alias: string, width: string, height: string) {
await expect(this.labelTxt).toBeVisible();
await this.labelTxt.clear();
await this.labelTxt.fill(label);
await expect(this.aliasTxt).toBeVisible();
await this.aliasTxt.clear();
await this.aliasTxt.fill(alias);
await expect(this.widthTxt).toBeVisible();
await this.widthTxt.clear();
await this.widthTxt.fill(width);
await this.heightTxt.clear();
await this.heightTxt.fill(height);
}
async clickAddCropButton() {
await expect(this.addCropBtn).toBeVisible();
await this.addCropBtn.click();
}
async clickSaveCropButton() {
await expect(this.saveCropBtn).toBeVisible();
await this.saveCropBtn.click();
}
async editCropByAlias(alias: string) {
await expect(this.page.locator('.crop').filter({has: this.page.getByText(alias)}).getByText('Edit')).toBeVisible();
await this.page.locator('.crop').filter({has: this.page.getByText(alias)}).getByText('Edit').click();
}
async removeCropByAlias(alias: string) {
await expect(this.page.locator('.crop').filter({has: this.page.getByText(alias)}).getByText('Remove')).toBeVisible();
await this.page.locator('.crop').filter({has: this.page.getByText(alias)}).getByText('Remove').click();
}
// Numeric
async enterMinimumValue(value: string) {
await expect(this.minimumTxt).toBeVisible();
await this.minimumTxt.clear();
await this.minimumTxt.fill(value);
}
async enterMaximumValue(value: string) {
await expect(this.maximumTxt).toBeVisible();
await this.maximumTxt.clear();
await this.maximumTxt.fill(value);
}
async enterStepSizeValue(value: string) {
await expect(this.stepSizeTxt).toBeVisible();
await this.stepSizeTxt.clear();
await this.stepSizeTxt.fill(value);
}
async clickAllowDecimalsToggle() {
await expect(this.allowDecimalsToggle).toBeVisible();
await this.allowDecimalsToggle.click();
}
// Radiobox
async removeOptionByName(name: string) {
await expect(this.page.locator("uui-button[label='Remove " + name + "'] svg")).toBeVisible();
await this.page.locator("uui-button[label='Remove " + name + "'] svg").click();
await this.confirmToDeleteBtn.click();
}
async enterOptionName(name: string) {
await expect(this.optionTxt.last()).toBeVisible();
await this.optionTxt.last().clear();
await this.optionTxt.last().fill(name);
}
async clickAddOptionButton() {
await expect(this.addOptionBtn).toBeVisible();
await this.addOptionBtn.click();
}
// Textarea - Textstring
async enterMaximumAllowedCharactersValue(value: string) {
await expect(this.maximumAllowedCharsTxt).toBeVisible();
await this.maximumAllowedCharsTxt.clear();
await this.maximumAllowedCharsTxt.fill(value);
}
async enterNumberOfRowsValue(value: string) {
await expect(this.numberOfRowsTxt).toBeVisible();
await this.numberOfRowsTxt.clear();
await this.numberOfRowsTxt.fill(value);
}
async enterMaxHeightValue(value: string) {
await expect(this.maxHeightTxt).toBeVisible();
await this.maxHeightTxt.clear();
await this.maxHeightTxt.fill(value);
}
async enterMinHeightValue(value: string) {
await this.minHeightTxt.clear();
await this.minHeightTxt.fill(value);
}
// Upload
async enterAcceptedFileExtensions(value: string) {
await this.acceptedFileExtensionsTxt.last().clear();
await this.acceptedFileExtensionsTxt.last().fill(value);
}
async removeAcceptedFileExtensionsByValue(value: string) {
await this.page.locator("uui-button[label='Remove " + value + "'] svg").click();
await this.confirmToDeleteBtn.click();
}
async clickAddAcceptedFileExtensionsButton() {
await this.addAcceptedFileExtensionsBtn.click();
}
// Multi URL Picker
async enterMinimumNumberOfItemsValue(value: string) {
await this.minimumNumberOfItemsTxt.clear();
await this.minimumNumberOfItemsTxt.fill(value);
}
async enterMaximumNumberOfItemsValue(value: string) {
await this.maximumNumberOfItemsTxt.clear();
await this.maximumNumberOfItemsTxt.fill(value);
}
async clickIgnoreUserStartNodesToggle() {
await this.ignoreUserStartNodesToggle.click();
}
async chooseOverlaySizeByValue(value: string) {
await this.overlaySizeDropDownBox.selectOption({value: value});
}
async clickHideAnchorQueryStringInputToggle() {
await this.hideAnchorQueryStringInputToggle.click();
}
// Media Picker
async clickPickMultipleItemsToggle() {
await this.pickMultipleItemsToggle.click();
}
async clickEnableFocalPointToggle() {
await expect(this.enableFocalPointToggle).toBeVisible();
await this.enableFocalPointToggle.click();
}
async enterAmountValue(lowValue: string, highValue: string) {
await this.amountLowValueTxt.clear();
await this.amountLowValueTxt.fill(lowValue);
await this.amountHighValueTxt.clear();
await this.amountHighValueTxt.fill(highValue);
}
async addAcceptedType(mediaTypeName: string) {
await this.chooseAcceptedTypesBtn.click();
await this.clickTextButtonWithName(mediaTypeName);
await this.chooseModalBtn.click();
}
async removeAcceptedType(mediaTypeName: string) {
await this.page.locator('uui-ref-node-document-type[name="' + mediaTypeName + '"]').getByLabel('Remove').click();
await this.confirmToRemoveBtn.click();
}
async removeMediaStartNode(mediaName: string) {
await this.page.locator('uui-card-media[name="' + mediaName + '"]').locator('[label="Remove"]').click();
await this.confirmToRemoveBtn.click();
}
async clickChooseStartNodeButton() {
await this.chooseStartNodeBtn.click();
}
// Richtext Editor
async clickToolbarOptionByValue(values) {
for (var index in values) {
await this.toolbarCheckboxes.filter({has: this.page.getByLabel(values[index])}).locator('#ticker svg').click();
}
}
async addStylesheet(stylesheetName: string) {
await this.addStylesheetBtn.click();
await this.page.getByLabel(stylesheetName).click();
await this.chooseModalBtn.click();
}
async enterDimensionsValue(width: string, height: string) {
await this.dimensionsWidthTxt.clear();
await this.dimensionsWidthTxt.fill(width);
await this.dimensionsHeightTxt.clear();
await this.dimensionsHeightTxt.fill(height);
}
async enterMaximumSizeForImages(value: string) {
await this.maxImageSizeTxt.clear();
await this.maxImageSizeTxt.fill(value);
}
async clickHideLabelToggle() {
await this.hideLabelToggle.click();
}
async clickInlineRadioButton() {
await this.inlineRadioBtn.click();
}
async clickChooseWithPlusButton() {
await this.chooseWithPlusBtn.click();
}
async addImageUploadFolder(mediaFolderName: string) {
await this.clickChooseWithPlusButton();
await this.selectMediaWithName(mediaFolderName);
await this.clickChooseModalButton();
}
async clickAddWithPlusButton() {
await expect(this.addWithPlusBtn).toBeVisible();
await this.addWithPlusBtn.click();
}
async addAvailableBlocks(blockName: string) {
await this.clickAddWithPlusButton();
await this.clickTextButtonWithName(blockName);
await this.clickChooseModalButton();
await this.clickSubmitButton();
}
// Tags
async enterDefineTagGroupValue(value: string) {
await expect(this.defineTagGroupTxt).toBeVisible();
await this.defineTagGroupTxt.clear();
await this.defineTagGroupTxt.fill(value);
}
async selectStorageTypeOption(option: string) {
await expect(this.storageTypeDropDownBox).toBeVisible();
await this.storageTypeDropDownBox.selectOption({label: option});
}
// Content Picker
async clickShowOpenButtonToggle() {
await expect(this.showOpenButtonToggle).toBeVisible();
await this.showOpenButtonToggle.click();
}
async removeContentStartNode(contentName: string) {
const startNodeLocator = this.page.locator('umb-entity-item-ref').filter({has: this.page.locator('[name="' + contentName + '"]')});
await startNodeLocator.hover();
await startNodeLocator.getByLabel('Remove').click();
await this.clickConfirmRemoveButton();
}
// Dropdown
async clickEnableMultipleChoiceToggle() {
await expect(this.enableMultipleChoiceToggle).toBeVisible();
await this.enableMultipleChoiceToggle.click();
}
async clickAddOptionsButton() {
await expect(this.addOptionsBtn).toBeVisible();
await this.addOptionsBtn.click();
}
// True/false
async clickPresetValueToggle() {
await expect(this.presetValueToggle).toBeVisible();
await this.presetValueToggle.click();
}
async clickShowToggleLabelsToggle() {
await expect(this.showToggleLabelsToggle).toBeVisible();
await this.showToggleLabelsToggle.click();
}
async enterLabelOnValue(value: string) {
await expect(this.labelOnTxt).toBeVisible();
await this.labelOnTxt.clear();
await this.labelOnTxt.fill(value);
}
async enterLabelOffValue(value: string) {
await expect(this.labelOffTxt).toBeVisible();
await this.labelOffTxt.clear();
await this.labelOffTxt.fill(value);
}
// Block List Editor
async clickAddBlockButton(index: number = 0) {
await expect(this.addBlockBtn.nth(index)).toBeVisible();
await this.addBlockBtn.nth(index).click();
}
async clickRemoveBlockWithName(name: string) {
const blockWithNameLocator = this.page.locator('umb-block-type-card', {hasText: name});
await expect(blockWithNameLocator).toBeVisible();
// The force click is necessary.
await blockWithNameLocator.getByLabel('Remove block').click({force: true});
}
async enterMinAmount(value: string) {
await expect(this.minAmountTxt).toBeVisible()
await this.minAmountTxt.clear();
await this.minAmountTxt.fill(value);
}
async enterMaxAmount(value: string) {
await expect(this.maxAmountTxt).toBeVisible()
await this.maxAmountTxt.clear();
await this.maxAmountTxt.fill(value);
}
async doesAmountContainErrorMessageWithText(errorMessage: string) {
return await expect(this.page.getByText(errorMessage)).toBeVisible();
}
async clickSingleBlockMode() {
await expect(this.singleBlockModeBtn).toBeVisible()
await this.singleBlockModeBtn.click();
}
async clickLiveEditingMode() {
await expect(this.liveEditingModeBtn).toBeVisible();
await this.liveEditingModeBtn.click();
}
async clickInlineEditingMode() {
await expect(this.inlineEditingModeBtn).toBeVisible();
await this.inlineEditingModeBtn.click();
}
async enterPropertyEditorWidth(width: string) {
await expect(this.propertyEditorWidthTxt).toBeVisible();
await this.propertyEditorWidthTxt.clear();
await this.propertyEditorWidthTxt.fill(width);
}
async goToBlockWithName(name: string) {
await expect(this.page.getByRole('link', {name: name})).toBeVisible();
await this.page.getByRole('link', {name: name}).click();
}
async enterBlockLabelText(label: string) {
await this.removeBlockLabelText();
await this.labelTextTxt.fill(label);
}
async removeBlockLabelText() {
await expect(this.labelTextTxt).toBeVisible();
await this.labelTextTxt.clear();
}
async clickAllowInRootForBlock() {
await expect(this.allowBlockAtRootBtn).toBeVisible();
await this.allowBlockAtRootBtn.click();
}
async clickAllowInAreasForBlock() {
await expect(this.allowInAreasBtn).toBeVisible();
await this.allowInAreasBtn.click();
}
async updateBlockOverlaySize(size: string) {
await expect(this.overlaySizeOption).toBeVisible();
await this.overlaySizeOption.selectOption(size);
}
async addBlockContentModel(elementName: string) {
await expect(this.chooseContentModelBtn).toBeVisible();
await this.chooseContentModelBtn.click();
await this.clickButtonWithName(elementName);
await this.clickChooseButton();
}
async addBlockSettingsModel(elementName: string) {
await expect(this.chooseSettingsModelBtn).toBeVisible();
await this.chooseSettingsModelBtn.click();
await this.clickButtonWithName(elementName);
await this.clickChooseModalButton();
}
async removeBlockContentModel() {
await expect(this.contentModelNode).toBeVisible();
await this.contentModelNode.hover();
await expect(this.removeExactContentModelNodeBtn).toBeVisible();
await this.removeExactContentModelNodeBtn.click();
}
async removeBlockSettingsModel() {
await expect(this.settingsModelNode).toBeVisible();
await this.settingsModelNode.hover();
await expect(this.removeExactContentModelNodeBtn).toBeVisible();
await this.removeExactSettingsModelNodeBtn.click();
}
async openBlockContentModel() {
await expect(this.contentModelNode).toBeVisible();
await this.contentModelNode.hover();
await expect(this.openBtn).toBeVisible();
await this.openBtn.click();
}
async openBlockSettingsModel() {
await expect(this.settingsModelNode).toBeVisible();
await this.settingsModelNode.hover();
await expect(this.openBtn).toBeVisible();
await this.openBtn.click();
}
async isElementWorkspaceOpenInBlock(elementTypeName: string) {
return await expect(this.documentTypeWorkspace.filter({hasText: elementTypeName})).toBeVisible();
}
async selectBlockBackgroundColor(color: string) {
await expect(this.backgroundColorBtn).toBeVisible();
await this.backgroundColorBtn.click();
await this.backgroundColorTxt.clear();
await this.backgroundColorTxt.fill(color);
}
async selectBlockIconColor(color: string) {
await expect(this.iconColorBtn).toBeVisible();
await this.iconColorBtn.click();
await this.iconColorTxt.clear();
await this.iconColorTxt.fill(color);
}
async clickExpandChildItemsForMediaButton() {
await expect(this.expandChildItemsForMediaBtn).toBeVisible();
await this.expandChildItemsForMediaBtn.click();
}
async clickRemoveCustomStylesheetWithName(name: string) {
await expect(this.customStylesheetLabel.locator('[name="' + name + '"]')).toBeVisible();
await this.customStylesheetLabel.locator('[name="' + name + '"]').click();
await expect(this.stylesheetRemoveBtn).toBeVisible();
await this.stylesheetRemoveBtn.click();
await this.clickConfirmRemoveButton();
}
async clickBlockGridHideContentEditorButton() {
await expect(this.hideContentEditorBlockGridBtn).toBeVisible();
await this.hideContentEditorBlockGridBtn.click();
}
async chooseBlockCustomStylesheetWithName(name: string) {
await expect(this.chooseCustomStylesheetBtn).toBeVisible();
await this.chooseCustomStylesheetBtn.click();
await this.clickCaretButtonForName('wwwroot');
await this.clickCaretButtonForName('css');
await this.clickLabelWithName(name, true);
await this.clickChooseModalButton();
}
async chooseBlockThumbnailWithPath(name: string, mediaPath: string) {
await expect(this.chooseThumbnailAlias).toBeVisible();
await this.chooseThumbnailAlias.click();
await this.clickCaretButtonForName('wwwroot');
await this.clickExpandChildItemsForMediaButton();
await this.page.locator('uui-menu-item[label="' + mediaPath + '"] #caret-button').click();
await this.clickLabelWithName(name, true);
await this.clickChooseModalButton();
}
async clickBlockListHideContentEditorButton() {
await expect(this.hideContentEditorBlockListBtn).toBeVisible();
await this.hideContentEditorBlockListBtn.click();
}
async enterEditorWidth(value: string) {
await expect(this.editorWidthTxt).toBeVisible();
await this.editorWidthTxt.clear();
await this.editorWidthTxt.fill(value);
}
async enterCreateButtonLabel(value: string) {
await expect(this.createButtonLabelTxt).toBeVisible();
await this.createButtonLabelTxt.clear();
await this.createButtonLabelTxt.fill(value);
}
async enterGridColumns(value: number) {
await expect(this.gridColumnsTxt).toBeVisible();
await this.gridColumnsTxt.clear();
if (value === undefined) {
return;
}
await this.gridColumnsTxt.fill(value.toString());
}
async clickShowResizeOptions() {
await expect(this.showResizeOptionsBtn).toBeVisible();
await this.showResizeOptionsBtn.click();
}