@umbraco/playwright-testhelpers
Version:
Test helpers for making playwright tests for Umbraco solutions
176 lines (175 loc) • 20 kB
TypeScript
import { ApiHelpers } from "./ApiHelpers";
export declare class DataTypeApiHelper {
api: ApiHelpers;
constructor(api: ApiHelpers);
get(id: string): Promise<any>;
create(name: string, editorAlias: string, editorUiAlias: string, values: {
alias: string;
value: string;
}[], parentId?: string, id?: string): Promise<string | undefined>;
update(id: string, dataType: any): Promise<import("playwright-core").APIResponse>;
delete(id: string): Promise<import("playwright-core").APIResponse>;
getAllAtRoot(): Promise<import("playwright-core").APIResponse>;
doesExist(id: string): Promise<boolean>;
getItems(ids: string[]): Promise<any>;
getByName(name: string): Promise<any>;
ensureNameNotExists(name: string): Promise<import("playwright-core").APIResponse | null>;
doesNameExist(name: string): Promise<any>;
moveToFolder(dataTypeId: string, folderId: string): Promise<import("playwright-core").APIResponse>;
copyToFolder(dataTypeId: string, folderId: string): Promise<string | undefined>;
getFolder(id: string): Promise<any>;
createFolder(name: string, parentId?: string, id?: string): Promise<string | undefined>;
renameFolder(id: string, name: string): Promise<import("playwright-core").APIResponse>;
deleteFolder(id: string): Promise<import("playwright-core").APIResponse>;
doesFolderExist(id: string): Promise<boolean>;
getChildren(id: string): Promise<any>;
private recurseDeleteChildren;
private recurseChildren;
save(dataType: any): Promise<string | undefined>;
createDefaultDateTimeDataType(name: string): Promise<string | undefined>;
createCheckboxListDataType(name: string, options?: string[]): Promise<string | undefined>;
createContentPickerDataTypeWithStartNode(name: string, startNodeId: string): Promise<string | undefined>;
createContentPickerDataTypeWithShowOpenButton(name: string): Promise<string | undefined>;
createContentPickerDataTypeWithIgnoreUserStartNodes(name: string, startNodeId: string): Promise<string | undefined>;
createDateTimeDataTypeWithDateFormat(name: string, dateFormat: string): Promise<string | undefined>;
createDropdownDataType(name: string, isMultiple: boolean, options: string[]): Promise<string | undefined>;
createEmptyBlockListDataType(name: string): Promise<string | undefined>;
createBlockListDataTypeWithABlock(name: string, contentElementTypeId: string): Promise<string | undefined>;
createBlockListDataTypeWithContentAndSettingsElementType(name: string, contentElementTypeId: string, settingsElementTypeId: string): Promise<string | undefined>;
createBlockListDataTypeWithMinAndMaxAmount(name: string, minAmount?: number, maxAmount?: number): Promise<string | undefined>;
createBlockListDataTypeWithSingleBlockMode(name: string, enabled: boolean): Promise<string | undefined>;
createBlockListDataTypeWithLiveEditingMode(name: string, enabled: boolean): Promise<string | undefined>;
createBlockListDataTypeWithInlineEditingMode(name: string, enabled: boolean): Promise<string | undefined>;
createBlockListDataTypeWithPropertyEditorWidth(name: string, width: string): Promise<string | undefined>;
createBlockListWithBlockWithEditorAppearance(name: string, elementTypeId: string, label?: string, overlaySize?: string): Promise<string | undefined>;
createBlockListWithBlockWithCatalogueAppearance(name: string, elementTypeId: string, backgroundColor?: string, iconColor?: string, customStylesheet?: string): Promise<string | undefined>;
createBlockListWithBlockWithHideContentEditor(name: string, elementTypeId: string, hideContentEditor: boolean): Promise<string | undefined>;
isSingleBlockModeEnabledForBlockList(blockListName: string, enabled: boolean): Promise<boolean>;
isInlineEditingModeEnabledForBlockList(blockListName: string, enabled: boolean): Promise<boolean>;
createEmptyBlockGrid(blockGridName: string): Promise<string | undefined>;
createBlockGridWithABlock(blockGridName: string, contentElementTypeId: string): Promise<string | undefined>;
createBlockGridWithABlockInAGroup(blockGridName: string, contentElementTypeId: string, groupName: string): Promise<string | undefined>;
createBlockGridWithMinAndMaxAmount(blockGridName: string, minAmount?: number, maxAmount?: number): Promise<string | undefined>;
createBlockGridWithLiveEditingMode(blockGridName: string, enabled: boolean): Promise<string | undefined>;
createBlockGridWithPropertyEditorWidth(blockGridName: string, width: string): Promise<string | undefined>;
createBlockGridWithCreateButtonLabel(blockGridName: string, label?: string): Promise<string | undefined>;
createBlockGridWithGridColumns(blockGridName: string, columns?: number): Promise<string | undefined>;
createBlockGridWithLayoutStylesheet(blockGridName: string, stylesheetName: string): Promise<string | undefined>;
createBlockGridWithAnAreaInABlock(blockGridName: string, contentElementTypeId: string, areaAlias?: string, createButtonLabel?: string, columnSpan?: number, rowSpan?: number, minAllowed?: number, maxAllowed?: number): Promise<string | undefined>;
createBlockGridWithAnAreaInABlockWithAllowInAreas(blockGridName: string, contentElementTypeId: string, areaAlias?: string, allowInAreas?: boolean, createButtonLabel?: string, columnSpan?: number, rowSpan?: number, minAllowed?: number, maxAllowed?: number): Promise<string | undefined>;
createBlockGridWithAnAreaInABlockWithAllowInAreasAndASecondBlock(blockGridName: string, contentElementTypeId: string, secondContentElementTypeId: string, areaAlias?: string, allowInAreas?: boolean, createButtonLabel?: string, columnSpan?: number, rowSpan?: number, minAllowed?: number, maxAllowed?: number, secondBlockAllowAtRoot?: boolean, secondBlockAllowInAreas?: boolean): Promise<string | undefined>;
createBlockGridWithAnAreaInABlockWithACreateLabel(blockGridName: string, contentElementTypeId: string, createButtonLabel?: string, areaAlias?: string): Promise<string | undefined>;
createBlockGridWithAnAreaInABlockWithColumnSpanAndRowSpan(blockGridName: string, contentElementTypeId: string, columnSpan?: number, rowSpan?: number, areaAlias?: string, createButtonLabel?: string): Promise<string | undefined>;
createBlockGridWithAnAreaInABlockWithMinAndMaxAllowed(blockGridName: string, contentElementTypeId: string, secondContentElementTypeId: string, minAllowed?: number, maxAllowed?: number, areaAlias?: string, createButtonLabel?: string): Promise<string | undefined>;
createBlockGridWithAdvancedSettingsInBlock(blockGridName: string, contentElementTypeId: string, customViewPath?: string, customStylesheetPath?: string, overlaySize?: string, inlineEditing?: boolean, hideContentEditor?: boolean): Promise<string | undefined>;
createBlockGridWithCatalogueAppearanceInBlock(blockGridName: string, contentElementTypeId: string, backgroundColor?: string, iconColor?: string, thumbnail?: string): Promise<string | undefined>;
createBlockGridWithContentAndSettingsElementType(blockGridName: string, contentElementTypeId: string, settingsElementTypeId: string, allowAtRoot?: boolean): Promise<string | undefined>;
createBlockGridWithLabel(blockGridName: string, contentElementTypeId: string, label: string, allowAtRoot?: boolean): Promise<string | undefined>;
createBlockGridWithPermissions(blockGridName: string, contentElementTypeId: string, toAllowInRoot?: boolean, toAllowInAreas?: boolean): Promise<string | undefined>;
createBlockGridWithSizeOptions(blockGridName: string, contentElementTypeId: string, columnSpans?: number, minRowSpan?: number, maxRowSpan?: number): Promise<string | undefined>;
createBlockGridWithABlockWithInlineEditingModeAndABlockWithAnArea(blockGridName: string, firstBlockElementTypeId: string, inlineEditing: boolean, secondBlockElementTypeId: string, areaAlias?: string): Promise<string | undefined>;
getBlockGridAreaKeyFromBlock(blockGridName: string, elementTypeKey: string, areaAlias: string): Promise<any>;
doesBlockEditorContainBlocksWithContentTypeIds(blockEditorName: string, elementTypeIds: string[]): Promise<boolean>;
doesBlockEditorContainBlocksWithSettingsTypeIds(blockEditorName: string, elementTypeIds: string[]): Promise<boolean>;
isLiveEditingModeEnabledForBlockEditor(blockEditorName: string, enabled: boolean): Promise<boolean>;
doesMaxPropertyContainWidthForBlockEditor(blockEditorName: string, width: string): Promise<boolean>;
doesBlockEditorBlockContainLabel(blockName: string, elementTypeKey: string, label: string): Promise<boolean>;
doesBlockGridGroupContainCorrectBlocks(blockGridName: string, groupName: string, elementTypeIds: string[]): Promise<boolean>;
doesBlockGridContainCreateButtonLabel(blockGridName: string, label: string): Promise<boolean>;
doesBlockGridContainGridColumns(blockGridName: string, columns: number): Promise<boolean>;
doesBlockEditorBlockHaveAllowInRootEnabled(blockGridName: string, elementTypeKey: string): Promise<any>;
doesBlockEditorBlockHaveAllowInAreasEnabled(blockGridName: string, elementTypeKey: string): Promise<any>;
doesBlockEditorBlockContainColumnSpanOptions(blockGridName: string, elementTypeKey: string, expectedColumnSpans: number[]): Promise<any>;
doesBlockEditorBlockContainRowSpanOptions(blockGridName: string, elementTypeKey: string, minRowSpan: number, maxRowSpan: number): Promise<boolean>;
doesBlockEditorBlockContainAreaGridColumns(blockGridName: string, elementTypeKey: string, areaGridColumns: number): Promise<boolean>;
doesBlockEditorBlockContainAreaWithAlias(blockGridName: string, elementTypeKey: string, areaAlias?: string): Promise<any>;
doesBlockEditorBlockContainAreaCount(blockGridName: string, elementTypeKey: string, areaCount: number): Promise<boolean>;
doesBlockEditorBlockContainAreaWithCreateButtonLabel(blockGridName: string, elementTypeKey: string, areaAlias: string | undefined, createButtonLabel: string): Promise<any>;
doesBlockEditorBlockContainAreaWithMinAllowed(blockGridName: string, elementTypeKey: string, areaAlias: string | undefined, minAllowed: number): Promise<any>;
doesBlockEditorBlockContainAreaWithMaxAllowed(blockGridName: string, elementTypeKey: string, areaAlias: string | undefined, maxAllowed: number): Promise<any>;
doesBlockEditorBlockContainStylesheet(blockGridName: string, elementTypeKey: string, stylesheetPath: string): Promise<boolean>;
doesBlockEditorBlockContainOverlaySize(blockGridName: string, elementTypeKey: string, overlaySize: string): Promise<boolean>;
doesBlockEditorBlockContainInlineEditing(blockGridName: string, elementTypeKey: string, inlineEditing: boolean): Promise<boolean>;
doesBlockEditorBlockContainHideContentEditor(blockGridName: string, elementTypeKey: string, hideContentEditor: boolean): Promise<boolean>;
doesBlockEditorBlockContainBackgroundColor(blockGridName: string, elementTypeKey: string, backgroundColor: string): Promise<boolean>;
doesBlockEditorBlockContainIconColor(blockGridName: string, elementTypeKey: string, iconColor: string): Promise<boolean>;
doesBlockEditorBlockContainThumbnail(blockGridName: string, elementTypeKey: string, thumbnail: string): Promise<boolean>;
getBlockWithContentElementTypeId(blockGridName: string, contentElementTypeKey: string): Promise<any>;
createImageCropperDataTypeWithOneCrop(name: string, cropLabel: string, cropWidth: number, cropHeight: number): Promise<string | undefined>;
createMediaPickerDataTypeWithStartNodeId(name: string, startNodeId: string): Promise<string | undefined>;
createRadioboxDataType(name: string, options?: string[]): Promise<string | undefined>;
createImageMediaPickerDataType(name: string, minValue?: number, maxValue?: number, enableLocalFocalPoint?: boolean, ignoreUserStartNodes?: boolean): Promise<string | undefined>;
createImageMediaPickerDataTypeWithStartNodeId(name: string, startNodeId: string): Promise<string | undefined>;
createImageMediaPickerDataTypeWithCrop(name: string, label: string, width: number, height: number): Promise<string | undefined>;
createTextareaDataType(name: string, maxChars?: number, rows?: number, minHeight?: number, maxHeight?: number): Promise<string | undefined>;
createTextstringDataType(name: string, maxChars?: number): Promise<string | undefined>;
createTrueFalseDataTypeWithInitialState(name: string): Promise<string | undefined>;
createTrueFalseDataTypeWithLabelOn(name: string, labelOn: string): Promise<string | undefined>;
createTrueFalseDataTypeWithLabelOff(name: string, labelOff: string): Promise<string | undefined>;
createEmailAddressDataType(name: string): Promise<string | undefined>;
createCodeEditorDataType(name: string): Promise<string | undefined>;
createMarkdownEditorDataType(name: string): Promise<string | undefined>;
createDecimalDataType(name: string): Promise<string | undefined>;
createMultipleTextStringDataType(name: string): Promise<string | undefined>;
createSliderDataType(name: string): Promise<string | undefined>;
createListViewContentDataType(name?: string): Promise<string | undefined>;
createListViewContentDataTypeWithAllPermissions(name?: string): Promise<string | undefined>;
updateListViewMediaDataType(alias: string, newValue: any): Promise<import("playwright-core").APIResponse>;
createDefaultTiptapDataType(name: string): Promise<string | undefined>;
createTipTapDataTypeWithABlock(name: string, contentElementTypeKey: string): Promise<string | undefined>;
createApprovedColorDataTypeWithOneItem(name: string, itemLabel: string, itemValue: string): Promise<string | undefined>;
getTiptapExtensionsCount(tipTapName: string): Promise<any>;
getTiptapToolbarGroupInRowCount(tipTapName: string, rowIndex?: number): Promise<any>;
getTiptapToolbarGroupValueInRow(tipTapName: string, groupIndex: number, rowIndex?: number): Promise<any>;
getTiptapToolbarRowCount(tipTapName: string): Promise<any>;
createDefaultTinyMCEDataType(name: string): Promise<string | undefined>;
getTinyMCEToolbarItemsCount(tinyMCEName: string): Promise<any>;
doesTinyMCEToolbarItemsMatchCount(tinyMCEName: string, count: number): Promise<boolean>;
doesTinyMCEToolbarHaveItems(tinyMCEName: string, items: string[]): Promise<boolean>;
createTiptapDataTypeWithTwoToolbarRows(name: string): Promise<string | undefined>;
createTinyMCEDataTypeWithStylesheet(name: string, stylesheetPath: string): Promise<string | undefined>;
createBlockGridWithABlockAndAllowAtRoot(blockGridName: string, contentElementTypeId: string, allowAtRoot?: boolean): Promise<string | undefined>;
createBlockGridWithABlockAndMinAndMaxAmount(blockGridName: string, contentElementTypeId: string, minAmount?: number, maxAmount?: number): Promise<string | undefined>;
createBlockGridWithABlockAndCreateButtonLabel(blockGridName: string, contentElementTypeId: string, label?: string): Promise<string | undefined>;
createBlockGridWithABlockAndGridColumns(blockGridName: string, contentElementTypeId: string, gridColumns: number): Promise<string | undefined>;
createBlockListWithABlockAndMinAndMaxAmount(blockListName: string, contentElementTypeId: string, minAmount?: number, maxAmount?: number): Promise<string | undefined>;
createBlockListDataTypeWithLabel(blockListName: string, contentElementTypeId: string, label: string): Promise<string | undefined>;
doesBlockGridContainLayoutStylesheet(blockGridName: string, stylesheetName: string): Promise<boolean>;
createRichTextEditorWithABlock(richTextEditorName: string, contentElementTypeId: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettings(richTextEditorName: string, contentElementTypeId: string, label?: string, backgroundColor?: string, iconColor?: string, thumbnail?: string, editorSize?: string, settingsElementTypeId?: string, displayInline?: boolean): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingEditorSize(richTextEditorName: string, contentElementTypeId: string, editorSize: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingLabel(richTextEditorName: string, contentElementTypeId: string, label: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingBackgroundColor(richTextEditorName: string, contentElementTypeId: string, backgroundColor: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingIconColor(richTextEditorName: string, contentElementTypeId: string, iconColor: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingThumbnail(richTextEditorName: string, contentElementTypeId: string, thumbnail: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingSettingsElementTypeKey(richTextEditorName: string, contentElementTypeId: string, settingsElementTypeId: string): Promise<string | undefined>;
createRichTextEditorWithABlockWithBlockSettingDisplayInline(richTextEditorName: string, contentElementTypeId: string, displayInline: boolean): Promise<string | undefined>;
doesDataTypeHaveValue(dataTypeName: string, alias: string, value?: any, dataTypeData?: any): Promise<boolean>;
doesApprovedColorHaveColor(dataTypeName: string, color: string): Promise<any>;
createUploadDataType(name: string, fileExtensions?: string[]): Promise<string | undefined>;
createDefaultApprovedColorDataType(name: string): Promise<string | undefined>;
createDefaultContentPickerDataType(name: string): Promise<string | undefined>;
createDefaultDropdownDataType(name: string): Promise<string | undefined>;
createDefaultLabelDataType(name: string): Promise<string | undefined>;
createDefaultMediaPickerDataType(name: string): Promise<string | undefined>;
doesMediaPickerHaveMinAndMaxAmount(dataTypeName: string, min: number, max: number): Promise<boolean>;
doesDataTypeHaveCrops(dataTypeName: string, cropLabel: string, cropAlias: string, cropWidth: number, cropHeight: number): Promise<any>;
doesRTEHaveDimensions(dataTypeName: string, width: number, height: number): Promise<boolean>;
doesTiptapExtensionsItemsMatchCount(tiptapName: string, count: number): Promise<boolean>;
doesTiptapExtensionsHaveItems(tiptapName: string, items: string[]): Promise<boolean>;
doesTiptapToolbarHaveItems(tiptapName: string, items: any): Promise<boolean>;
doesRTEContainBlocks(dataTypeName: string, elementTypeIds: string[]): Promise<boolean>;
createDefaultImageCropperDataType(name: string): Promise<string | undefined>;
doesListViewHaveProperty(dataTypeName: string, header: string, alias: string, isSystem?: any): Promise<any>;
doesListViewHaveLayout(dataTypeName: string, name: string, icon: string, collectionView: string): Promise<any>;
createDefaultMultiUrlPickerDataType(name: string): Promise<string | undefined>;
createDefaultNumericDataType(name: string): Promise<string | undefined>;
createDefaultTagsDataType(name: string): Promise<string | undefined>;
createDefaultTrueFalseDataType(name: string): Promise<string | undefined>;
createBlockListDataTypeWithInlineEditingModeAndABlock(blockListName: string, contentElementTypeId: string, inlineEditing?: boolean): Promise<string | undefined>;
createBlockGridWithABlockWithInlineEditingMode(blockGridName: string, contentElementTypeId: string, inlineEditing?: boolean): Promise<string | undefined>;
createTiptapDataTypeWithWordCountStatusbar(name: string): Promise<string | undefined>;
createTiptapDataTypeWithElementPathStatusbar(name: string): Promise<string | undefined>;
createTiptapDataTypeWithStyleSelect(name: string): Promise<string | undefined>;
createMultiNodeTreePickerDataTypeWithAllowedTypes(name: string, allowedTypeIds: string, startNodeType?: string): Promise<string | undefined>;
}