@umbraco/playwright-testhelpers
Version:
Test helpers for making playwright tests for Umbraco solutions
93 lines (92 loc) • 12.9 kB
TypeScript
import { ApiHelpers } from "./ApiHelpers";
export declare class DocumentApiHelper {
api: ApiHelpers;
constructor(api: ApiHelpers);
get(id: string): Promise<any>;
doesExist(id: string): Promise<boolean>;
create(document: any): Promise<string | undefined>;
delete(id: string): Promise<number | undefined>;
update(id: string, document: any): Promise<import("playwright-core").APIResponse | undefined>;
getAllAtRoot(): Promise<import("playwright-core").APIResponse>;
getChildren(id: string): Promise<any>;
getChildrenAmount(id: string): Promise<any>;
doesNameExist(name: string): Promise<any>;
private recurseDeleteChildren;
private recurseChildren;
getByName(name: string): Promise<any>;
ensureNameNotExists(name: string): Promise<void>;
publish(id: string, publishSchedulesData?: any): Promise<number | undefined>;
getDocumentUrl(id: string): Promise<any>;
moveToRecycleBin(id: string): Promise<number | undefined>;
createDefaultDocument(documentName: string, documentTypeId: string): Promise<string | undefined>;
createDocumentWithTextContent(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string): Promise<string | undefined>;
createDefaultDocumentWithParent(documentName: string, documentTypeId: string, parentId: string): Promise<string | undefined>;
createDocumentWithTemplate(documentName: string, documentTypeId: string, templateId: string): Promise<string | undefined>;
createDocumentWithContentPicker(documentName: string, documentTypeId: string, contentPickerId: string): Promise<string | undefined>;
createDocumentWithOneMediaPicker(documentName: string, documentTypeId: string, mediaPickerId: string): Promise<string | undefined>;
createDocumentWithTwoMediaPicker(documentName: string, documentTypeId: string, firstMediaPickerId: string, secondMediaPickerId: string, alias?: string): Promise<string | undefined>;
createDocumentWithMemberPicker(documentName: string, documentTypeId: string, memberId: string): Promise<string | undefined>;
createDocumentWithTags(documentName: string, documentTypeId: string, tagsName: string[]): Promise<string | undefined>;
createDocumentWithExternalLinkURLPicker(documentName: string, documentTypeId: string, link: string, linkTitle: string): Promise<string | undefined>;
getDomains(id: string): Promise<any>;
updateDomains(id: string, domains: any): Promise<import("playwright-core").APIResponse>;
createDocumentWithImageMediaPicker(documentName: string, documentTypeId: string, propertyAlias: string, mediaKey: string, focalPoint?: {
left: number;
top: number;
}): Promise<string | undefined>;
doesImageMediaPickerContainImage(id: string, propertyAlias: string, mediaKey: string): Promise<any>;
doesImageMediaPickerContainImageWithFocalPoint(id: string, propertyAlias: string, mediaKey: string, focalPoint: {
left: number;
top: number;
}): Promise<any>;
createDocumentWithUploadFile(documentName: string, documentTypeId: string, dataTypeName: string, uploadFileName: string, mineType: string): Promise<string | undefined>;
createDefaultDocumentWithEnglishCulture(documentName: string, documentTypeId: string): Promise<string | undefined>;
createDefaultDocumentWithCulture(documentName: string, documentTypeId: string, isoCode: string): Promise<string | undefined>;
createDocumentWithMultipleVariants(documentName: string, documentTypeId: string, dataTypeAlias: string, cultureVariants: {
isoCode: string;
name: string;
value: string;
}[]): Promise<string | undefined>;
createDocumentWithEnglishCultureAndTextContent(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string, varyByCultureForText?: boolean): Promise<string | undefined>;
createPublishedDocumentWithValue(documentName: string, value: any, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<string>;
isDocumentPublished(id: string): Promise<boolean>;
createPublishedDocumentWithImageCropper(documentName: string, cropValue: any, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string, focalPoint?: {
left: number;
top: number;
}): Promise<string>;
createPublishedDocumentWithUploadFile(documentName: string, uploadFileName: string, mineType: string, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<{
documentId: string;
temporaryFileId: any;
}>;
createPublishedDocumentWithExternalLinkURLPicker(documentName: string, linkTitle: string, linkUrl: string, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<string>;
createPublishedDocumentWithDocumentLinkURLPicker(documentName: string, linkedDocumentName: string, linkedDocumentId: string, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<string>;
createPublishedDocumentWithImageLinkURLPicker(documentName: string, imageName: string, imageId: string, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<string>;
createPublishedDocumentWithImageLinkAndExternalLink(documentName: string, imageName: string, imageId: string, externalLinkTitle: string, externalLinkUrl: string, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<string>;
createPublishedDocumentWithTwoMediaPicker(documentName: string, firstMediaPickerId: string, secondMediaPickerId: string, dataTypeId: string, templateId: string, propertyName?: string, documentTypeName?: string): Promise<string>;
createDefaultDocumentWithABlockGridEditor(documentName: string, elementTypeId: string, documentTypeName: string, blockGridDataTypeName: string): Promise<string | undefined>;
createDefaultDocumentWithABlockGridEditorAndBlockWithValue(documentName: string, documentTypeName: string, blockGridDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName?: string): Promise<string | undefined>;
createDefaultDocumentWithABlockGridEditorAndBlockWithValueAndTwoGroups(documentName: string, documentTypeName: string, blockGridDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string | undefined, secondPropertyName: string, secondGroupName?: string): Promise<string | undefined>;
createDefaultDocumentWithABlockGridEditorAndBlockWithTwoValues(documentName: string, documentTypeName: string, blockGridDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string | undefined, secondElementTypePropertyValue: string): Promise<string | undefined>;
createDefaultDocumentWithABlockGridEditorAndBlockWithTwoValuesAndTwoGroups(documentName: string, documentTypeName: string, blockGridDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string | undefined, secondElementTypePropertyValue: string, secondPropertyName: string, secondGroupName: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditorAndBlockWithValue(documentName: string, documentTypeName: string, blockListDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditor(documentName: string, elementTypeId: string, documentTypeName: string, blockListDataTypeName: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditorAndBlockWithValueAndTwoGroups(documentName: string, documentTypeName: string, blockListDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string | undefined, secondPropertyName: string, secondGroupName?: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditorAndBlockWithTwoValues(documentName: string, documentTypeName: string, blockListDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string | undefined, secondElementTypePropertyValue: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditorAndBlockWithTwoValuesAndTwoGroups(documentName: string, documentTypeName: string, blockListDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string, groupName: string | undefined, secondElementTypePropertyValue: string, secondPropertyName: string, secondGroupName: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditorAndBlockGridEditorWithSameAllowedBlock(documentName: string, documentTypeName: string, blockListDataTypeName: string, blockGridDataTypeName: string, elementTypeId: string, elementTypePropertyAlias: string, blockListElementTypePropertyValue: string, blockListElementTypePropertyEditorAlias: string, blockListGroupName: string | undefined, blockGridElementTypePropertyValue: string, blockGridElementTypePropertyEditorAlias: string, blockGridGroupName?: string): Promise<string | undefined>;
createDefaultDocumentWithABlockListEditorAndBlockGridEditorWithDifferentAllowedBlock(documentName: string, documentTypeName: string, blockListDataTypeName: string, blockGridDataTypeName: string, blockListElementTypeId: string, blockListElementTypePropertyAlias: string, blockListElementTypePropertyValue: string, blockListElementTypePropertyEditorAlias: string, blockListGroupName: string | undefined, blockGridElementTypeId: string, blockGridElementTypePropertyAlias: string, blockGridElementTypePropertyValue: string, blockGridElementTypePropertyEditorAlias: string, blockGridGroupName?: string): Promise<string | undefined>;
createDocumentWithABlockGridEditorWithABlockThatContainsABlockInAnArea(documentName: string, documentTypeId: string, blockGridDataTypeName: string, firstElementTypeKey: string, areaKey: string, secondElementTypeKey: string, elementTypePropertyAlias: string, elementTypePropertyValue: string, elementTypePropertyEditorAlias: string): Promise<string | undefined>;
createDocumentWithTextContentAndOneDomain(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string, domainName: string, isoCode?: string): Promise<string>;
createDocumentWithTextContentAndTwoDomains(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string, firstDomainName: string, firstIsoCode: string | undefined, secondDomainName: string, secondIsoCode?: string): Promise<string>;
doesTipTapDataTypeWithNameContainBlockWithValue(documentName: string, dataTypeAlias: string, elementTypeId: string, elementTypeDataTypeAlias: string, blockValue: string): Promise<boolean>;
publishDocumentWithCulture(id: string, culture: string): Promise<number | undefined>;
createDocumentWithTextContentAndParent(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string, parentId: string): Promise<string | undefined>;
createDocumentWithEnglishCultureAndTextContentAndParent(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string, parentId: string, varyByCultureForText?: boolean): Promise<string | undefined>;
doesBlockGridContainBlocksWithDataElementKeyInAreaWithKey(documentName: string, blockGridAlias: string, blockContentKey: string, areaKey: string, blocksInAreas: string[]): Promise<any>;
emptyRecycleBin(): Promise<import("playwright-core").APIResponse>;
getRecycleBinItems(): Promise<import("playwright-core").APIResponse>;
doesItemExistInRecycleBin(documentItemName: string): Promise<boolean>;
createDocumentWithTwoCulturesAndTextContent(documentName: string, documentTypeId: string, textContent: string, dataTypeName: string, firstCulture: string, secondCulture: string): Promise<string>;
createDefaultDocumentWithOneDocumentLink(documentName: string, linkedDocumentName: string, linkedDocumentId: string, documentTypeName?: string): Promise<string | undefined>;
createDefaultDocumentWithOneMediaLink(documentName: string, linkedMediaName: string, documentTypeName?: string): Promise<string | undefined>;
}