@shopware-ag/acceptance-test-suite
Version:
Shopware Acceptance Test Suite
1,368 lines (1,350 loc) • 110 kB
TypeScript
import * as axe_core from 'axe-core';
import * as _playwright_test from '@playwright/test';
import { APIRequestContext, APIResponse, Page, BrowserContext, Locator } from '@playwright/test';
export * from '@playwright/test';
import { components } from '@shopware/api-client/admin-api-types';
import { Image } from 'image-js';
type Task = (...args: any[]) => () => Promise<void>;
interface RequestOptions$1<PAYLOAD> {
[key: string]: unknown;
data?: PAYLOAD;
}
interface AdminApiContextOptions {
app_url?: string;
client_id?: string;
client_secret?: string;
access_token?: string;
admin_username?: string;
admin_password?: string;
ignoreHTTPSErrors?: boolean;
}
declare class AdminApiContext {
context: APIRequestContext;
readonly options: AdminApiContextOptions;
private static readonly defaultOptions;
constructor(context: APIRequestContext, options: AdminApiContextOptions);
static create(options?: AdminApiContextOptions): Promise<AdminApiContext>;
private static createApiRequestContext;
static authenticateWithClientCredentials(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
static authenticateWithUserPassword(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
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;
}
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>;
}
interface Email {
fromName: string;
fromAddress: string;
toName: string;
toAddress: string;
subject: string;
emailId: string;
}
declare class MailpitApiContext {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Fetches email headers based on the recipient's email address.
* @param email - The email address of the recipient.
* @returns An Email object containing the email headers.
*/
getEmailHeaders(email: string): Promise<Email>;
/**
* Retrieves the body content of the email as an HTML string.
* @param email - The email address of the recipient.
* @returns A promise that resolves to the HTML content of the email.
*/
getEmailBody(email: string): Promise<string>;
/**
* Generates the full email content, combining headers and body.
* @param email - The email address to fetch headers for.
* @returns A promise that resolves to the full email content as a string.
*/
generateEmailContent(email: string): Promise<string>;
/**
* Retrieves the plain text content of the email.
* @param email - The email address of the recipient.
* @returns A promise that resolves to the plain text content of the email.
*/
getRenderMessageTxt(email: string): Promise<string>;
/**
* Extracts the first URL found in the plain text content of the latest email.
* @param email - The email address of the recipient.
* @returns A promise that resolves to the first URL found in the email content.
* @throws An error if no URL is found in the email content.
*/
getLinkFromMail(email: string): Promise<string>;
/**
* Deletes a specific email by ID if provided, or deletes all emails if no ID is provided.
* @param emailId - The ID of the email to delete (optional).
*/
deleteMail(emailId?: string): Promise<void>;
/**
* Creates a new MailpitApiContext instance with the appropriate configuration.
* @param baseURL - The base URL for the API.
* @returns A promise that resolves to a MailpitApiContext instance.
*/
static create(baseURL: string): Promise<MailpitApiContext>;
}
interface ApiContextTypes {
AdminApiContext: AdminApiContext;
StoreApiContext: StoreApiContext;
MailpitApiContext: MailpitApiContext;
}
interface PageContextTypes {
AdminPage: Page;
StorefrontPage: Page;
InstallPage: Page;
page: Page;
context: BrowserContext;
}
declare class Actor {
page: Page;
readonly name: string;
baseURL: string | undefined;
constructor(name: string, page: Page, baseURL?: string);
expects: _playwright_test.Expect<{}>;
attemptsTo(task: () => Promise<void>): Promise<void>;
goesTo(url: string, forceReload?: boolean): Promise<void>;
private camelCaseToLowerCase;
}
interface ActorFixtureTypes {
ShopCustomer: Actor;
ShopAdmin: Actor;
}
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;
}
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 CustomerAddress = components['schemas']['CustomerAddress'] & {
id: string;
};
interface Address {
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 = 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;
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;
}
];
};
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 enum RuleType {
shippingAvailability = "shippingMethodAvailabilityRule",
taxAvailability = "taxProviderAvailabilityRule",
paymentAvailability = "paymentMethodAvailabilityRule",
promotionOrder = "promotionOrderRule",
promotionCustomer = "promotionCustomerRule",
promotionCart = "promotionCartRule"
}
interface RuleAssignmentEntity {
entity: {
id: string;
name: string;
};
ruleType: RuleType;
}
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;
}
];
}
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;
/**
* 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>;
/**
* Creates a new media resource containing a text file.
*
* @param content - The content of the text file.
*/
createMediaTXT(content?: string): Promise<Media>;
/**
* Creates a new empty media resource.
* This method is mostly used to combine it with a certain file upload.
*/
createMediaResource(): Promise<Media>;
/**
* 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 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 payment method 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>;
/**
* 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<void>;
/**
* 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<_playwright_test.APIResponse>;
/**
* 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<_playwright_test.APIResponse>;
/**
* 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>;
/**
* 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 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>;
/**
* 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_test.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>[][];
/**
* @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>;
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 | undefined;
payload: {
code: string | undefined;
};
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>;
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>;
}
interface TestDataFixtureTypes {
TestDataService: TestDataService;
}
type FeaturesType = Record<string, boolean>;
interface HelperFixtureTypes {
IdProvider: IdProvider;
SaaSInstanceSetup: () => Promise<void>;
InstanceMeta: {
version: string;
isSaaS: boolean;
features: FeaturesType;
};
}
interface StoreBaseConfig {
storefrontTypeId: string;
enGBLocaleId: string;
enGBLanguageId: string;
eurCurrencyId: string;
defaultCurrencyId: string;
defaultLanguageId: string;
invoicePaymentMethodId: string;
defaultShippingMethod: string;
taxId: string;
deCountryId: string;
enGBSnippetSetId: string;
defaultThemeId: string;
appUrl: string | undefined;
adminUrl: string;
}
interface DefaultSalesChannelTypes {
SalesChannelBaseConfig: StoreBaseConfig;
DefaultSalesChannel: {
salesChannel: SalesChannel;
customer: Customer;
url: string;
};
DefaultStorefront: {
salesChannel: SalesChannel;
customer: Customer;
url: string;
};
}
interface Country {
id: string;
}
interface Currency$1 {
id: string;
}
interface Language$1 {
id: string;
translationCode: {
id: string;
};
}
interface PaymentMethod {
id: string;
}
interface ShippingMethod {
id: string;
}
interface SnippetSet {
id: string;
}
interface Tax {
id: string;
}
interface Theme {
id: string;
}
interface ShopwareDataFixtureTypes {
Country: Country;
Currency: Currency$1;
Language: Language$1;
PaymentMethod: PaymentMethod;
ShippingMethod: ShippingMethod;
SnippetSet: SnippetSet;
Tax: Tax;
Theme: Theme;
}
interface PageObject {
readonly page: Page;
url(...args: unknown[]): string;
}
declare class Home implements PageObject {
readonly page: Page;
readonly categoryTitle: Locator;
readonly accountMenuButton: Locator;
readonly closeGuestSessionButton: Locator;
readonly productImages: Locator;
readonly productListItems: Locator;
readonly loader: Locator;
readonly productVariantCharacteristicsOptions: Locator;
/**
* @deprecated Use 'Header/languagesDropdown' instead
*/
readonly languagesDropdown: Locator;
/**
* @deprecated Use 'Header/languagesMenuOptions' instead
*/
readonly languagesMenuOptions: Locator;
/**
* @deprecated Use 'Header/currenciesDropdown' instead
*/
readonly currenciesDropdown: Locator;
/**
* @deprecated Use 'Header/currenciesMenuOptions' instead
*/
readonly currenciesMenuOptions: Locator;
readonly consentOnlyTechnicallyRequiredButton: Locator;
readonly consentConfigureButton: Locator;
readonly consentAcceptAllCookiesButton: Locator;
readonly consentCookiePreferences: Locator;
readonly consentCookiePermissionContent: Locator;
readonly consentDialog: Locator;
readonly consentDialogTechnicallyRequiredCheckbox: Locator;
readonly consentDialogStatisticsCheckbox: Locator;
/**
* @deprecated Use 'consentDialogMarketingCheckbox' instead
*/
readonly consentDialogMarketingdCheckbox: Locator;
readonly consentDialogMarketingCheckbox: Locator;
readonly consentDialogAcceptAllCookiesButton: Locator;
readonly consentDialogSaveButton: Locator;
readonly consentCookieBannerContainer: Locator;
readonly offcanvasBackdrop: Locator;
/**
* @deprecated Use 'Header/mainNavigationLink' instead
*/
readonly mainNavigationLink: Locator;
/**
* @deprecated Use 'Footer/contactFormLink' instead
*/
readonly contactFormLink: Locator;
/**
* @deprecated Use 'Header/wishlistIcon' instead
*/
readonly wishlistIcon: Locator;
/**
* @deprecated Use 'Header/wishlistBasket' instead
*/
readonly wishlistBasket: Locator;
readonly filterMultiSelect: Locator;
readonly manufacturerFilter: Locator;
readonly propertyFilters: Locator;
readonly priceFilterButton: Locator;
readonly resetAllButton: Locator;
readonly freeShippingFilter: Locator;
readonly productList: Locator;
readonly productItemNames: Locator;
readonly productRatingButton: Locator;
readonly productRatingList: Locator;
constructor(page: Page);
getRatingItemLocatorByRating(rating: number): Promise<Locator>;
getFilterItemByFilterName(filterName: string): Promise<Locator>;
getFilterButtonByFilterName(filterName: string): Promise<Locator>;
getMenuItemByCategoryName(categoryName: string): Promise<Record<string, Locator>>;
/**
* @deprecated - use getListingItemByProductName instead
*/
getListingItemByProductId(productId: string): Promise<Record<string, Locator>>;
getListingItemByProductName(productListingName: string): Promise<Record<string, Locator>>;
url(): string;
}
declare class ProductDetail$1 implements PageObject {
readonly page: Page;
readonly addToCartButton: Locator;
readonly quantitySelect: Locator;
readonly productSingleImage: Locator;
readonly productSinglePrice: Locator;
readonly productPriceRangesRow: Locator;
readonly productListingPriceBadge: Locator;
readonly productListingPrice: Locator;
readonly productListingPricePercentage: Locator;
readonly offCanvasCartTitle: Locator;
readonly offCanvasCart: Locator;
readonly offCanvasCartGoToCheckoutButton: Locator;
readonly offCanvasLineItemImages: Locator;
readonly offCanvasSummaryTotalPrice: Locator;
readonly offCanvas: Locator;
readonly wishlistAddedButton: Locator;
readonly wishlistNotAddedButton: Locator;
readonly productDetailConfigurator: Locator;
readonly productDetailConfiguratorGroupTitle: Locator;
readonly productDetailConfiguratorOptionInputs: Locator;
readonly productName: Locator;
readonly reviewsTab: Locator;
readonly reviewTeaserButton: Locator;
readonly reviewTeaserText: Locator;
readonly reviewListingItems: Locator;
readonly reviewEmptyListingText: Locator;
readonly reviewLoginForm: Locator;
readonly forgottenPasswordLink: Locator;
readonly reviewForm: Locator;
readonly reviewRatingPoints: Locator;
readonly reviewRatingText: Locator;
readonly reviewSubmitMessage: Locator;
readonly reviewCounter: Locator;
readonly reviewItemRatingPoints: Locator;
readonly reviewItemTitle: Locator;
readonly reviewReviewTextInput: Locator;
readonly reviewItemContent: Locator;
readonly reviewLoginButton: Locator;
readonly reviewEmailInput: Locator;
readonly reviewPasswordInput: Locator;
readonly reviewTitleInput: Locator;
readonly reviewSubmitButton: Locator;
readonly productReviewsLink: Locator;
readonly productReviewRating: Locator;
constructor(page: Page);
getReviewFilterRowOptionsByName(filterOptionName: string): Promise<{
reviewFilterOptionCheckbox: Locator;
reviewFilterOptionTe