@shopware-ag/acceptance-test-suite 12.3.0 → 12.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +35 -33
- package/dist/index.d.ts +35 -33
- package/dist/index.mjs +38 -22
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -459,8 +459,40 @@ declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminA
|
|
|
459
459
|
declare const getPromotionWithDiscount: (promotionId: string, adminApiContext: AdminApiContext) => Promise<Promotion>;
|
|
460
460
|
declare const updateAdminUser: (adminUserId: string, adminApiContext: AdminApiContext, data: Record<string, string | boolean>) => Promise<void>;
|
|
461
461
|
|
|
462
|
+
interface RequestOptions<PAYLOAD> {
|
|
463
|
+
[key: string]: unknown;
|
|
464
|
+
data?: PAYLOAD;
|
|
465
|
+
}
|
|
466
|
+
interface StoreUser {
|
|
467
|
+
email: string;
|
|
468
|
+
password: string;
|
|
469
|
+
}
|
|
470
|
+
interface StoreApiContextOptions {
|
|
471
|
+
'app_url'?: string;
|
|
472
|
+
'sw-access-key'?: string;
|
|
473
|
+
'sw-context-token'?: string;
|
|
474
|
+
ignoreHTTPSErrors?: boolean;
|
|
475
|
+
}
|
|
476
|
+
declare class StoreApiContext {
|
|
477
|
+
private context;
|
|
478
|
+
private readonly options;
|
|
479
|
+
private static readonly defaultOptions;
|
|
480
|
+
constructor(context: APIRequestContext, options: StoreApiContextOptions);
|
|
481
|
+
static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
|
|
482
|
+
private static createContext;
|
|
483
|
+
login(user: StoreUser): Promise<{
|
|
484
|
+
[key: string]: string;
|
|
485
|
+
}>;
|
|
486
|
+
get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
487
|
+
post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
488
|
+
patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
489
|
+
delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
490
|
+
fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
491
|
+
head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
492
|
+
}
|
|
493
|
+
|
|
462
494
|
declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
|
|
463
|
-
declare const isThemeCompiled: (context:
|
|
495
|
+
declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>;
|
|
464
496
|
|
|
465
497
|
declare function createRandomImage(width?: number, height?: number): Image;
|
|
466
498
|
declare function encodeImage(image: Image): Buffer<ArrayBuffer>;
|
|
@@ -4156,38 +4188,6 @@ declare function setCurrentContext(context: Record<string, unknown> | null): voi
|
|
|
4156
4188
|
declare function getCurrentContext(): Record<string, unknown> | null;
|
|
4157
4189
|
declare function translate(key: TranslationKey, options?: Record<string, unknown>): string;
|
|
4158
4190
|
|
|
4159
|
-
interface RequestOptions<PAYLOAD> {
|
|
4160
|
-
[key: string]: unknown;
|
|
4161
|
-
data?: PAYLOAD;
|
|
4162
|
-
}
|
|
4163
|
-
interface StoreUser {
|
|
4164
|
-
email: string;
|
|
4165
|
-
password: string;
|
|
4166
|
-
}
|
|
4167
|
-
interface StoreApiContextOptions {
|
|
4168
|
-
'app_url'?: string;
|
|
4169
|
-
'sw-access-key'?: string;
|
|
4170
|
-
'sw-context-token'?: string;
|
|
4171
|
-
ignoreHTTPSErrors?: boolean;
|
|
4172
|
-
}
|
|
4173
|
-
declare class StoreApiContext {
|
|
4174
|
-
private context;
|
|
4175
|
-
private readonly options;
|
|
4176
|
-
private static readonly defaultOptions;
|
|
4177
|
-
constructor(context: APIRequestContext, options: StoreApiContextOptions);
|
|
4178
|
-
static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
|
|
4179
|
-
private static createContext;
|
|
4180
|
-
login(user: StoreUser): Promise<{
|
|
4181
|
-
[key: string]: string;
|
|
4182
|
-
}>;
|
|
4183
|
-
get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4184
|
-
post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4185
|
-
patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4186
|
-
delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4187
|
-
fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4188
|
-
head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
4191
|
interface Email {
|
|
4192
4192
|
fromName: string;
|
|
4193
4193
|
fromAddress: string;
|
|
@@ -6299,6 +6299,8 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
|
|
|
6299
6299
|
AddNewAddress: Task;
|
|
6300
6300
|
} & {
|
|
6301
6301
|
AddProductToCart: Task;
|
|
6302
|
+
} & {
|
|
6303
|
+
CloseTheOffCanvasCart: Task;
|
|
6302
6304
|
} & {
|
|
6303
6305
|
ChangeProductQuantity: Task;
|
|
6304
6306
|
} & {
|
package/dist/index.d.ts
CHANGED
|
@@ -459,8 +459,40 @@ declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminA
|
|
|
459
459
|
declare const getPromotionWithDiscount: (promotionId: string, adminApiContext: AdminApiContext) => Promise<Promotion>;
|
|
460
460
|
declare const updateAdminUser: (adminUserId: string, adminApiContext: AdminApiContext, data: Record<string, string | boolean>) => Promise<void>;
|
|
461
461
|
|
|
462
|
+
interface RequestOptions<PAYLOAD> {
|
|
463
|
+
[key: string]: unknown;
|
|
464
|
+
data?: PAYLOAD;
|
|
465
|
+
}
|
|
466
|
+
interface StoreUser {
|
|
467
|
+
email: string;
|
|
468
|
+
password: string;
|
|
469
|
+
}
|
|
470
|
+
interface StoreApiContextOptions {
|
|
471
|
+
'app_url'?: string;
|
|
472
|
+
'sw-access-key'?: string;
|
|
473
|
+
'sw-context-token'?: string;
|
|
474
|
+
ignoreHTTPSErrors?: boolean;
|
|
475
|
+
}
|
|
476
|
+
declare class StoreApiContext {
|
|
477
|
+
private context;
|
|
478
|
+
private readonly options;
|
|
479
|
+
private static readonly defaultOptions;
|
|
480
|
+
constructor(context: APIRequestContext, options: StoreApiContextOptions);
|
|
481
|
+
static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
|
|
482
|
+
private static createContext;
|
|
483
|
+
login(user: StoreUser): Promise<{
|
|
484
|
+
[key: string]: string;
|
|
485
|
+
}>;
|
|
486
|
+
get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
487
|
+
post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
488
|
+
patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
489
|
+
delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
490
|
+
fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
491
|
+
head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
492
|
+
}
|
|
493
|
+
|
|
462
494
|
declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
|
|
463
|
-
declare const isThemeCompiled: (context:
|
|
495
|
+
declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>;
|
|
464
496
|
|
|
465
497
|
declare function createRandomImage(width?: number, height?: number): Image;
|
|
466
498
|
declare function encodeImage(image: Image): Buffer<ArrayBuffer>;
|
|
@@ -4156,38 +4188,6 @@ declare function setCurrentContext(context: Record<string, unknown> | null): voi
|
|
|
4156
4188
|
declare function getCurrentContext(): Record<string, unknown> | null;
|
|
4157
4189
|
declare function translate(key: TranslationKey, options?: Record<string, unknown>): string;
|
|
4158
4190
|
|
|
4159
|
-
interface RequestOptions<PAYLOAD> {
|
|
4160
|
-
[key: string]: unknown;
|
|
4161
|
-
data?: PAYLOAD;
|
|
4162
|
-
}
|
|
4163
|
-
interface StoreUser {
|
|
4164
|
-
email: string;
|
|
4165
|
-
password: string;
|
|
4166
|
-
}
|
|
4167
|
-
interface StoreApiContextOptions {
|
|
4168
|
-
'app_url'?: string;
|
|
4169
|
-
'sw-access-key'?: string;
|
|
4170
|
-
'sw-context-token'?: string;
|
|
4171
|
-
ignoreHTTPSErrors?: boolean;
|
|
4172
|
-
}
|
|
4173
|
-
declare class StoreApiContext {
|
|
4174
|
-
private context;
|
|
4175
|
-
private readonly options;
|
|
4176
|
-
private static readonly defaultOptions;
|
|
4177
|
-
constructor(context: APIRequestContext, options: StoreApiContextOptions);
|
|
4178
|
-
static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
|
|
4179
|
-
private static createContext;
|
|
4180
|
-
login(user: StoreUser): Promise<{
|
|
4181
|
-
[key: string]: string;
|
|
4182
|
-
}>;
|
|
4183
|
-
get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4184
|
-
post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4185
|
-
patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4186
|
-
delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4187
|
-
fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4188
|
-
head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
4191
|
interface Email {
|
|
4192
4192
|
fromName: string;
|
|
4193
4193
|
fromAddress: string;
|
|
@@ -6299,6 +6299,8 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
|
|
|
6299
6299
|
AddNewAddress: Task;
|
|
6300
6300
|
} & {
|
|
6301
6301
|
AddProductToCart: Task;
|
|
6302
|
+
} & {
|
|
6303
|
+
CloseTheOffCanvasCart: Task;
|
|
6302
6304
|
} & {
|
|
6303
6305
|
ChangeProductQuantity: Task;
|
|
6304
6306
|
} & {
|
package/dist/index.mjs
CHANGED
|
@@ -3748,7 +3748,7 @@ const test$b = test$e.extend({
|
|
|
3748
3748
|
setCurrentContext(null);
|
|
3749
3749
|
await AdminApiContext.delete(`user/${uuid}`);
|
|
3750
3750
|
},
|
|
3751
|
-
StorefrontPage: async ({ DefaultSalesChannel, SalesChannelBaseConfig, browser, AdminApiContext, InstanceMeta, CustomTranslationResources }, use) => {
|
|
3751
|
+
StorefrontPage: async ({ DefaultSalesChannel, SalesChannelBaseConfig, browser, AdminApiContext, StoreApiContext, InstanceMeta, CustomTranslationResources }, use) => {
|
|
3752
3752
|
const { url, salesChannel } = DefaultSalesChannel;
|
|
3753
3753
|
const locale = getLocale();
|
|
3754
3754
|
const languageHelper = await LanguageHelper.createInstance(locale, CustomTranslationResources);
|
|
@@ -3760,13 +3760,13 @@ const test$b = test$e.extend({
|
|
|
3760
3760
|
LanguageHelper.setForContext(context, languageHelper);
|
|
3761
3761
|
setCurrentContext(context);
|
|
3762
3762
|
let page;
|
|
3763
|
-
if (!await isThemeCompiled(
|
|
3763
|
+
if (!await isThemeCompiled(StoreApiContext, DefaultSalesChannel.url)) {
|
|
3764
3764
|
test$e.slow();
|
|
3765
3765
|
await AdminApiContext.post(`./_action/theme/${SalesChannelBaseConfig.defaultThemeId}/assign/${salesChannel.id}`);
|
|
3766
3766
|
await clearDelayedCache(AdminApiContext);
|
|
3767
3767
|
page = await context.newPage();
|
|
3768
3768
|
if (InstanceMeta.isSaaS) {
|
|
3769
|
-
while (!await isThemeCompiled(
|
|
3769
|
+
while (!await isThemeCompiled(StoreApiContext, DefaultSalesChannel.url)) {
|
|
3770
3770
|
await clearDelayedCache(AdminApiContext);
|
|
3771
3771
|
await page.waitForTimeout(4e3);
|
|
3772
3772
|
}
|
|
@@ -3844,25 +3844,24 @@ class Actor {
|
|
|
3844
3844
|
const stepTitle = `${this.name} selects radio button ${inputLabel}`;
|
|
3845
3845
|
await test$e.step(stepTitle, async () => {
|
|
3846
3846
|
const desiredOption = radioGroup.getByRole("radio", { name: inputLabel });
|
|
3847
|
-
if (
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
const step = defaultOptionIndex < desiredOptionIndex ? 1 : -1;
|
|
3861
|
-
const inputKey = step === 1 ? "ArrowDown" : "ArrowUp";
|
|
3862
|
-
for (let i = defaultOptionIndex; i !== desiredOptionIndex; i += step) {
|
|
3863
|
-
await this.presses(options[i].locator, inputKey);
|
|
3864
|
-
await this.page.waitForLoadState("domcontentloaded");
|
|
3847
|
+
if (await desiredOption.isChecked()) {
|
|
3848
|
+
await this.a11y_checks(desiredOption);
|
|
3849
|
+
return;
|
|
3850
|
+
}
|
|
3851
|
+
let checkedRadio = radioGroup.getByRole("radio", { checked: true });
|
|
3852
|
+
if (!await checkedRadio.count()) {
|
|
3853
|
+
throw new Error("No radio button is selected by default.");
|
|
3854
|
+
}
|
|
3855
|
+
const maxIterations = await radioGroup.getByRole("radio").count();
|
|
3856
|
+
let iterations = 0;
|
|
3857
|
+
while (!await desiredOption.isChecked()) {
|
|
3858
|
+
if (iterations >= maxIterations) {
|
|
3859
|
+
throw new Error(`Could not reach radio button "${inputLabel}" via keyboard navigation.`);
|
|
3865
3860
|
}
|
|
3861
|
+
await this.presses(checkedRadio, "ArrowDown");
|
|
3862
|
+
await this.page.waitForLoadState("domcontentloaded");
|
|
3863
|
+
checkedRadio = radioGroup.getByRole("radio", { checked: true });
|
|
3864
|
+
iterations++;
|
|
3866
3865
|
}
|
|
3867
3866
|
await this.a11y_checks(desiredOption);
|
|
3868
3867
|
});
|
|
@@ -6750,7 +6749,8 @@ let ProductDetail$1 = class ProductDetail {
|
|
|
6750
6749
|
constructor(page) {
|
|
6751
6750
|
this.page = page;
|
|
6752
6751
|
this.addToCartButton = page.getByRole("button", { name: translate("storefront:product:addToCart") });
|
|
6753
|
-
|
|
6752
|
+
const form = page.locator(".buy-widget:not(.d-none)");
|
|
6753
|
+
this.quantitySelect = form.getByLabel(translate("storefront:product:quantity"), { exact: true });
|
|
6754
6754
|
this.productSingleImage = page.locator(".gallery-slider-single-image");
|
|
6755
6755
|
this.productSinglePrice = page.locator(".product-detail-price");
|
|
6756
6756
|
this.productPriceRangesRow = page.locator(".product-block-prices-row");
|
|
@@ -11749,6 +11749,21 @@ const ProceedFromProductToCheckout = test$e.extend({
|
|
|
11749
11749
|
}
|
|
11750
11750
|
});
|
|
11751
11751
|
|
|
11752
|
+
const CloseTheOffCanvasCart = test$e.extend({
|
|
11753
|
+
CloseTheOffCanvasCart: async ({
|
|
11754
|
+
ShopCustomer,
|
|
11755
|
+
StorefrontOffCanvasCart
|
|
11756
|
+
}, use) => {
|
|
11757
|
+
const task = () => {
|
|
11758
|
+
return async function CloseTheOffCanvasCart2() {
|
|
11759
|
+
await StorefrontOffCanvasCart.continueShoppingButton.scrollIntoViewIfNeeded();
|
|
11760
|
+
await ShopCustomer.presses(StorefrontOffCanvasCart.continueShoppingButton);
|
|
11761
|
+
};
|
|
11762
|
+
};
|
|
11763
|
+
await use(task);
|
|
11764
|
+
}
|
|
11765
|
+
});
|
|
11766
|
+
|
|
11752
11767
|
const ProceedFromCartToCheckout = test$e.extend({
|
|
11753
11768
|
ProceedFromCartToCheckout: async ({
|
|
11754
11769
|
ShopCustomer,
|
|
@@ -12046,6 +12061,7 @@ const test$3 = mergeTests(
|
|
|
12046
12061
|
ChangeStorefrontCurrency,
|
|
12047
12062
|
AddNewAddress,
|
|
12048
12063
|
AddProductToCart,
|
|
12064
|
+
CloseTheOffCanvasCart,
|
|
12049
12065
|
ChangeProductQuantity,
|
|
12050
12066
|
ProceedFromProductToCheckout,
|
|
12051
12067
|
ProceedFromCartToCheckout,
|