UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

79 lines (78 loc) 8.68 kB
import { ApiHelpers } from "./ApiHelpers"; export declare class DocumentTypeApiHelper { api: ApiHelpers; constructor(api: ApiHelpers); ensureNameNotExists(name: string): Promise<number | import("playwright-core").APIResponse | null | undefined>; getAllAtRoot(): Promise<import("playwright-core").APIResponse>; private recurseChildren; private recurseDeleteChildren; getChildren(id: string): Promise<any>; create(documentType: any): Promise<string | undefined>; get(id: string): Promise<any>; getByName(name: string): Promise<any>; doesNameExist(name: string): Promise<any>; delete(id: string): Promise<number | undefined>; getFolder(id: string): Promise<any>; deleteFolder(id: string): Promise<import("playwright-core").APIResponse>; createFolder(name: string, parentId?: string): Promise<string | undefined>; renameFolder(folderId: string, folderName: string): Promise<import("playwright-core").APIResponse>; createDefaultDocumentType(documentTypeName: string): Promise<string | undefined>; createDocumentTypeWithPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName?: string, documentTypeVaryByCulture?: boolean, propertyVaryByCulture?: boolean, isMandatory?: boolean, documentTypeVaryBySegment?: boolean, propertyTypeVaryBySegment?: boolean): Promise<string | undefined>; createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName: string, firstPropertyName: string, firstDataTypeId: string, firstGroupName: string | undefined, secondPropertyName: string, secondDataTypeId: string, secondGroupName?: string): Promise<string | undefined>; createDocumentTypeWithPropertyEditorInTab(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, groupName?: string, varyByCulture?: boolean, allowAsRoot?: boolean): Promise<string | undefined>; createDocumentTypeWithPropertyEditorDirectlyInTwoTabs(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, secondTabName: string, secondTabDataTypeName: string, secondTabDataTypeId: string, varyByCulture?: boolean, allowAsRoot?: boolean): Promise<string | undefined>; createDocumentTypeWithPropertyEditorInTabAndAnotherTab(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, secondTabName: string, secondTabDataTypeName: string, secondTabDataTypeId: string, groupName?: string, varyByCulture?: boolean, allowAsRoot?: boolean): Promise<string | undefined>; createDocumentTypeWithTwoPropertyEditors(documentTypeName: string, dataTypeNameOne: string, dataTypeIdOne: string, dataTypeNameTwo: string, dataTypeIdTwo: string, groupName?: string): Promise<string | undefined>; createDefaultDocumentTypeWithAllowAsRoot(documentTypeName: string): Promise<string | undefined>; createDocumentTypeWithAllowedChildNode(documentTypeName: string, allowedChildNodeId: string): Promise<string | undefined>; createDocumentTypeWithAPropertyEditorAndAnAllowedChildNode(documentTypeName: string, dataTypeName: string, dataTypeId: string, allowedChildNodeId: string, groupName?: string): Promise<string | undefined>; createDocumentTypeWithAllowedTemplate(documentTypeName: string, allowedTemplateId: string, isAllowedAsRoot?: boolean): Promise<string | undefined>; createDocumentTypeWithTwoAllowedTemplates(documentTypeName: string, allowedTemplateOneId: string, allowedTemplateTwoId: string, isAllowedAsRoot?: boolean, defaultTemplateId?: string): Promise<string | undefined>; createDocumentTypeWithTwoGroups(documentTypeName: string, dataType: string, dataTypeId: string, groupNameOne: string, groupNameTwo: string): Promise<string | undefined>; createDocumentTypeWithAComposition(documentTypeName: string, compositionId: string): Promise<string | undefined>; createEmptyElementType(elementTypeName: string): Promise<string | undefined>; createDocumentTypeWithTwoTabs(documentTypeName: string, dataType: string, dataTypeId: string, tabNameOne: string, tabNameTwo: string): Promise<string | undefined>; createDefaultElementType(elementName: string, groupName: string | undefined, dataTypeName: string | undefined, dataTypeId: string, isMandatory?: boolean): Promise<string | undefined>; createDefaultElementTypeWithVaryByCulture(elementName: string, groupName: string | undefined, dataTypeName: string | undefined, dataTypeId: string, elementTypeVaryByCulture: boolean, dataTypeVaryByCulture: boolean): Promise<string | undefined>; createElementTypeWithRegexValidation(elementName: string, groupName: string | undefined, dataTypeName: string | undefined, dataTypeId: string, regex: string): Promise<string | undefined>; createElementTypeWithPropertyInTab(elementName: string, tabName: string | undefined, groupName: string | undefined, dataTypeName: string | undefined, dataTypeId: string, isMandatory?: boolean): Promise<string | undefined>; doesGroupContainCorrectPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName: string): Promise<any>; doesTabContainCorrectPropertyEditorInGroup(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, groupName: string): Promise<any>; doesDocumentTypeGroupNameContainCorrectSortOrder(documentTypeName: string, groupName: string, sortOrder: number): Promise<boolean>; doesDocumentTypeTabNameContainCorrectSortOrder(documentTypeName: string, tabName: string, sortOrder: number): Promise<boolean>; getContainerIdWithName(documentTypeName: string, containerName: string): Promise<any>; createDocumentTypeWithAllowedTwoChildNodes(documentTypeName: string, allowedChildNodeOneId: string, allowedChildNodeTwoId: string): Promise<string | undefined>; createDocumentTypeWithAllowedChildNodeAndDataType(documentTypeName: string, allowedChildNodeId: string, dataTypeName: string, dataTypeId: string, groupName?: string): Promise<string | undefined>; createDocumentTypeWithAllowedChildNodeAndCollectionId(documentTypeName: string, allowedChildNodeId: string, collectionId: string): Promise<string | undefined>; createDocumentTypeWithCollectionId(documentTypeName: string, collectionId: string): Promise<string | undefined>; createDocumentTypeWithAllowVaryByCulture(documentTypeName: string): Promise<string | undefined>; createDocumentTypeWithPropertyEditorAndAllowedTemplate(documentTypeName: string, dataTypeId: string, propertyName: string, templateId: string): Promise<string | undefined>; createVariantDocumentTypeWithInvariantPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string): Promise<string | undefined>; createVariantDocumentTypeWithAllowedChildNodeAndInvariantPropertyEditor(documentTypeName: string, allowedChildNodeId: string, dataTypeName: string, dataTypeId: string, groupName?: string): Promise<string | undefined>; getPropertyIdWithName(documentTypeId: string, propertyName: string): Promise<any>; createElementTypeWithTwoPropertyEditors(elementTypeName: string, firstDataTypeName: string, firstDataTypeId: string, secondDataTypeName: string, secondDataTypeId: string, elementTypeVaryByCulture?: boolean, firstPropertyVaryByCulture?: boolean, secondPropertyVaryByCulture?: boolean): Promise<string | undefined>; /** * Creates a variant element type with two properties: one variant and one invariant. * Useful for testing scenarios where a block has both culture-specific and shared properties. */ createVariantElementTypeWithVariantAndInvariantProperty(elementName: string, groupName: string, variantPropertyName: string, invariantPropertyName: string, dataTypeId: string): Promise<string | undefined>; /** * Creates a document type with variant and invariant block lists for testing multilingual scenarios. * * Structure created: * - Document Type (Vary by culture) * - Text 1 (Vary by culture) * - Text 2 (Shared) * - Block List 1 (Vary by culture) - contains Block 1 and Block 2 * - Block List 2 (Shared) - contains Block 1 and Block 2 * * - Block 1 Element Type (Vary by culture) * - Text 1 (Vary by culture) * - Text 2 (Shared) * * - Block 2 Element Type (Shared/Invariant) * - Text 1 * - Text 2 */ createDocumentTypeWithVariantAndInvariantBlockLists(documentTypeName: string, firstDataTypeName: string, firstDataTypeId: string, secondDataTypeName: string, secondDataTypeId: string, blockList1DataTypeName: string, blockList2DataTypeName: string, block1ElementTypeName: string, block2ElementTypeName: string): Promise<string | undefined>; }