@umbraco/playwright-testhelpers 15.0.11 → 15.0.13
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.
- package/dist/lib/helpers/ContentUiHelper.d.ts +5 -2
- package/dist/lib/helpers/ContentUiHelper.js +46 -7
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeUiHelper.d.ts +4 -2
- package/dist/lib/helpers/DataTypeUiHelper.js +111 -18
- package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/DictionaryUiHelper.js +3 -1
- package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeUiHelper.js +13 -6
- package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/LanguageUiHelper.js +2 -2
- package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
- package/dist/lib/helpers/LogViewerUiHelper.js +1 -0
- package/dist/lib/helpers/LogViewerUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaUiHelper.js +4 -2
- package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberUiHelper.js +1 -1
- package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
- package/dist/lib/helpers/PartialViewUiHelper.js +8 -0
- package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
- package/dist/lib/helpers/RedirectManagementUiHelper.js +2 -0
- package/dist/lib/helpers/RedirectManagementUiHelper.js.map +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.js +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
- package/dist/lib/helpers/TemplateUiHelper.js +2 -0
- package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +6 -0
- package/dist/lib/helpers/UiBaseLocators.js +54 -6
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UserGroupUiHelper.js +17 -3
- package/dist/lib/helpers/UserGroupUiHelper.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -73,6 +73,7 @@ class UiBaseLocators {
|
|
|
73
73
|
aliasNameTxt;
|
|
74
74
|
deleteFolderThreeDotsBtn;
|
|
75
75
|
createLink;
|
|
76
|
+
actionMenucreateBtn;
|
|
76
77
|
insertValueBtn;
|
|
77
78
|
insertPartialViewBtn;
|
|
78
79
|
insertDictionaryItemBtn;
|
|
@@ -127,6 +128,8 @@ class UiBaseLocators {
|
|
|
127
128
|
embeddedRetrieveBtn;
|
|
128
129
|
embeddedMediaModalConfirmBtn;
|
|
129
130
|
embeddedPreview;
|
|
131
|
+
sectionSidebar;
|
|
132
|
+
actionsMenuContainer;
|
|
130
133
|
constructor(page) {
|
|
131
134
|
this.page = page;
|
|
132
135
|
this.saveBtn = page.getByLabel('Save', { exact: true });
|
|
@@ -160,10 +163,12 @@ class UiBaseLocators {
|
|
|
160
163
|
this.newNameTxt = page.getByRole('textbox', { name: 'Enter new name...' });
|
|
161
164
|
this.renameModalBtn = page.locator('umb-rename-modal').getByLabel('Rename');
|
|
162
165
|
this.createBtn = page.getByRole('button', { name: /^Create(\.\.\.)?$/ });
|
|
166
|
+
this.actionsMenuContainer = page.locator('uui-scroll-container');
|
|
167
|
+
this.actionMenucreateBtn = this.actionsMenuContainer.getByRole('button', { name: /^Create(\.\.\.)?$/ });
|
|
163
168
|
this.successState = page.locator('[state="success"]');
|
|
164
169
|
this.chooseModalBtn = this.sidebarModal.locator('[look="primary"]').getByLabel('Choose');
|
|
165
|
-
this.addBtn = page.
|
|
166
|
-
this.renameFolderThreeDotsBtn = page.
|
|
170
|
+
this.addBtn = page.getByRole('button', { name: 'Add', exact: true });
|
|
171
|
+
this.renameFolderThreeDotsBtn = page.getByRole('button', { name: 'Rename folder...' });
|
|
167
172
|
this.renameFolderBtn = page.getByLabel('Rename folder');
|
|
168
173
|
this.confirmRenameFolderBtn = page.locator('#confirm').getByLabel('Rename folder');
|
|
169
174
|
this.updateFolderBtn = page.getByLabel('Update folder');
|
|
@@ -251,8 +256,14 @@ class UiBaseLocators {
|
|
|
251
256
|
this.embeddedRetrieveBtn = this.embeddedMediaModal.locator('[label="Retrieve"]');
|
|
252
257
|
this.embeddedMediaModalConfirmBtn = this.embeddedMediaModal.getByLabel('Confirm');
|
|
253
258
|
this.embeddedPreview = this.embeddedMediaModal.locator('[label="Preview"]');
|
|
259
|
+
this.sectionSidebar = page.locator('umb-section-sidebar');
|
|
260
|
+
}
|
|
261
|
+
async clickActionsMenuForNameInSectionSidebar(name) {
|
|
262
|
+
await this.sectionSidebar.locator('[label="' + name + '"]').hover();
|
|
263
|
+
await this.sectionSidebar.locator('[label="' + name + '"] >> [label="Open actions menu"]').first().click();
|
|
254
264
|
}
|
|
255
265
|
async clickActionsMenuForName(name) {
|
|
266
|
+
await (0, test_1.expect)(this.page.locator('[label="' + name + '"]')).toBeVisible();
|
|
256
267
|
await this.page.locator('[label="' + name + '"]').hover();
|
|
257
268
|
await this.page.locator('[label="' + name + '"] >> [label="Open actions menu"]').first().click();
|
|
258
269
|
}
|
|
@@ -261,8 +272,12 @@ class UiBaseLocators {
|
|
|
261
272
|
await (0, test_1.expect)(this.page.locator('[label="' + name + '"] >> [label="Open actions menu"]')).toBeVisible({ visible: isVisible });
|
|
262
273
|
}
|
|
263
274
|
async clickCaretButtonForName(name) {
|
|
275
|
+
await this.isCaretButtonWithNameVisible(name);
|
|
264
276
|
await this.page.locator('div').filter({ hasText: name }).locator('#caret-button').click();
|
|
265
277
|
}
|
|
278
|
+
async isCaretButtonWithNameVisible(name, isVisible = true) {
|
|
279
|
+
await (0, test_1.expect)(this.page.locator('div').filter({ hasText: name }).locator('#caret-button')).toBeVisible({ visible: isVisible });
|
|
280
|
+
}
|
|
266
281
|
async clickCaretButton() {
|
|
267
282
|
await this.page.locator('#caret-button').click();
|
|
268
283
|
}
|
|
@@ -276,7 +291,6 @@ class UiBaseLocators {
|
|
|
276
291
|
const isCaretButtonOpen = await menuItem.getAttribute('show-children');
|
|
277
292
|
if (isCaretButtonOpen === null) {
|
|
278
293
|
// We need to wait before clicking the caret button. Because the reload might not have happend yet.
|
|
279
|
-
// await this.page.waitForTimeout(500);
|
|
280
294
|
await this.clickCaretButtonForName(treeName);
|
|
281
295
|
}
|
|
282
296
|
}
|
|
@@ -426,6 +440,7 @@ class UiBaseLocators {
|
|
|
426
440
|
await this.orderByPropertyAliasBtn.click();
|
|
427
441
|
// Click to ascending button if isAscending is false
|
|
428
442
|
if (!isAscending) {
|
|
443
|
+
await (0, test_1.expect)(this.ascendingBtn).toBeVisible();
|
|
429
444
|
await this.ascendingBtn.click();
|
|
430
445
|
}
|
|
431
446
|
}
|
|
@@ -452,7 +467,7 @@ class UiBaseLocators {
|
|
|
452
467
|
await ddlOption.click();
|
|
453
468
|
}
|
|
454
469
|
async createFolder(folderName) {
|
|
455
|
-
await this.
|
|
470
|
+
await this.clickActionsMenuCreateButton();
|
|
456
471
|
await this.clickNewFolderThreeDotsButton();
|
|
457
472
|
await this.enterFolderName(folderName);
|
|
458
473
|
await this.clickConfirmCreateFolderButton();
|
|
@@ -497,6 +512,7 @@ class UiBaseLocators {
|
|
|
497
512
|
}
|
|
498
513
|
async goToSettingsTreeItem(settingsTreeItemName) {
|
|
499
514
|
await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings);
|
|
515
|
+
await (0, test_1.expect)(this.page.getByLabel(settingsTreeItemName, { exact: true })).toBeVisible();
|
|
500
516
|
await this.page.getByLabel(settingsTreeItemName, { exact: true }).click();
|
|
501
517
|
}
|
|
502
518
|
async clickDataElement(elementName, options = null) {
|
|
@@ -537,7 +553,12 @@ class UiBaseLocators {
|
|
|
537
553
|
await (0, test_1.expect)(this.createBtn).toBeVisible();
|
|
538
554
|
await this.createBtn.click();
|
|
539
555
|
}
|
|
556
|
+
async clickActionsMenuCreateButton() {
|
|
557
|
+
await (0, test_1.expect)(this.actionMenucreateBtn).toBeVisible();
|
|
558
|
+
await this.actionMenucreateBtn.click();
|
|
559
|
+
}
|
|
540
560
|
async clickAddButton() {
|
|
561
|
+
await (0, test_1.expect)(this.addBtn).toBeVisible();
|
|
541
562
|
await this.addBtn.click();
|
|
542
563
|
}
|
|
543
564
|
;
|
|
@@ -578,9 +599,11 @@ class UiBaseLocators {
|
|
|
578
599
|
await this.validation.selectOption(option);
|
|
579
600
|
}
|
|
580
601
|
async enterRegEx(regEx) {
|
|
602
|
+
await (0, test_1.expect)(this.regexTxt).toBeVisible();
|
|
581
603
|
await this.regexTxt.fill(regEx);
|
|
582
604
|
}
|
|
583
605
|
async enterRegExMessage(regExMessage) {
|
|
606
|
+
await (0, test_1.expect)(this.regexMessageTxt).toBeVisible();
|
|
584
607
|
await this.regexMessageTxt.fill(regExMessage);
|
|
585
608
|
}
|
|
586
609
|
async clickCompositionsButton() {
|
|
@@ -632,7 +655,6 @@ class UiBaseLocators {
|
|
|
632
655
|
await this.chooseModalBtn.click();
|
|
633
656
|
}
|
|
634
657
|
async enterGroupName(groupName, index = 0) {
|
|
635
|
-
await this.page.waitForTimeout(200);
|
|
636
658
|
const groupNameTxt = this.groupLabel.nth(index);
|
|
637
659
|
await (0, test_1.expect)(groupNameTxt).toBeVisible();
|
|
638
660
|
await groupNameTxt.clear();
|
|
@@ -672,9 +694,11 @@ class UiBaseLocators {
|
|
|
672
694
|
await this.page.mouse.up();
|
|
673
695
|
}
|
|
674
696
|
async getButtonWithName(name) {
|
|
697
|
+
await (0, test_1.expect)(this.page.getByRole('button', { name: name })).toBeVisible();
|
|
675
698
|
return this.page.getByRole('button', { name: name });
|
|
676
699
|
}
|
|
677
700
|
async clickCreateLink() {
|
|
701
|
+
await (0, test_1.expect)(this.createLink).toBeVisible();
|
|
678
702
|
await this.createLink.click();
|
|
679
703
|
}
|
|
680
704
|
async insertSystemFieldValue(fieldValue) {
|
|
@@ -699,6 +723,7 @@ class UiBaseLocators {
|
|
|
699
723
|
async deletePropertyEditorWithName(name) {
|
|
700
724
|
// We need to hover over the Property Editor to make the delete button visible
|
|
701
725
|
const propertyEditor = this.page.locator('umb-content-type-design-editor-property', { hasText: name });
|
|
726
|
+
await (0, test_1.expect)(propertyEditor).toBeVisible();
|
|
702
727
|
await propertyEditor.hover();
|
|
703
728
|
await (0, test_1.expect)(propertyEditor.getByLabel('Delete')).toBeVisible();
|
|
704
729
|
// Force click is needed
|
|
@@ -706,6 +731,7 @@ class UiBaseLocators {
|
|
|
706
731
|
await this.clickConfirmToDeleteButton();
|
|
707
732
|
}
|
|
708
733
|
async clickRenameButton() {
|
|
734
|
+
await (0, test_1.expect)(this.renameBtn).toBeVisible();
|
|
709
735
|
await this.renameBtn.click();
|
|
710
736
|
}
|
|
711
737
|
async clickDeleteAndConfirmButton() {
|
|
@@ -713,9 +739,11 @@ class UiBaseLocators {
|
|
|
713
739
|
await this.clickConfirmToDeleteButton();
|
|
714
740
|
}
|
|
715
741
|
async clickDeleteButton() {
|
|
742
|
+
await (0, test_1.expect)(this.deleteBtn).toBeVisible();
|
|
716
743
|
await this.deleteBtn.click();
|
|
717
744
|
}
|
|
718
745
|
async clickQueryBuilderButton() {
|
|
746
|
+
await (0, test_1.expect)(this.queryBuilderBtn).toBeVisible();
|
|
719
747
|
await this.queryBuilderBtn.click();
|
|
720
748
|
}
|
|
721
749
|
async chooseRootContentInQueryBuilder(contentName) {
|
|
@@ -723,7 +751,7 @@ class UiBaseLocators {
|
|
|
723
751
|
await this.chooseRootContentBtn.click();
|
|
724
752
|
await (0, test_1.expect)(this.page.getByText(contentName)).toBeVisible();
|
|
725
753
|
await this.page.getByText(contentName).click();
|
|
726
|
-
await this.
|
|
754
|
+
await this.clickChooseButton();
|
|
727
755
|
}
|
|
728
756
|
async reorderTwoGroups() {
|
|
729
757
|
const firstGroup = this.typeGroups.nth(0);
|
|
@@ -736,9 +764,11 @@ class UiBaseLocators {
|
|
|
736
764
|
return { firstGroupValue, secondGroupValue };
|
|
737
765
|
}
|
|
738
766
|
async clickAllowedChildNodesButton() {
|
|
767
|
+
await (0, test_1.expect)(this.allowedChildNodesModal.locator(this.chooseBtn)).toBeVisible();
|
|
739
768
|
await this.allowedChildNodesModal.locator(this.chooseBtn).click();
|
|
740
769
|
}
|
|
741
770
|
async clickConfigureAsACollectionButton() {
|
|
771
|
+
await (0, test_1.expect)(this.configureAsACollectionBtn).toBeVisible();
|
|
742
772
|
await this.configureAsACollectionBtn.click();
|
|
743
773
|
}
|
|
744
774
|
async doesReturnedItemsHaveCount(itemCount) {
|
|
@@ -761,15 +791,18 @@ class UiBaseLocators {
|
|
|
761
791
|
}
|
|
762
792
|
}
|
|
763
793
|
async clickRemoveTabWithName(name) {
|
|
794
|
+
await (0, test_1.expect)(this.page.locator('uui-tab').filter({ hasText: name })).toBeVisible();
|
|
764
795
|
await this.page.locator('uui-tab').filter({ hasText: name }).hover();
|
|
765
796
|
const removeTabWithNameLocator = this.page.locator('uui-tab').filter({ hasText: name }).locator('[label="Remove"]');
|
|
766
797
|
await (0, test_1.expect)(removeTabWithNameLocator).toBeVisible();
|
|
767
798
|
await removeTabWithNameLocator.click();
|
|
768
799
|
}
|
|
769
800
|
async clickLeftArrowButton() {
|
|
801
|
+
await (0, test_1.expect)(this.leftArrowBtn).toBeVisible();
|
|
770
802
|
await this.leftArrowBtn.click();
|
|
771
803
|
}
|
|
772
804
|
async clickToUploadButton() {
|
|
805
|
+
await (0, test_1.expect)(this.clickToUploadBtn).toBeVisible();
|
|
773
806
|
await this.clickToUploadBtn.click();
|
|
774
807
|
}
|
|
775
808
|
async uploadFile(filePath) {
|
|
@@ -788,9 +821,11 @@ class UiBaseLocators {
|
|
|
788
821
|
await (0, test_1.expect)(this.failedStateButton).toBeVisible();
|
|
789
822
|
}
|
|
790
823
|
async clickContainerSaveAndPublishButton() {
|
|
824
|
+
await (0, test_1.expect)(this.containerSaveAndPublishBtn).toBeVisible();
|
|
791
825
|
await this.containerSaveAndPublishBtn.click();
|
|
792
826
|
}
|
|
793
827
|
async clickConfirmTrashButton() {
|
|
828
|
+
await (0, test_1.expect)(this.confirmTrashBtn).toBeVisible();
|
|
794
829
|
await this.confirmTrashBtn.click();
|
|
795
830
|
}
|
|
796
831
|
async reloadRecycleBin(containsItems = true) {
|
|
@@ -844,9 +879,11 @@ class UiBaseLocators {
|
|
|
844
879
|
await (0, test_1.expect)(this.page.getByRole('tab', { name: sectionName })).toBeVisible({ visible: isVisible });
|
|
845
880
|
}
|
|
846
881
|
async clickMediaCardWithName(name) {
|
|
882
|
+
await (0, test_1.expect)(this.mediaCardItems.filter({ hasText: name }).locator('umb-icon')).toBeVisible();
|
|
847
883
|
await this.mediaCardItems.filter({ hasText: name }).locator('umb-icon').click();
|
|
848
884
|
}
|
|
849
885
|
async clickChooseContentStartNodeButton() {
|
|
886
|
+
await (0, test_1.expect)(this.chooseDocumentInputBtn).toBeVisible();
|
|
850
887
|
await this.chooseDocumentInputBtn.click();
|
|
851
888
|
}
|
|
852
889
|
async clickChooseMediaStartNodeButton() {
|
|
@@ -854,41 +891,52 @@ class UiBaseLocators {
|
|
|
854
891
|
await this.chooseMediaInputBtn.click();
|
|
855
892
|
}
|
|
856
893
|
async clickActionsButton() {
|
|
894
|
+
await (0, test_1.expect)(this.actionsBtn).toBeVisible();
|
|
857
895
|
await this.actionsBtn.click();
|
|
858
896
|
}
|
|
859
897
|
async clickReferenceNodeLinkWithName(name) {
|
|
898
|
+
await (0, test_1.expect)(this.page.locator('[name="' + name + '"] a#open-part')).toBeVisible();
|
|
860
899
|
await this.page.locator('[name="' + name + '"] a#open-part').click();
|
|
861
900
|
}
|
|
862
901
|
async clickLinkWithName(name) {
|
|
902
|
+
await (0, test_1.expect)(this.page.getByRole('link', { name: name })).toBeVisible();
|
|
863
903
|
await this.page.getByRole('link', { name: name }).click();
|
|
864
904
|
}
|
|
865
905
|
async clickMediaPickerModalSubmitButton() {
|
|
906
|
+
await (0, test_1.expect)(this.mediaPickerModalSubmitBtn).toBeVisible();
|
|
866
907
|
await this.mediaPickerModalSubmitBtn.click();
|
|
867
908
|
}
|
|
868
909
|
async selectMediaWithName(mediaName) {
|
|
910
|
+
await (0, test_1.expect)(this.mediaCardItems.filter({ hasText: mediaName })).toBeVisible();
|
|
869
911
|
await this.mediaCardItems.filter({ hasText: mediaName }).click({ position: { x: 0.5, y: 0.5 } });
|
|
870
912
|
}
|
|
871
913
|
async clickCreateModalButton() {
|
|
914
|
+
await (0, test_1.expect)(this.createModalBtn).toBeVisible();
|
|
872
915
|
await this.createModalBtn.click();
|
|
873
916
|
}
|
|
874
917
|
async clickMediaCaptionAltTextModalSubmitButton() {
|
|
918
|
+
await (0, test_1.expect)(this.mediaCaptionAltTextModalSubmitBtn).toBeVisible();
|
|
875
919
|
await this.mediaCaptionAltTextModalSubmitBtn.click();
|
|
876
920
|
}
|
|
877
921
|
// Embed Modal
|
|
878
922
|
async enterEmbeddedURL(value) {
|
|
923
|
+
await (0, test_1.expect)(this.embeddedURLTxt).toBeVisible();
|
|
879
924
|
await this.embeddedURLTxt.clear();
|
|
880
925
|
await this.embeddedURLTxt.fill(value);
|
|
881
926
|
}
|
|
882
927
|
async clickEmbeddedRetrieveButton() {
|
|
928
|
+
await (0, test_1.expect)(this.embeddedRetrieveBtn).toBeVisible();
|
|
883
929
|
await this.embeddedRetrieveBtn.click();
|
|
884
930
|
}
|
|
885
931
|
async clickEmbeddedMediaModalConfirmButton() {
|
|
932
|
+
await (0, test_1.expect)(this.embeddedMediaModalConfirmBtn).toBeVisible();
|
|
886
933
|
await this.embeddedMediaModalConfirmBtn.click();
|
|
887
934
|
}
|
|
888
935
|
async waitForEmbeddedPreviewVisible() {
|
|
889
936
|
await (0, test_1.expect)(this.embeddedPreview).toBeVisible();
|
|
890
937
|
}
|
|
891
938
|
async isSubmitButtonDisabled() {
|
|
939
|
+
await (0, test_1.expect)(this.submitBtn).toBeVisible();
|
|
892
940
|
await (0, test_1.expect)(this.submitBtn).toHaveAttribute('disabled');
|
|
893
941
|
}
|
|
894
942
|
async doesMediaHaveThumbnail(mediaId, thumbnailIconName, thumbnailImage) {
|