UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

433 lines (432 loc) 24.7 kB
import { Page, Locator } from "@playwright/test"; import { UiBaseLocators } from "./UiBaseLocators"; export declare class ContentUiHelper extends UiBaseLocators { private readonly contentNameTxt; private readonly saveAndPublishBtn; private readonly publishBtn; private readonly unpublishBtn; private readonly actionMenuForContentBtn; private readonly openedModal; private readonly textstringTxt; private readonly infoTab; private readonly linkContent; private readonly historyItems; private readonly generalItem; private readonly documentState; private readonly createdDate; private readonly editDocumentTypeBtn; private readonly addTemplateBtn; private readonly id; private readonly cultureAndHostnamesBtn; private readonly cultureLanguageDropdownBox; private readonly addNewDomainBtn; private readonly domainTxt; private readonly domainLanguageDropdownBox; private readonly deleteDomainBtn; private readonly reloadChildrenThreeDotsBtn; private readonly contentTree; private readonly richTextAreaTxt; private readonly textAreaTxt; private readonly plusIconBtn; private readonly enterTagTxt; private readonly menuItemTree; private readonly domainComboBox; private readonly confirmToUnpublishBtn; private readonly saveModalBtn; private readonly dropdown; private readonly setADateTxt; private readonly chooseMediaPickerBtn; private readonly chooseMemberPickerBtn; private readonly numericTxt; private readonly resetFocalPointBtn; private readonly addMultiURLPickerBtn; private readonly linkTxt; private readonly anchorQuerystringTxt; private readonly linkTitleTxt; private readonly tagItems; private readonly removeFilesBtn; private readonly toggleBtn; private readonly toggleInput; private readonly documentTypeWorkspace; private readonly addMultipleTextStringBtn; private readonly multipleTextStringValueTxt; private readonly markdownTxt; private readonly codeEditorTxt; private readonly sliderInput; private readonly tabItems; private readonly documentWorkspace; private readonly searchTxt; private readonly selectAVariantBtn; private readonly variantAddModeBtn; private readonly saveAndCloseBtn; private readonly enterNameInContainerTxt; private readonly listView; private readonly nameBtn; private readonly listViewTableRow; private readonly publishSelectedListItems; private readonly unpublishSelectedListItems; private readonly duplicateToSelectedListItems; private readonly moveToSelectedListItems; private readonly trashSelectedListItems; private readonly modalContent; private readonly trashBtn; private readonly documentListView; private readonly documentGridView; private readonly documentTreeItem; private readonly documentLanguageSelect; private readonly documentLanguageSelectPopover; private readonly documentReadOnly; private readonly documentWorkspaceEditor; private readonly documentBlueprintModal; private readonly documentBlueprintModalEnterNameTxt; private readonly documentBlueprintSaveBtn; private readonly exactTrashBtn; private readonly emptyRecycleBinBtn; private readonly confirmEmptyRecycleBinBtn; private readonly duplicateToBtn; private readonly moveToBtn; private readonly duplicateBtn; private readonly contentTreeRefreshBtn; private readonly sortChildrenBtn; private readonly rollbackBtn; private readonly rollbackContainerBtn; private readonly publicAccessBtn; private readonly uuiCheckbox; private readonly sortBtn; private readonly containerSaveBtn; private readonly groupBasedProtectionBtn; private readonly nextBtn; private readonly chooseMemberGroupBtn; private readonly selectLoginPageDocument; private readonly selectErrorPageDocument; private readonly rollbackItem; private readonly actionsMenu; private readonly linkToDocumentBtn; private readonly linkToMediaBtn; private readonly linkToManualBtn; private readonly umbDocumentCollection; private readonly documentTableColumnName; private readonly addBlockElementBtn; private readonly formValidationMessage; private readonly blockName; private readonly addBlockSettingsTabBtn; private readonly editBlockEntryBtn; private readonly copyBlockEntryBtn; private readonly deleteBlockEntryBtn; private readonly blockGridEntry; private readonly blockListEntry; private readonly tipTapPropertyEditor; private readonly tipTapEditor; private readonly uploadedSvgThumbnail; private readonly linkPickerModal; private readonly pasteFromClipboardBtn; private readonly pasteBtn; private readonly closeBtn; private readonly workspaceEditTab; private readonly workspaceEditProperties; private readonly exactCopyBtn; private readonly openActionsMenu; private readonly replaceExactBtn; private readonly clipboardEntryPicker; private readonly blockWorkspaceEditTab; private readonly insertBlockBtn; private readonly blockWorkspace; private readonly saveContentBtn; private readonly splitView; private readonly tiptapInput; private readonly rteBlockInline; private readonly backofficeModalContainer; private readonly rteBlock; private readonly workspaceActionMenu; private readonly workspaceActionMenuItem; private readonly viewMoreOptionsBtn; private readonly schedulePublishBtn; private readonly schedulePublishModalBtn; private readonly documentScheduleModal; private readonly publishAtFormLayout; private readonly unpublishAtFormLayout; private readonly publishAtValidationMessage; private readonly unpublishAtValidationMessage; private readonly lastPublished; private readonly publishAt; private readonly blockGridAreasContainer; private readonly blockGridBlock; private readonly blockGridEntries; private readonly inlineCreateBtn; private readonly removeAt; private readonly selectAllCheckbox; private readonly confirmToPublishBtn; private readonly tiptapStatusbarWordCount; private readonly tiptapStatusbarElementPath; private readonly publishWithDescendantsBtn; private readonly documentPublishWithDescendantsModal; private readonly includeUnpublishedDescendantsToggle; private readonly publishWithDescendantsModalBtn; private readonly documentVariantLanguagePicker; private readonly documentVariantLanguageItem; private readonly styleSelectBtn; private readonly cascadingMenuContainer; private readonly modalFormValidationMessage; private readonly treePickerSearchTxt; private readonly mediaPickerSearchTxt; private readonly memberPickerSearchTxt; constructor(page: Page); enterContentName(name: string): Promise<void>; clickSaveAndPublishButton(): Promise<void>; isSuccessStateVisibleForSaveAndPublishButton(isVisible?: boolean): Promise<void>; clickPublishButton(): Promise<void>; clickUnpublishButton(): Promise<void>; clickReloadChildrenThreeDotsButton(): Promise<void>; clickActionsMenuAtRoot(): Promise<void>; goToContentWithName(contentName: string): Promise<void>; clickActionsMenuForContent(name: string): Promise<void>; openContentCaretButtonForName(name: string): Promise<void>; clickCaretButtonForContentName(name: string): Promise<void>; waitForModalVisible(): Promise<void>; waitForModalHidden(): Promise<void>; clickSaveButtonForContent(): Promise<void>; enterTextstring(text: string): Promise<void>; doesContentTreeHaveName(contentName: string): Promise<void>; enterRichTextArea(value: string): Promise<void>; enterTextArea(value: string): Promise<void>; clickConfirmToUnpublishButton(): Promise<void>; clickCreateDocumentBlueprintButton(): Promise<void>; clickInfoTab(): Promise<void>; doesDocumentHaveLink(link: string): Promise<void>; doesHistoryHaveText(text: string): Promise<void>; doesDocumentStateHaveText(text: string): Promise<void>; doesCreatedDateHaveText(text: string): Promise<void>; doesIdHaveText(text: string): Promise<void>; clickEditDocumentTypeButton(): Promise<void>; clickAddTemplateButton(): Promise<void>; waitForContentToBeCreated(): Promise<void>; waitForContentToBeDeleted(): Promise<void>; waitForContentToBeRenamed(): Promise<void>; waitForDomainToBeCreated(): Promise<void>; waitForDomainToBeUpdated(): Promise<void>; waitForDomainToBeDeleted(): Promise<void>; waitForContentToBeTrashed(): Promise<void>; clickDocumentTypeByName(documentTypeName: string): Promise<void>; clickTemplateByName(templateName: string): Promise<void>; isDocumentTypeModalVisible(documentTypeName: string): Promise<void>; isTemplateModalVisible(templateName: string): Promise<void>; clickEditTemplateByName(templateName: string): Promise<void>; changeTemplate(oldTemplate: string, newTemplate: string): Promise<void>; isTemplateNameDisabled(templateName: string): Promise<void>; clickCultureAndHostnamesButton(): Promise<void>; selectCultureLanguageOption(option: string): Promise<void>; selectDomainLanguageOption(option: string, index?: number): Promise<void>; clickAddNewDomainButton(): Promise<void>; enterDomain(value: string, index?: number): Promise<void>; clickDeleteDomainButton(): Promise<void>; clickSaveModalButton(): Promise<void>; chooseDocumentType(documentTypeName: string): Promise<void>; clickApprovedColorByValue(value: string): Promise<void>; chooseCheckboxListOption(optionValue: string): Promise<void>; addContentPicker(contentName: string): Promise<void>; isOpenButtonVisibleInContentPicker(contentPickerName: string, isVisible?: boolean): Promise<void>; clickContentPickerOpenButton(contentPickerName: string): Promise<void>; isNodeOpenForContentPicker(contentPickerName: string): Promise<void>; isContentNameVisible(contentName: string, isVisible?: boolean): Promise<void>; isContentInTreeVisible(name: string, isVisible?: boolean): Promise<void>; isChildContentInTreeVisible(parentName: string, childName: string, isVisible?: boolean): Promise<void>; removeContentPicker(contentPickerName: string): Promise<void>; chooseDropdownOption(optionValues: string[]): Promise<void>; enterADate(date: string): Promise<void>; clickChooseMediaPickerButton(): Promise<void>; clickChooseButtonAndSelectMediaWithName(mediaName: string): Promise<void>; clickChooseButtonAndSelectMediaWithKey(mediaKey: string): Promise<void>; removeMediaPickerByName(mediaPickerName: string): Promise<void>; isMediaNameVisible(mediaName: string, isVisible?: boolean): Promise<void>; clickResetFocalPointButton(): Promise<void>; setFocalPoint(widthPercentage?: number, heightPercentage?: number): Promise<void>; clickChooseMemberPickerButton(): Promise<void>; selectMemberByName(memberName: string): Promise<void>; removeMemberPickerByName(memberName: string): Promise<void>; enterNumeric(number: number): Promise<void>; chooseRadioboxOption(optionValue: string): Promise<void>; clickPlusIconButton(): Promise<void>; enterTag(tagName: string): Promise<void>; removeTagByName(tagName: string): Promise<void>; clickAddMultiURLPickerButton(): Promise<void>; selectLinkByName(linkName: string): Promise<void>; enterLink(value: string, toPress?: boolean): Promise<void>; enterAnchorOrQuerystring(value: string, toPress?: boolean): Promise<void>; enterLinkTitle(value: string, toPress?: boolean): Promise<void>; removeUrlPickerByName(linkName: string): Promise<void>; clickEditUrlPickerButtonByName(linkName: string): Promise<void>; clickRemoveFilesButton(): Promise<void>; clickToggleButton(): Promise<void>; doesToggleHaveLabel(label: string): Promise<void>; clickAddMultipleTextStringButton(): Promise<void>; enterMultipleTextStringValue(value: string): Promise<void>; addMultipleTextStringItem(value: string): Promise<void>; enterCodeEditorValue(value: string): Promise<void>; enterMarkdownEditorValue(value: string): Promise<void>; changeSliderValue(value: string): Promise<void>; isDocumentTypeNameVisible(contentName: string, isVisible?: boolean): Promise<void>; doesModalHaveText(text: string): Promise<void>; isTabNameVisible(tabName: string): Promise<void>; doesDocumentHaveName(name: string): Promise<void>; doesDocumentTableColumnNameValuesMatch(expectedValues: string[]): Promise<void>; searchByKeywordInCollection(keyword: string): Promise<void>; clickSelectVariantButton(): Promise<void>; clickVariantAddModeButtonForLanguageName(language: string): Promise<void>; clickSaveAndCloseButton(): Promise<void>; clickCreateContentWithName(name: string): Promise<void>; enterNameInContainer(name: string): Promise<void>; goToContentInListViewWithName(contentName: string): Promise<void>; doesListViewHaveNoItemsInList(): Promise<void>; doesContentListHaveNoItemsInList(): Promise<void>; clickNameButtonInListView(): Promise<void>; doesFirstItemInListViewHaveName(name: string): Promise<void>; doesListViewContainCount(count: number): Promise<void>; selectContentWithNameInListView(name: string): Promise<void>; clickPublishSelectedListItems(): Promise<void>; clickUnpublishSelectedListItems(): Promise<void>; clickDuplicateToSelectedListItems(): Promise<void>; clickMoveToSelectedListItems(): Promise<void>; clickTrashSelectedListItems(): Promise<void>; selectDocumentWithNameAtRoot(name: string): Promise<void>; clickTrashButton(): Promise<void>; clickExactTrashButton(): Promise<void>; isDocumentListViewVisible(isVisible?: boolean): Promise<void>; isDocumentGridViewVisible(isVisible?: boolean): Promise<void>; changeDocumentSectionLanguage(newLanguageName: string): Promise<void>; doesDocumentSectionHaveLanguageSelected(languageName: string): Promise<void>; isDocumentReadOnly(isVisible?: boolean): Promise<void>; isDocumentNameInputEditable(isEditable?: boolean): Promise<void>; isActionsMenuForRecycleBinVisible(isVisible?: boolean): Promise<void>; isActionsMenuForRootVisible(isVisible?: boolean): Promise<void>; clickEmptyRecycleBinButton(): Promise<void>; clickConfirmEmptyRecycleBinButton(): Promise<void>; isDocumentPropertyEditable(propertyName: string, isEditable?: boolean): Promise<void>; doesDocumentPropertyHaveValue(propertyName: string, value: string): Promise<void>; clickContentTab(): Promise<void>; isDocumentTreeEmpty(): Promise<void>; doesDocumentWorkspaceContainName(name: string): Promise<void>; doesDocumentWorkspaceHaveText(text: string): Promise<void>; enterDocumentBlueprintName(name: string): Promise<void>; clickSaveDocumentBlueprintButton(): Promise<void>; clickDuplicateToButton(): Promise<void>; clickDuplicateButton(): Promise<void>; clickMoveToButton(): Promise<void>; moveToContentWithName(parentNames: string[], moveTo: string): Promise<void>; isCaretButtonVisibleForContentName(contentName: string, isVisible?: boolean): Promise<void>; reloadContentTree(): Promise<void>; clickSortChildrenButton(): Promise<void>; clickRollbackButton(): Promise<void>; clickRollbackContainerButton(): Promise<void>; clickLatestRollBackItem(): Promise<void>; clickPublicAccessButton(): Promise<void>; addGroupBasedPublicAccess(memberGroupName: string, documentName: string): Promise<void>; sortChildrenDragAndDrop(dragFromSelector: Locator, dragToSelector: Locator, verticalOffset?: number, horizontalOffset?: number, steps?: number): Promise<void>; clickSortButton(): Promise<void>; doesIndexDocumentInTreeContainName(parentName: string, childName: string, index: number): Promise<void>; selectMemberGroup(memberGroupName: string): Promise<void>; isPermissionInActionsMenuVisible(permissionName: string, isVisible?: boolean): Promise<void>; clickDocumentLinkButton(): Promise<void>; clickMediaLinkButton(): Promise<void>; clickManualLinkButton(): Promise<void>; clickAddBlockElementButton(): Promise<void>; clickAddBlockWithNameButton(name: string): Promise<void>; clickCreateForModalWithHeadline(headline: string): Promise<void>; isAddBlockElementButtonVisible(isVisible?: boolean): Promise<void>; isAddBlockElementButtonWithLabelVisible(blockName: string, label: string, isVisible?: boolean): Promise<void>; doesFormValidationMessageContainText(text: string): Promise<void>; doesBlockElementHaveName(name: string): Promise<void>; clickAddBlockSettingsTabButton(): Promise<void>; clickEditBlockGridBlockButton(): Promise<void>; clickDeleteBlockGridBlockButton(): Promise<void>; clickEditBlockListBlockButton(): Promise<void>; clickDeleteBlockListBlockButton(): Promise<void>; clickCopyBlockListBlockButton(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>; clickCopyBlockGridBlockButton(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>; clickPasteFromClipboardButtonForProperty(groupName: string, propertyName: string): Promise<void>; clickActionsMenuForProperty(groupName: string, propertyName: string): Promise<void>; clickAddBlockGridElementWithName(elementTypeName: string): Promise<void>; clickEditBlockListEntryWithName(blockListElementName: string): Promise<void>; clickSelectBlockElementWithName(elementTypeName: string): Promise<void>; clickSelectBlockElementInAreaWithName(elementTypeName: string): Promise<void>; clickBlockElementWithName(elementTypeName: string): Promise<void>; enterPropertyValue(propertyName: string, value: string): Promise<void>; doesBlockContainBlockInAreaWithName(blockWithAreaName: string, areaName: string, blockInAreaName: string, index?: number): Promise<void>; doesBlockContainBlockCountInArea(blockWithAreaName: string, areaName: string, blocksInAreaCount: number, index?: number): Promise<void>; doesBlockContainCountOfBlockInArea(blockWithAreaName: string, areaName: string, blockInAreaName: string, count: number, index?: number): Promise<void>; getBlockAtRootDataElementKey(blockName: string, index?: number): Promise<string | null>; getBlockAreaKeyFromParentBlockDataElementKey(parentKey: string, index?: number): Promise<string | null>; getBlockDataElementKeyInArea(parentBlockName: string, areaName: string, blockName: string, parentIndex?: number, childIndex?: number): Promise<string | null>; removeBlockFromArea(parentBlockName: string, areaName: string, blockName: string, parentIndex?: number, childIndex?: number): Promise<void>; doesBlockAreaContainColumnSpan(blockWithAreaName: string, areaName: string, columnSpan: number, index?: number): Promise<void>; doesBlockAreaContainRowSpan(blockWithAreaName: string, areaName: string, rowSpan: number, index?: number): Promise<void>; clickInlineAddToAreaButton(parentBlockName: string, areaName: string, parentIndex?: number, buttonIndex?: number): Promise<void>; addBlockToAreasWithExistingBlock(blockWithAreaName: string, areaName: string, parentIndex?: number, addToIndex?: number): Promise<void>; doesBlockGridBlockWithAreaContainCreateLabel(blockWithAreaName: string, createLabel: string, index?: number): Promise<void>; doesPropertyContainValue(propertyName: string, value: string): Promise<void>; clickCreateButtonForModalWithElementTypeNameAndGroupName(headlineName: string, groupName: string): Promise<void>; clickUpdateButtonForModalWithElementTypeNameAndGroupName(headlineName: string, groupName: string): Promise<void>; clickExactCopyButton(): Promise<void>; clickExactReplaceButton(): Promise<void>; doesClipboardHaveCopiedBlockWithName(contentName: string, propertyName: string, blockName: string, index?: number): Promise<void>; doesClipboardHaveCopiedBlocks(contentName: string, propertyName: string, index?: number): Promise<void>; doesClipboardContainCopiedBlocksCount(count: number): Promise<void>; selectClipboardEntryWithName(contentName: string, propertyName: string, blockName: string, index?: number): Promise<void>; selectClipboardEntriesWithName(contentName: string, propertyName: string, index?: number): Promise<void>; goToBlockGridBlockWithName(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>; goToBlockListBlockWithName(groupName: string, propertyName: string, blockName: string, index?: number): Promise<void>; doesBlockEditorBlockWithNameContainValue(groupName: string, propertyName: string, inputType: string | undefined, value: any): Promise<void>; clickCloseButton(): Promise<void>; clickPasteButton(): Promise<void>; doesBlockListPropertyHaveBlockAmount(groupName: string, propertyName: string, amount: number): Promise<void>; doesBlockGridPropertyHaveBlockAmount(groupName: string, propertyName: string, amount: number): Promise<void>; doesPropertyContainValidationMessage(groupName: string, propertyName: string, message: string): Promise<void>; clickInsertBlockButton(): Promise<void>; enterRTETipTapEditor(value: string): Promise<void>; enterRTETipTapEditorWithName(name: string, value: string): Promise<void>; clickTipTapToolbarIconWithTitle(iconTitle: string): Promise<void>; doesUploadedSvgThumbnailHaveSrc(imageSrc: string): Promise<void>; doesRichTextEditorBlockContainLabel(richTextEditorAlias: string, label: string): Promise<void>; doesBlockEditorModalContainEditorSize(editorSize: string, elementName: string): Promise<void>; doesBlockEditorModalContainInline(richTextEditorAlias: string, elementName: string): Promise<void>; doesBlockHaveBackgroundColor(elementName: string, backgroundColor: string): Promise<void>; doesBlockHaveIconColor(elementName: string, backgroundColor: string): Promise<void>; addDocumentDomain(domainName: string, languageName: string): Promise<void>; clickViewMoreOptionsButton(): Promise<void>; clickSchedulePublishButton(): Promise<void>; clickSchedulePublishModalButton(): Promise<void>; enterPublishTime(time: string, index?: number): Promise<void>; enterUnpublishTime(time: string, index?: number): Promise<void>; doesPublishAtValidationMessageContainText(text: string): Promise<void>; doesUnpublishAtValidationMessageContainText(text: string): Promise<void>; doesLastPublishedContainText(text: string): Promise<void>; doesPublishAtContainText(text: string): Promise<void>; doesRemoveAtContainText(text: string): Promise<void>; clickSelectAllCheckbox(): Promise<void>; doesSchedulePublishModalButtonContainDisabledTag(hasDisabledTag?: boolean): Promise<void>; clickInlineBlockCaretButtonForName(blockEditorName: string, index?: number): Promise<void>; doesTiptapHaveWordCount(count: number): Promise<void>; doesTiptapHaveCharacterCount(count: number): Promise<void>; clickTiptapWordCountButton(): Promise<void>; doesElementPathHaveText(text: string): Promise<void>; clickConfirmToPublishButton(): Promise<void>; clickPublishWithDescendantsButton(): Promise<void>; clickIncludeUnpublishedDescendantsToggle(): Promise<void>; clickPublishWithDescendantsModalButton(): Promise<void>; doesDocumentVariantLanguageItemHaveCount(count: number): Promise<void>; doesDocumentVariantLanguageItemHaveName(name: string): Promise<void>; clickSchedulePublishLanguageButton(languageName: string): Promise<void>; clickBlockCardWithName(name: string, toForce?: boolean): Promise<void>; clickStyleSelectButton(): Promise<void>; clickCascadingMenuItemWithName(name: string): Promise<void>; hoverCascadingMenuItemWithName(name: string): Promise<void>; selectAllRTETipTapEditorText(): Promise<void>; waitForContentToBePublished(): Promise<void>; waitForRecycleBinToBeEmptied(): Promise<void>; clearTipTapEditor(): Promise<void>; clickBlockElementInRTEWithName(elementTypeName: string): Promise<void>; doesModalFormValidationMessageContainText(text: string): Promise<void>; enterSearchKeywordInTreePickerModal(keyword: string): Promise<void>; enterSearchKeywordInMediaPickerModal(keyword: string): Promise<void>; enterSearchKeywordInMemberPickerModal(keyword: string): Promise<void>; isContentNameReadOnly(): Promise<void>; }