@shopware-ag/acceptance-test-suite 12.4.0 → 12.4.2
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 +33 -33
- package/dist/index.d.ts +33 -33
- package/dist/index.mjs +22 -23
- 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;
|
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;
|
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
|
}
|
|
@@ -3815,6 +3815,7 @@ class Actor {
|
|
|
3815
3815
|
}
|
|
3816
3816
|
expects = expect;
|
|
3817
3817
|
async a11y_checks(locator) {
|
|
3818
|
+
await locator.scrollIntoViewIfNeeded();
|
|
3818
3819
|
await locator.focus();
|
|
3819
3820
|
await expect(locator).toBeFocused();
|
|
3820
3821
|
await expect(locator).toHaveVisibleFocus();
|
|
@@ -3844,25 +3845,24 @@ class Actor {
|
|
|
3844
3845
|
const stepTitle = `${this.name} selects radio button ${inputLabel}`;
|
|
3845
3846
|
await test$e.step(stepTitle, async () => {
|
|
3846
3847
|
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");
|
|
3848
|
+
if (await desiredOption.isChecked()) {
|
|
3849
|
+
await this.a11y_checks(desiredOption);
|
|
3850
|
+
return;
|
|
3851
|
+
}
|
|
3852
|
+
let checkedRadio = radioGroup.getByRole("radio", { checked: true });
|
|
3853
|
+
if (!await checkedRadio.count()) {
|
|
3854
|
+
throw new Error("No radio button is selected by default.");
|
|
3855
|
+
}
|
|
3856
|
+
const maxIterations = await radioGroup.getByRole("radio").count();
|
|
3857
|
+
let iterations = 0;
|
|
3858
|
+
while (!await desiredOption.isChecked()) {
|
|
3859
|
+
if (iterations >= maxIterations) {
|
|
3860
|
+
throw new Error(`Could not reach radio button "${inputLabel}" via keyboard navigation.`);
|
|
3865
3861
|
}
|
|
3862
|
+
await this.presses(checkedRadio, "ArrowDown");
|
|
3863
|
+
await this.page.waitForLoadState("domcontentloaded");
|
|
3864
|
+
checkedRadio = radioGroup.getByRole("radio", { checked: true });
|
|
3865
|
+
iterations++;
|
|
3866
3866
|
}
|
|
3867
3867
|
await this.a11y_checks(desiredOption);
|
|
3868
3868
|
});
|
|
@@ -11740,7 +11740,6 @@ const ProceedFromProductToCheckout = test$e.extend({
|
|
|
11740
11740
|
ProceedFromProductToCheckout: async ({ ShopCustomer, StorefrontProductDetail, StorefrontCheckoutConfirm }, use) => {
|
|
11741
11741
|
const task = () => {
|
|
11742
11742
|
return async function ProceedFromProductToCheckout2() {
|
|
11743
|
-
await StorefrontProductDetail.offCanvasCartGoToCheckoutButton.scrollIntoViewIfNeeded();
|
|
11744
11743
|
await ShopCustomer.presses(StorefrontProductDetail.offCanvasCartGoToCheckoutButton);
|
|
11745
11744
|
await StorefrontCheckoutConfirm.page.waitForURL("**/checkout/confirm", { waitUntil: "commit" });
|
|
11746
11745
|
await ShopCustomer.expects(StorefrontCheckoutConfirm.headline).toBeVisible();
|
|
@@ -11757,8 +11756,8 @@ const CloseTheOffCanvasCart = test$e.extend({
|
|
|
11757
11756
|
}, use) => {
|
|
11758
11757
|
const task = () => {
|
|
11759
11758
|
return async function CloseTheOffCanvasCart2() {
|
|
11760
|
-
await StorefrontOffCanvasCart.continueShoppingButton.scrollIntoViewIfNeeded();
|
|
11761
11759
|
await ShopCustomer.presses(StorefrontOffCanvasCart.continueShoppingButton);
|
|
11760
|
+
await ShopCustomer.expects(StorefrontOffCanvasCart.continueShoppingButton).not.toBeVisible();
|
|
11762
11761
|
};
|
|
11763
11762
|
};
|
|
11764
11763
|
await use(task);
|