UNPKG

@shopware-ag/acceptance-test-suite

Version:
1,289 lines (1,278 loc) 237 kB
import * as axe_core from 'axe-core'; import * as playwright_test from '@playwright/test'; import { Page as Page$1, Locator as Locator$1, Browser } from '@playwright/test'; export { expect, mergeTests } from '@playwright/test'; import * as playwright_core from 'playwright-core'; import { APIRequestContext, APIResponse, Page, Locator, BrowserContext } from 'playwright-core'; export { APIRequestContext, APIResponse, BrowserContext, Locator, Page, Request } from 'playwright-core'; import { components } from '@shopware/api-client/admin-api-types'; import { Image } from 'image-js'; declare global { namespace PlaywrightTest { interface Matchers<R> { toHaveVisibleFocus(): Promise<R>; } } } interface RequestOptions$1<PAYLOAD> { [key: string]: unknown; data?: PAYLOAD; headers?: Record<string, string>; } interface AdminApiContextOptions { app_url?: string; client_id?: string; client_secret?: string; access_token?: string; admin_username?: string; admin_password?: string; ignoreHTTPSErrors?: boolean; authMaxRetries?: number; authBaseDelayMs?: number; } declare class AdminApiContext { context: APIRequestContext; readonly options: Required<AdminApiContextOptions>; private static readonly defaultOptions; constructor(context: APIRequestContext, options: Required<AdminApiContextOptions>); static create(options?: Required<AdminApiContextOptions>): Promise<AdminApiContext>; private static createApiRequestContext; private static authenticateWithRetry; static authenticateWithClientCredentials(context: APIRequestContext, options: Required<AdminApiContextOptions>): Promise<string>; static authenticateWithUserPassword(context: APIRequestContext, options: Required<AdminApiContextOptions>): Promise<string>; private reauthenticate; isAuthenticated(): boolean; refreshAccessToken(): Promise<void>; get<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>; post<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>; patch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>; delete<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>; fetch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>; head<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>; private handleRequest; } type SalesChannel = components["schemas"]["SalesChannel"] & { id: string; }; type SalesChannelDomain = components["schemas"]["SalesChannelDomain"] & { id: string; }; type Customer = Omit<components["schemas"]["Customer"], "defaultShippingAddress" | "defaultBillingAddress"> & { id: string; password: string; defaultShippingAddress: { firstName: string; lastName: string; city: string; street: string; zipcode: string; countryId: string; salutationId: string; }; defaultBillingAddress: { firstName: string; lastName: string; city: string; street: string; zipcode: string; countryId: string; salutationId: string; }; }; type User = components["schemas"]["User"] & { id: string; password: string; }; type AclRole = components["schemas"]["AclRole"] & { id: string; privileges: string[]; }; type CustomerAddress = components["schemas"]["CustomerAddress"] & { id: string; }; interface Address { id: string; salutation: string; firstName: string; lastName: string; company: string; department: string; street: string; city: string; zipcode: string; country: string; state: string; } type Salutation = components["schemas"]["Salutation"] & { id: string; }; interface Price { gross: number; net: number; linked: boolean; currencyId: string; } interface VariantListingConfig { displayParent: boolean; } interface ProductPrice { productId?: string; ruleId: string; price: Price[]; quantityStart: number; quantityEnd: number | null; } type Product = Omit<components["schemas"]["Product"], "price" | "prices" | "options" | "tags" | "visibilities" | "variantListingConfig"> & { id: string; price: Price[]; prices?: ProductPrice[]; translated: { name: string; }; options?: Record<string, string>[]; tags?: Record<string, string>[]; visibilities?: Record<string, unknown>[]; variantListingConfig?: VariantListingConfig; }; type ProductReview = components["schemas"]["ProductReview"] & { id: string; productId: string; salesChannelId: string; title: string; content: string; points: number; }; type OrderDelivery = Omit<components["schemas"]["OrderDelivery"], "shippingOrderAddress" | "shippingCosts"> & { id: string; shippingOrderAddress: Partial<components["schemas"]["OrderAddress"]>; shippingCosts: { unitPrice: number; totalPrice: number; quantity: number; calculatedTaxes: CalculatedTaxes[]; taxRules: TaxRules[]; }; }; type Manufacturer = components["schemas"]["ProductManufacturer"] & { id: string; }; type PropertyGroup = components["schemas"]["PropertyGroup"] & { id: string; }; type Category$1 = components["schemas"]["Category"] & { id: string; }; type Media$1 = components["schemas"]["Media"] & { id: string; }; type Tag = components["schemas"]["Tag"] & { id: string; }; type Rule = components["schemas"]["Rule"] & { id: string; }; type Currency$2 = components["schemas"]["Currency"] & { id: string; }; type Country$1 = Omit<components["schemas"]["Country"], "states"> & { id: string; states: [ { name: string; shortCode: string; } ]; }; type SystemConfig = components["schemas"]["SystemConfig"] & { id: string; }; type ProductCrossSelling = components["schemas"]["ProductCrossSelling"] & { id: string; }; interface CalculatedTaxes { tax: number; taxRate: number; price: number; } interface TaxRules { taxRate: number; percentage: number; } type Order = Omit<components["schemas"]["Order"], "deliveries" | "price"> & { id: string; orderNumber: string; orderCustomer: { firstName: string; lastName: string; email: string; }; price: { netPrice: number; positionPrice: number; rawTotal: number; taxStatus: string; totalPrice: number; calculatedTaxes: CalculatedTaxes[]; taxRules: TaxRules[]; }; deliveries: Record<string, unknown>[]; }; type ShippingMethod$1 = components["schemas"]["ShippingMethod"] & { id: string; }; type PaymentMethod$1 = components["schemas"]["PaymentMethod"] & { id: string; }; type StateMachine = components["schemas"]["StateMachine"] & { id: string; }; type StateMachineState = components["schemas"]["StateMachineState"] & { id: string; }; type Promotion = Omit<components["schemas"]["Promotion"], "discounts"> & { id: string; discounts: [ { id?: string; scope: string; type: string; value: number; considerAdvancedRules: boolean; } ]; active: boolean; code: string; }; type PromotionDiscount = components["schemas"]["PromotionDiscount"] & { id: string; }; type OrderLineItem = components["schemas"]["OrderLineItem"] & { id: string; }; type PropertyGroupOption = components["schemas"]["PropertyGroupOption"] & { id: string; }; type DeliveryTime = components["schemas"]["DeliveryTime"] & { id: string; }; type CmsPage = components["schemas"]["CmsPage"] & { id: string; }; type CustomerGroup = components["schemas"]["CustomerGroup"] & { id: string; }; type SalesChannelAnalytics = components["schemas"]["SalesChannelAnalytics"] & { id: string; }; interface RegistrationData { isCommercial: boolean; isGuest: boolean; salutation: string; firstName: string; lastName: string; email: string; password: string; street: string; city: string; country: string; postalCode: string; company: string; department: string; vatRegNo: string; } type Language$2 = components["schemas"]["Language"] & { id: string; }; type CustomFieldSet = components["schemas"]["CustomFieldSet"] & { id: string; }; type CustomField = Omit<components["schemas"]["CustomField"], "config"> & { id: string; config: { label: { "en-GB": string; }; }; }; type Tax$1 = components["schemas"]["Tax"] & { id: string; }; declare const RuleType: { readonly shippingAvailability: "shippingMethodAvailabilityRule"; readonly taxAvailability: "taxProviderAvailabilityRule"; readonly paymentAvailability: "paymentMethodAvailabilityRule"; readonly promotionOrder: "promotionOrderRule"; readonly promotionCustomer: "promotionCustomerRule"; readonly promotionCart: "promotionCartRule"; }; type RuleType = (typeof RuleType)[keyof typeof RuleType]; interface RuleAssignmentEntity { entity: { id: string; name: string; }; ruleType: RuleType; } interface FlowConfig { name: string; description: string; priority: string; active: boolean; triggerSearchTerm: string; triggerLabel: string; condition: string; trueAction: string; trueActionIdentifier: string; falseAction: string; falseActionIdentifier: string; } interface CategoryData { name: string; categoryType: "Link" | "Page / List" | "Structuring element / Entry point"; status: boolean; } interface CategoryCustomizableLinkData { linkType: "Internal" | "External"; entity: "Category" | "Product" | "Landing page"; category?: string; product?: string; landingPage?: string; openInNewTab: boolean; } interface AccountData { customerGroup?: string; accountStatus?: boolean; language?: string; replyToCustomerGroupRequest?: string; } interface TagData { changeType: "Overwrite" | "Clear" | "Add" | "Remove"; tags: string[]; } interface CustomFieldData { customFieldSetName: string; customFieldValue: string; } interface FlowTemplate { id: string; name: string; config: { eventName: string; sequences: [ { actionName: string; config: string; } ]; }; } interface Flow { id: string; name: string; eventName: string; sequences: [ { actionName: string; config: string; } ]; } declare const COUNTRY_ADDRESS_DATA: { DE: { street: string; city: string; country: string; postalCode: string; vatRegNo: string; }; US: { street: string; city: string; country: string; postalCode: string; vatRegNo: string; }; GB: { street: string; city: string; country: string; postalCode: string; vatRegNo: string; }; }; declare const getCountryAddressData: (countryCode?: string) => { street: string; city: string; country: string; postalCode: string; vatRegNo: string; }; declare const getLocale: () => string; declare const getLanguageCode: (locale?: string) => string; declare const getCountryCodeFromLocale: (locale?: string) => string; declare const getCurrencyCodeFromLocale: (locale?: string) => string; declare const getCurrencySymbolFromLocale: (locale?: string) => string; declare const formatPrice: (price: number, locale?: string, currencyCode?: string) => string; type Language$1 = components["schemas"]["Language"] & { id: string; translationCode: components["schemas"]["Locale"] & { id: string; }; }; declare const getLanguageData: (adminApiContext: AdminApiContext, languageCode?: string) => Promise<Language$1>; declare const getSnippetSetId: (adminApiContext: AdminApiContext, languageCode?: string) => Promise<string>; type Currency$1 = components["schemas"]["Currency"] & { id: string; }; declare const getCurrency: (adminApiContext: AdminApiContext, isoCode?: string) => Promise<Currency$1>; declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>; declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>; /** * Gives the default shipping method back called Standard * @param adminApiContext - An AdminApiContext entity * * @deprecated - Use getShippingMethodId instead */ declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>; declare const getShippingMethodId: (name: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getCountryId: (iso2: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getThemeId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getSalutationId: (salutationKey: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getStateMachineId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getStateMachineStateId: (stateMachineId: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getFlowId: (flowName: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApiContext) => Promise<{ id: string; }>; declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>; declare const getFlowTemplate: (flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<FlowTemplate>; declare const getFlow: (flowId: string, adminApiContext: AdminApiContext) => Promise<Flow>; declare const compareFlowTemplateWithFlow: (flowId: string, flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<boolean>; declare function extractIdFromUrl(url: string): string | null; type OrderStatus = "cancel" | "complete" | "reopen" | "process"; declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>; /** * Return a single promotion entity with a fetched single discount entity */ declare const getPromotionWithDiscount: (promotionId: string, adminApiContext: AdminApiContext) => Promise<Promotion>; declare const updateAdminUser: (adminUserId: string, adminApiContext: AdminApiContext, data: Record<string, string | boolean>) => Promise<void>; interface RequestOptions<PAYLOAD> { [key: string]: unknown; data?: PAYLOAD; } interface StoreUser { email: string; password: string; } interface StoreApiContextOptions { app_url?: string; "sw-access-key"?: string; "sw-context-token"?: string; ignoreHTTPSErrors?: boolean; } declare class StoreApiContext { private context; private readonly options; private static readonly defaultOptions; constructor(context: APIRequestContext, options: StoreApiContextOptions); static create(options?: StoreApiContextOptions): Promise<StoreApiContext>; private static createContext; login(user: StoreUser): Promise<{ [key: string]: string; }>; get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>; post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>; patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>; delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>; fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>; head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>; } declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>; declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>; declare function createRandomImage(width?: number, height?: number): Image; declare function createSolidColorImage(width?: number, height?: number, color?: [number, number, number]): Image; declare function encodeImage(image: Image): Buffer<ArrayBuffer>; interface IdPair { id: string; uuid: string; } declare class IdProvider { private readonly workerIndex; private readonly seed; constructor(workerIndex: number, seed: string); getIdPair(): IdPair; getUniqueName(): string; getWorkerDerivedStableId(key: string): IdPair; } interface SalesChannelRecord { salesChannelId: string; field: string; } interface CreatedRecord { resource: string; payload: Record<string, string>; } interface SimpleLineItem { product: Product | Promotion; quantity?: number; position?: number; overrides?: Partial<OrderLineItem>; } interface SyncApiOperation { entity: string; action: "upsert" | "delete"; payload: Record<string, unknown>[]; } interface DataServiceOptions { namePrefix?: string; nameSuffix?: string; defaultSalesChannel: SalesChannel; defaultTaxId: string; defaultCurrencyId: string; defaultCategoryId: string; defaultLanguageId: string; defaultCountryId: string; defaultCustomerGroupId: string; } declare class TestDataService { readonly AdminApiClient: AdminApiContext; readonly IdProvider: IdProvider; readonly namePrefix: string; readonly nameSuffix: string; readonly defaultSalesChannel: SalesChannel; readonly defaultTaxId: string; readonly defaultCurrencyId: string; readonly defaultCategoryId: string; readonly defaultLanguageId: string; readonly defaultCountryId: string; readonly defaultCustomerGroupId: string; /** * Configures if an automated cleanup of the data should be executed. * * @private */ private _shouldCleanUp; get shouldCleanUp(): boolean; /** * Configuration of higher priority entities for the cleanup operation. * These entities will be deleted before others. * This will prevent restricted delete operations of associated entities. * * @private */ private highPriorityEntities; /** * A registry of all created records. * * @private */ private createdRecords; private restoreSystemConfig; /** * A registry of all created sales channel records. * * @private */ private createdSalesChannelRecords; constructor(AdminApiClient: AdminApiContext, IdProvider: IdProvider, options: DataServiceOptions); /** * Creates a basic product without images or other special configuration. * The product will be added to the default sales channel category if configured. * * @param overrides - Specific data overrides that will be applied to the product data struct. * @param taxId - The uuid of the tax rule to use for the product pricing. * @param currencyId - The uuid of the currency to use for the product pricing. */ createBasicProduct(overrides?: Partial<Product>, taxId?: string, currencyId?: string): Promise<Product>; /** * Creates a basic product cross-selling entity without products. * * @param productId - The uuid of the product to which the pproduct cross-selling should be assigned. * @param overrides - Specific data overrides that will be applied to the property group data struct. */ createProductCrossSelling(productId: string, overrides?: Partial<ProductCrossSelling>): Promise<ProductCrossSelling>; /** * Creates a basic product with one randomly generated image. * The product will be added to the default sales channel category if configured. * * @param overrides - Specific data overrides that will be applied to the product data struct. * @param taxId - The uuid of the tax rule to use for the product pricing. * @param currencyId - The uuid of the currency to use for the product pricing. */ createProductWithImage(overrides?: Partial<Product>, taxId?: string, currencyId?: string): Promise<Product>; /** * Creates a digital product with a text file as its download. * The product will be added to the default sales channel category if configured. * * @param content - The content of the text file for the product download. * @param overrides - Specific data overrides that will be applied to the product data struct. * @param taxId - The uuid of the tax rule to use for the product pricing. * @param currencyId - The uuid of the currency to use for the product pricing. */ createDigitalProduct(content?: string, overrides?: Partial<Product>, taxId?: string, currencyId?: string): Promise<Product>; /** * Creates a basic product with a price range matrix. * The product will be added to the default sales channel category if configured. * * @param overrides - Specific data overrides that will be applied to the product data struct. * @param taxId - The uuid of the tax rule to use for the product pricing. * @param currencyId - The uuid of the currency to use for the product pricing. */ createProductWithPriceRange(overrides?: Partial<Product>, taxId?: string, currencyId?: string): Promise<Product>; /** * Creates basic variant products based on property group. * * @param parentProduct Parent product of the variants * @param propertyGroups Property group collection which contain options * @param overrides - Specific data overrides that will be applied to the variant data struct. */ createVariantProducts(parentProduct: Product, propertyGroups: PropertyGroup[], overrides?: Partial<Product>): Promise<Product[]>; /** * Creates a product review * * @param productId - The uuid of the product to which the review should be assigned. * @param overrides - Specific data overrides that will be applied to the review data struct. */ createProductReview(productId: string, overrides?: Partial<ProductReview>): Promise<ProductReview>; /** * Creates a basic manufacturer without images or other special configuration. * * @param overrides - Specific data overrides that will be applied to the manufacturer data struct. */ createBasicManufacturer(overrides?: Partial<Manufacturer>): Promise<Manufacturer>; /** * Creates a basic manufacturer with one randomly generated image. * * @param overrides - Specific data overrides that will be applied to the manufacturer data struct. */ createManufacturerWithImage(overrides?: Partial<Manufacturer>): Promise<Manufacturer>; /** * Creates a basic product category to assign products to. * * @param parentId - The uuid of the parent category. * @param overrides - Specific data overrides that will be applied to the category data struct. */ createCategory(overrides?: Partial<Category$1>, parentId?: string): Promise<Category$1>; /** * Creates a new media resource containing a random generated PNG image. * * @param width - The width of the image in pixel. Default is 800. * @param height - The height of the image in pixel. Default is 600. */ createMediaPNG(width?: number, height?: number): Promise<Media$1>; /** * Creates a new media resource containing a solid color PNG image. * Unlike `createMediaPNG`, the result is deterministic and suitable for visual regression tests. * * @param width - The width of the image in pixel. Default is 800. * @param height - The height of the image in pixel. Default is 600. * @param color - RGB color as `[r, g, b]` with values 0..255. Default is red `[255, 0, 0]`. */ createMediaPNGSolid(width?: number, height?: number, color?: [number, number, number]): Promise<Media$1>; /** * Creates a new media resource containing a text file. * * @param content - The content of the text file. */ createMediaTXT(content?: string): Promise<Media$1>; /** * Creates a new empty media resource. * This method is mostly used to combine it with a certain file upload. */ createMediaResource(): Promise<Media$1>; /** * Creates a new property group with color type options. * * @param overrides - Specific data overrides that will be applied to the property group data struct. */ createColorPropertyGroup(overrides?: Partial<PropertyGroup>): Promise<PropertyGroup>; /** * Creates a new property group with text type options. * * @param overrides - Specific data overrides that will be applied to the property group data struct. */ createTextPropertyGroup(overrides?: Partial<PropertyGroup>): Promise<PropertyGroup>; /** * Creates a new tag which can be assigned to other entities. * * @param tagName - The name of the tag. */ createTag(tagName: string): Promise<Tag>; /** * Creates a new shop customer. * * @param overrides - Specific data overrides that will be applied to the customer data struct. * @param salutationKey - The key of the salutation that should be used for the customer. Default is "mr". * @param salesChannel - The sales channel for which the customer should be registered. */ createCustomer(overrides?: Partial<Customer>, salutationKey?: string, salesChannel?: SalesChannel): Promise<Customer>; /** * Creates a new user for the admin with full admin permissions. * * @param overrides - Specific data overrides that will be applied to the customer data struct. * @param salesChannel - The sales channel for which the customer should be registered. */ createUser(overrides?: Partial<User>, salesChannel?: SalesChannel): Promise<User>; /** * Creates a new AclRole for the administration with basic shop configuration privileges. * * @param overrides - Specific data overrides that will be applied to the aclRole data struct. */ createAclRole(overrides?: Partial<AclRole>): Promise<AclRole>; /** * Creates a new order. This order is created on pure data and prices are not guaranteed to be calculated correctly. * * @param lineItems - Products that should be added to the order. * @param customer - The customer to which the order should be assigned. * @param overrides - Specific data overrides that will be applied to the order data struct. * @param salesChannel - The sales channel in which the order should be created. */ createOrder(lineItems: SimpleLineItem[], customer: Customer, overrides?: Partial<Order>, salesChannel?: SalesChannel): Promise<Order>; /** * Creates a new promotion with a promotion code and only single discount option. * * @param overrides - Specific data overrides that will be applied to the promotion data struct. * @param salesChannelId - The uuid of the sales channel in which the promotion should be active. */ createPromotionWithCode(overrides?: Partial<Promotion>, salesChannelId?: string): Promise<Promotion>; /** * Creates a new basic payment method. * * @param overrides - Specific data overrides that will be applied to the payment method data struct. */ createBasicPaymentMethod(overrides?: Partial<PaymentMethod$1>): Promise<PaymentMethod$1>; /** * Creates a payment method with one randomly generated image. * * @param overrides - Specific data overrides that will be applied to the payment method data struct. */ createPaymentMethodWithImage(overrides?: Partial<PaymentMethod$1>): Promise<PaymentMethod$1>; /** * Creates a new basic shipping method with random delivery time. * * @param overrides - Specific data overrides that will be applied to the shipping method data struct. */ createBasicShippingMethod(overrides?: Partial<ShippingMethod$1>): Promise<ShippingMethod$1>; /** * Creates a shipping method with one randomly generated image. * * @param overrides - Specific data overrides that will be applied to the shipping method data struct. */ createShippingMethodWithImage(overrides?: Partial<ShippingMethod$1>): Promise<ShippingMethod$1>; /** * Creates a new basic rule with the condition cart amount >= 1. * * @param overrides - Specific data overrides that will be applied to the basic rule data struct. */ createBasicRule(overrides?: Partial<Rule>, conditionType?: string, operator?: string, amount?: number): Promise<Rule>; /** * Creates a new basic page layout. * * @param cmsPageType - The type of the cms page layout (page/landingpage/product_detail/product_list). * @param overrides - Specific data overrides that will be applied to the cms page layout data struct. */ createBasicPageLayout(cmsPageType: string, overrides?: Partial<CmsPage>): Promise<CmsPage>; /** * Creates a random country * * @param overrides - Specific data overrides that will be applied to the country data struct. */ createCountry(overrides?: Partial<Country$1>): Promise<Country$1>; /** * Creates a random currency with default rounding of 2 decimals * * @param roundingDecimals - Decimals of the rounding shown in Storefront, default value 2 * @param overrides - Specific data overrides that will be applied to the currency data struct. */ createCurrency(overrides?: Partial<Currency$2>, roundingDecimals?: number): Promise<Currency$2>; /** * Creates a random customer group * * @param overrides - Specific data overrides that will be applied to the customer group data struct. */ createCustomerGroup(overrides?: Partial<CustomerGroup>): Promise<CustomerGroup>; /** * Creates a customer address * * @param overrides - Specific data overrides that will be applied to the customer address data struct. */ createCustomerAddress(customer: Customer, overrides?: Partial<Address>): Promise<Address>; /** * Set system config for default sales channel * * @param configs - Key value pairs to set */ setSystemConfig(configs: Record<string, unknown>): Promise<void>; /** * Creates a random sales channel analytics entity * * @param overrides - Specific data overrides that will be applied to the sales channel analytics data struct. */ createSalesChannelAnalytics(overrides?: Partial<SalesChannelAnalytics>): Promise<SalesChannelAnalytics>; /** * Creates a custom field * * @param customFieldSetId - The uuid of the custom field set. * @param overrides - Specific data overrides that will be applied to the custom field data struct. */ createCustomField(customFieldSetId: string, overrides?: Partial<CustomField>): Promise<CustomField>; /** * Creates a custom field set * * @param overrides - Specific data overrides that will be applied to the custom field set data struct. */ createCustomFieldSet(overrides?: Partial<CustomFieldSet>): Promise<CustomFieldSet>; /** * Creates a new domain for a sales channel. * * @param overrides - Specific data overrides that will be applied to the sales channel domain data struct. */ createSalesChannelDomain(overrides?: Partial<SalesChannelDomain>): Promise<SalesChannelDomain>; /** * Creates a new tax rate (19%) with a random name. * * @param overrides - Specific data overrides that will be applied to the tax data struct. */ createTaxRate(overrides?: Partial<Tax$1>): Promise<Tax$1>; /** * Assigns a media resource as the download of a digital product. * * @param productId - The uuid of the product. * @param mediaId - The uuid of the media resource. */ assignProductDownload(productId: string, mediaId: string): Promise<any>; /** * Assigns a media resource to a product as the product image. * * @param productId - The uuid of the product. * @param mediaId - The uuid of the media resource. */ assignProductMedia(productId: string, mediaId: string): Promise<any>; /** * Assigns a manufacturer to a product. * * @param productId - The uuid of the product. * @param manufacturerId - The uuid of the manufacturer. */ assignProductManufacturer(productId: string, manufacturerId: string): Promise<any>; /** * Assigns a country to a currency with default roundings of 2. * * @param currencyId - The uuid of currency. * @param countryId - The uuid of country. * @param roundingDecimals - The roundings of item and total values in storefront, default 2 decimals */ assignCurrencyCountryRounding(currencyId: string, countryId: string, roundingDecimals?: number): Promise<any>; /** * Assigns a product to a category. * * @param productId - The uuid of the product. * @param categoryId - The uuid of the category. */ assignProductCategory(productId: string, categoryId: string): Promise<any>; /** * Assigns a tag to a product. * * @param productId - The uuid of the product. * @param tagId - The uuid of the tag. */ assignProductTag(productId: string, tagId: string): Promise<any>; /** * Assigns a media resource to a manufacturer as a logo. * * @param manufacturerId - The uuid of the manufacturer. * @param mediaId - The uuid of the media resource. */ assignManufacturerMedia(manufacturerId: string, mediaId: string): Promise<any>; /** * Assigns a manufacturer to a product. * * @deprecated - Use `assignProductManufacturer` instead. * * @param manufacturerId - The uuid of the manufacturer. * @param productId - The uuid of the product. */ assignManufacturerProduct(manufacturerId: string, productId: string): Promise<void>; /** * Assigns a currency to a sales channel. * * @param salesChannelId - The uuid of the sales channel. * @param currencyId - The uuid of the currency. */ assignSalesChannelCurrency(salesChannelId: string, currencyId: string): Promise<any>; /** * Assigns a sales channel analytics entity to a sales channel. * * @param salesChannelId - The uuid of the sales channel. * @param salesChannelAnalyticsId - The uuid of the sales channel analytics entity. */ assignSalesChannelAnalytics(salesChannelId: string, salesChannelAnalyticsId: string): Promise<SalesChannel>; /** * Assigns a country to a sales channel. * * @param salesChannelId - The uuid of the sales channel. * @param countryId - The uuid of the country. */ assignSalesChannelCountry(salesChannelId: string, countryId: string): Promise<any>; /** * Assigns a language to a sales channel. * * @param salesChannelId - The uuid of the sales channel. * @param languageId - The uuid of the language. */ assignSalesChannelLanguage(salesChannelId: string, languageId: string): Promise<any>; /** * Assigns a payment method to a sales channel. * * @param salesChannelId - The uuid of the sales channel. * @param paymentMethodId - The uuid of the currency. */ assignSalesChannelPaymentMethod(salesChannelId: string, paymentMethodId: string): Promise<any>; /** * Assigns a media resource to a payment method as a logo. * * @param paymentMethodId - The uuid of the payment method. * @param mediaId - The uuid of the media resource. */ assignPaymentMethodMedia(paymentMethodId: string, mediaId: string): Promise<any>; /** * Assigns a media resource to a shipping method as a logo. * * @param shippingMethodId - The uuid of the shipping method. * @param mediaId - The uuid of the media resource. */ assignShippingMethodMedia(shippingMethodId: string, mediaId: string): Promise<any>; /** * Assigns an ACL Role to a user (user in administration). * * @param aclRoleId - The uuid of the ACL role. * @param adminUserId - The uuid of the admin user. */ assignAclRoleUser(aclRoleId: string, adminUserId: string): Promise<any>; /** * Retrieves a language based on its code. * @param languageCode */ getLanguageData(languageCode?: string): Promise<Language$2>; /** * Retrieves a currency based on its ISO code. * * @param isoCode - The ISO code of the currency, for example "EUR". */ getCurrency(isoCode: string): Promise<Currency$2>; /** * Retrieves a rule based on its name. * * @param name - The name of the rule. */ getRule(name: string): Promise<Rule>; /** * Retrieves a shipping method by its name. * * @param name - The name of the shipping method. Default is "Standard". */ getShippingMethod(name?: string): Promise<ShippingMethod$1>; /** * Retrieves all delivery time resources. */ getAllDeliveryTimeResources(): Promise<DeliveryTime[]>; /** * Retrieves a payment method by its name. * * @param name - The name of the payment method. Default is "Invoice". */ getPaymentMethod(name?: string): Promise<PaymentMethod$1>; /** * Retrieves a payment method by its distinguishable name. * * @param name - The name of the payment method. * @param exact - exact name or part of it */ getPaymentMethodByDistinguishableName(name: string, exact?: boolean): Promise<PaymentMethod$1>; /** * Retrieves the address of a customer by its uuid. * * @param addressId - The uuid of the customer address. */ getCustomerAddress(addressId: string): Promise<CustomerAddress>; /** * Retrieves a customer by its email address. * * @param email - The email address of the customer. * @returns The customer object. */ getCustomerByEmail(email: string): Promise<Customer>; /** * Retrieves a customer salutations by its key. * * @param key - The key of the salutation. Default is "mr". */ getSalutation(key?: string): Promise<any>; /** * Retrieves the state machine for order states. */ getOrderStateMachine(): Promise<StateMachine>; /** * Retrieves the state machine for delivery states. */ getDeliveryStateMachine(): Promise<StateMachine>; /** * Retrieves the state machine for transaction states. */ getTransactionStateMachine(): Promise<StateMachine>; /** * Retrieves a state machine by its name. * * @param name - The name of the state machine. */ getStateMachine(name: string): Promise<StateMachine>; /** * Retrieves the state of a state machine. * * @param stateMachineId - The uuid of the state machine. * @param stateName - The name of the state. Default is "open". */ getStateMachineState(stateMachineId: string, stateName?: "open" | "completed" | "in_progress" | "cancelled"): Promise<StateMachineState>; /** * Retrieves all corresponding property group options. * * @param propertyGroupId - The uuid of the property group. */ getPropertyGroupOptions(propertyGroupId: string): Promise<PropertyGroupOption[]>; /** * Retrieves a customer group by its id. * * @param customerGroupId - The id of the property group. */ getCustomerGroupById(customerGroupId: string): Promise<CustomerGroup>; /** * Retrieves list of customer groups */ getCustomerGroups(): Promise<CustomerGroup[]>; /** * Retrieves a language by its id. * * @param languageId - The id of the property group. */ getLanguageById(languageId: string): Promise<Language$2>; /** * Retrieves a user by its id. * * @param userId - The id of the user. */ getUserById(userId: string | undefined): Promise<User>; /** * Retrieves a AclRole by its id. * * @param aclRoleId - The id of the ACL role. */ getAclRoleById(aclRoleId: string | undefined): Promise<AclRole>; /** * Adds an entity reference to the registry of created records. * All entities added to the registry will be deleted by the cleanup call. * * @param resource - The resource name of the entity. * @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity. */ addCreatedRecord(resource: string, payload: string | Record<string, string>): void; /** * Adds a sales channel related property to the registry of created sales channel records. * The property added to the registry will be overridden with null value by the cleanup call. * * @param salesChannelId - The sales channel id where the property pair is located * @param field - The database field which has to be overridden */ addCreatedSalesChannelRecord(salesChannelId: string, field: string): void; /** * Set the configuration of automated data clean up. * If set to "true" the data service will delete all entities created by it. * * @param shouldCleanUp - The config setting for the automated data clean up. Default is "true". */ setCleanUp(shouldCleanUp?: boolean): void; /** * Will delete all entities created by the data service via sync API. */ cleanUp(): Promise<playwright_core.APIResponse | null>; isProduct(item: Product | Promotion): item is Product; isPromotion(item: Product | Promotion): item is Promotion; /** * Convert a JS date object into a date-time compatible string. * * @param date - The JS date object from which the date-time should be retrieved. */ convertDateTime(date: Date): string; /** * Function that generates combinations from n number of arrays * with m number of elements in them. * @param array */ combineAll: (array: Record<string, string>[][]) => Record<string, string>[][]; /** * Generates a random alphanumeric string of a specified length. * Ensures at least one numeric character is included. * * @param length - The desired length of the random string (default: 3) * @returns A random alphanumeric string containing at least one digit */ generateRandomId(length?: number): string; /** * @deprecated Use `getCountry` instead. * Retrieves a country Id based on its iso2 code. * * @param iso2 - The iso2 code of the country, for example "DE". */ getCountryId(iso2: string): Promise<Country$1>; /** * Retrieves a country based on its iso2 code. * * @param iso2 - The iso2 code of the country, for example "DE". */ getCountry(iso2: string): Promise<Country$1>; getCountryStruct(overrides?: Partial<Country$1>): Partial<Country$1>; getCurrencyStruct(overrides: Partial<Currency$2> | undefined, roundingDecimals: number): Partial<Currency$2>; getBasicProductStruct(taxId?: string, currencyId?: string, overrides?: Partial<Product>): Partial<Product>; getBasicRuleStruct(overrides: Partial<Rule> | undefined, conditionType: string, operator: string, amount: number): Partial<Rule>; getProductPriceRangeStruct(currencyId: string, ruleId: string): Partial<Product>; getBasicManufacturerStruct(overrides?: Partial<Manufacturer>): Partial<Manufacturer>; getBasicPaymentMethodStruct(overrides?: Partial<PaymentMethod$1>): { id: string; name: string; technicalName: string; active: boolean; } & Partial<PaymentMethod$1>; getBasicCategoryStruct(overrides?: Partial<Category$1>, parentId?: string): { id: string; name: string; parentId: string | null; displayNestedProducts: boolean; type: string; productAssignmentType: string; visible: boolean; active: boolean; } & Partial<Category$1>; getBasicCustomerStruct(salesChannelId: string, customerGroupId: string, languageId: string, countryId: string, defaultPaymentMethodId: string, salutationId: string, overrides?: Partial<Customer>): Partial<Customer>; getBasicUserStruct(localId: string, overrides?: Partial<User>): Partial<User>; getBasicAclRoleStruct(overrides?: Partial<AclRole>): Partial<AclRole>; getBasicOrderDeliveryStruct(deliveryState: StateMachineState, shippingMethod: ShippingMethod$1, customerAddress: CustomerAddress): Partial<OrderDelivery>; getBasicShippingMethodStruct(deliveryTimeId: string, overrides?: Partial<ShippingMethod$1>): { id: string; name: string; technicalName: string; deliveryTimeId: string; active: boolean; } & Partial<ShippingMethod$1>; getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency$2, paymentMethod: PaymentMethod$1, shippingMethod: ShippingMethod$1, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>; getBasicProductLineItemStruct(lineItem: SimpleLineItem): { productId: string; referencedId: string; payload: { productNumber: string; }; identifier: string; type: string; label: string; quantity: number; position: number; price: { unitPrice: number; totalPrice: number; quantity: number | undefined; calculatedTaxes: { tax: number; taxRate: number; price: number; }[]; taxRules: { taxRate: number; percentage: number; }[]; }; priceDefinition: { type: string; price: number; quantity: number; taxRules: { taxRate: number; percentage: number; }[]; listPrice: number; isCalculated: boolean; referencePriceDefinition: null; }; } & Partial<OrderLineItem>; getBasicPromotionLineItemStruct(lineItem: SimpleLineItem): { promotionId: string; referencedId: string; payload: { code: string; }; identifier: string | undefined; type: string; label: string; description: string; quantity: number; position: number; price: { unitPrice: number; totalPrice: number; quantity: number | undefined; calculatedTaxes: { tax: number; taxRate: number; price: number; }[]; taxRules: { taxRate: number; percentage: number; }[]; }; priceDefinition: { type: string; price: number; percentage: number | null; }; } & Partial<OrderLineItem>; getBasicPromotionStruct(salesChannelId?: string, overrides?: Partial<Promotion>): Partial<Promotion>; getBasicCmsStruct(cmsType: string, overrides: Partial<CmsPage>): Partial<CmsPage>; getBasicCustomerGroupStruct(overrides?: Partial<CustomerGroup>): Partial<CustomerGroup>; getBasicCustomerAddressStruct(customerId: string, overrides?: Partial<Address>): Partial<Address>; getSalesChannelAnalyticsStruct(overrides?: Partial<SalesChannelAnalytics>): Partial<SalesChannelAnalytics>; clearCaches(): Promise<void>; getBasicCustomFieldSetStruct(overrides?: Partial<CustomFieldSet>): Partial<CustomFieldSet>; getBasicCustomFieldStruct(overrides?: Partial<CustomField>): Partial<CustomField>; getSalesChannelDomainStruct(salesChannelId: string, currencyId: string, languageId: string, snippetSetId: string, overrides?: Partial<SalesChannelDomain>): Partial<SalesChannelDomain>; getTaxStruct(overrides: Partial<Tax$1>): Partial<Tax$1>; getBasicCrossSellingStruct(productId: string, overrides?: Partial<ProductCrossSelling>): never; getBasicProductReviewStruct(productId: string, overrides?: Partial<ProductReview>): Partial<ProductReview>; } /** * Hides elements (via `visibility: hidden`). */ declare function hideElements(page: Page, selectors: (string | Locator)[]): Promise<void>; /** * Replaces text content or input values of elements with a given replacement string (default: "***"). * - Works for inputs, textareas, contenteditables and generic elements. * - Ensures frameworks see the change (dispatches input/change). * - Also masks placeholder so empty fields show replacement text in screenshots. */ declare function replaceElements(page: Page, selectors: (string | Locator)[], replaceWith?: string): Promise<void>; interface ReplaceTarget { selector: string | Locator; replaceWith?: string; } /** * Replaces elements individually based on an array of targets. * *@param page - Playwright page *@param targets - Array of objects containing selectors and optional replacement strings. */ declare function replaceElementsIndividually(page: Page, targets: ReplaceTarget[]): Promise<void>; /** * Calculates the ideal viewport dimensions for a Playwright test based on scrollable content, * header visibility, and optional configuration. Useful for dynamic screenshot sizing or * testing long-scrolling pages. * * This function: * - Optionally waits for a network request (`requestURL`) before continuing. * - Optionally waits f