@shopware-ag/acceptance-test-suite 2.3.2 → 2.3.4
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 +17 -11
- package/dist/index.d.ts +17 -11
- package/dist/index.mjs +22 -20
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -27,8 +27,8 @@ declare class AdminApiContext {
|
|
|
27
27
|
constructor(context: APIRequestContext, options: AdminApiContextOptions);
|
|
28
28
|
static create(options?: AdminApiContextOptions): Promise<AdminApiContext>;
|
|
29
29
|
private static createApiRequestContext;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
static authenticateWithClientCredentials(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
|
|
31
|
+
static authenticateWithUserPassword(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
|
|
32
32
|
isAuthenticated(): boolean;
|
|
33
33
|
get<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
|
|
34
34
|
post<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
|
|
@@ -157,7 +157,7 @@ type Tag = components['schemas']['Tag'] & {
|
|
|
157
157
|
type Rule = components['schemas']['Rule'] & {
|
|
158
158
|
id: string;
|
|
159
159
|
};
|
|
160
|
-
type Currency = components['schemas']['Currency'] & {
|
|
160
|
+
type Currency$1 = components['schemas']['Currency'] & {
|
|
161
161
|
id: string;
|
|
162
162
|
};
|
|
163
163
|
type Order = components['schemas']['Order'] & {
|
|
@@ -386,7 +386,7 @@ declare class TestDataService {
|
|
|
386
386
|
*
|
|
387
387
|
* @param isoCode - The ISO code of the currency, for example "EUR".
|
|
388
388
|
*/
|
|
389
|
-
getCurrency(isoCode: string): Promise<Currency>;
|
|
389
|
+
getCurrency(isoCode: string): Promise<Currency$1>;
|
|
390
390
|
/**
|
|
391
391
|
* Retrieves a rule based on its name.
|
|
392
392
|
*
|
|
@@ -480,7 +480,7 @@ declare class TestDataService {
|
|
|
480
480
|
active: boolean;
|
|
481
481
|
} & Partial<Category$1>;
|
|
482
482
|
getBasicCustomerStruct(salesChannelId: string, customerGroupId: string, languageId: string, countryId: string, defaultPaymentMethodId: string, salutationId: string, overrides?: Partial<Customer>): Partial<Customer>;
|
|
483
|
-
getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency, paymentMethod: PaymentMethod, shippingMethod: ShippingMethod, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>;
|
|
483
|
+
getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency$1, paymentMethod: PaymentMethod, shippingMethod: ShippingMethod, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>;
|
|
484
484
|
getBasicProductLineItemStruct(lineItem: SimpleLineItem): {
|
|
485
485
|
productId: string;
|
|
486
486
|
referencedId: string;
|
|
@@ -528,7 +528,7 @@ interface TestDataFixtureTypes {
|
|
|
528
528
|
|
|
529
529
|
interface HelperFixtureTypes {
|
|
530
530
|
IdProvider: IdProvider;
|
|
531
|
-
SaaSInstanceSetup: (
|
|
531
|
+
SaaSInstanceSetup: () => Promise<void>;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
534
|
interface StoreBaseConfig {
|
|
@@ -995,12 +995,18 @@ interface DataFixtureTypes {
|
|
|
995
995
|
interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, TestDataFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
|
|
998
|
+
type Language = components['schemas']['Currency'] & {
|
|
999
999
|
id: string;
|
|
1000
|
-
|
|
1001
|
-
|
|
1000
|
+
translationCode: components['schemas']['Locale'] & {
|
|
1001
|
+
id: string;
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<Language>;
|
|
1002
1005
|
declare const getSnippetSetId: (languageCode: string, adminApiContext: AdminApiContext) => Promise<string>;
|
|
1003
|
-
|
|
1006
|
+
type Currency = components['schemas']['Currency'] & {
|
|
1007
|
+
id: string;
|
|
1008
|
+
};
|
|
1009
|
+
declare const getCurrency: (isoCode: string, adminApiContext: AdminApiContext) => Promise<Currency>;
|
|
1004
1010
|
declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
1005
1011
|
declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
|
|
1006
1012
|
declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
@@ -1059,4 +1065,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
1059
1065
|
ValidateAccessibility: (pageName: string, assertViolations?: boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<void>;
|
|
1060
1066
|
}, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
|
|
1061
1067
|
|
|
1062
|
-
export { AdminPageObjects, type Category$1 as Category, type CreatedRecord, type Currency, type Customer, type CustomerAddress, type DataServiceOptions, type FixtureTypes, type Media, type Order, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PropertyGroup, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
|
|
1068
|
+
export { AdminPageObjects, type Category$1 as Category, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type DataServiceOptions, type FixtureTypes, type Media, type Order, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PropertyGroup, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ declare class AdminApiContext {
|
|
|
27
27
|
constructor(context: APIRequestContext, options: AdminApiContextOptions);
|
|
28
28
|
static create(options?: AdminApiContextOptions): Promise<AdminApiContext>;
|
|
29
29
|
private static createApiRequestContext;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
static authenticateWithClientCredentials(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
|
|
31
|
+
static authenticateWithUserPassword(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
|
|
32
32
|
isAuthenticated(): boolean;
|
|
33
33
|
get<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
|
|
34
34
|
post<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
|
|
@@ -157,7 +157,7 @@ type Tag = components['schemas']['Tag'] & {
|
|
|
157
157
|
type Rule = components['schemas']['Rule'] & {
|
|
158
158
|
id: string;
|
|
159
159
|
};
|
|
160
|
-
type Currency = components['schemas']['Currency'] & {
|
|
160
|
+
type Currency$1 = components['schemas']['Currency'] & {
|
|
161
161
|
id: string;
|
|
162
162
|
};
|
|
163
163
|
type Order = components['schemas']['Order'] & {
|
|
@@ -386,7 +386,7 @@ declare class TestDataService {
|
|
|
386
386
|
*
|
|
387
387
|
* @param isoCode - The ISO code of the currency, for example "EUR".
|
|
388
388
|
*/
|
|
389
|
-
getCurrency(isoCode: string): Promise<Currency>;
|
|
389
|
+
getCurrency(isoCode: string): Promise<Currency$1>;
|
|
390
390
|
/**
|
|
391
391
|
* Retrieves a rule based on its name.
|
|
392
392
|
*
|
|
@@ -480,7 +480,7 @@ declare class TestDataService {
|
|
|
480
480
|
active: boolean;
|
|
481
481
|
} & Partial<Category$1>;
|
|
482
482
|
getBasicCustomerStruct(salesChannelId: string, customerGroupId: string, languageId: string, countryId: string, defaultPaymentMethodId: string, salutationId: string, overrides?: Partial<Customer>): Partial<Customer>;
|
|
483
|
-
getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency, paymentMethod: PaymentMethod, shippingMethod: ShippingMethod, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>;
|
|
483
|
+
getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency$1, paymentMethod: PaymentMethod, shippingMethod: ShippingMethod, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>;
|
|
484
484
|
getBasicProductLineItemStruct(lineItem: SimpleLineItem): {
|
|
485
485
|
productId: string;
|
|
486
486
|
referencedId: string;
|
|
@@ -528,7 +528,7 @@ interface TestDataFixtureTypes {
|
|
|
528
528
|
|
|
529
529
|
interface HelperFixtureTypes {
|
|
530
530
|
IdProvider: IdProvider;
|
|
531
|
-
SaaSInstanceSetup: (
|
|
531
|
+
SaaSInstanceSetup: () => Promise<void>;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
534
|
interface StoreBaseConfig {
|
|
@@ -995,12 +995,18 @@ interface DataFixtureTypes {
|
|
|
995
995
|
interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, TestDataFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
|
|
998
|
+
type Language = components['schemas']['Currency'] & {
|
|
999
999
|
id: string;
|
|
1000
|
-
|
|
1001
|
-
|
|
1000
|
+
translationCode: components['schemas']['Locale'] & {
|
|
1001
|
+
id: string;
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<Language>;
|
|
1002
1005
|
declare const getSnippetSetId: (languageCode: string, adminApiContext: AdminApiContext) => Promise<string>;
|
|
1003
|
-
|
|
1006
|
+
type Currency = components['schemas']['Currency'] & {
|
|
1007
|
+
id: string;
|
|
1008
|
+
};
|
|
1009
|
+
declare const getCurrency: (isoCode: string, adminApiContext: AdminApiContext) => Promise<Currency>;
|
|
1004
1010
|
declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
1005
1011
|
declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
|
|
1006
1012
|
declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
|
|
@@ -1059,4 +1065,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
1059
1065
|
ValidateAccessibility: (pageName: string, assertViolations?: boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<void>;
|
|
1060
1066
|
}, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
|
|
1061
1067
|
|
|
1062
|
-
export { AdminPageObjects, type Category$1 as Category, type CreatedRecord, type Currency, type Customer, type CustomerAddress, type DataServiceOptions, type FixtureTypes, type Media, type Order, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PropertyGroup, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
|
|
1068
|
+
export { AdminPageObjects, type Category$1 as Category, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type DataServiceOptions, type FixtureTypes, type Media, type Order, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PropertyGroup, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
|
package/dist/index.mjs
CHANGED
|
@@ -20,10 +20,10 @@ const getLanguageData = async (languageCode, adminApiContext) => {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const result = await resp.json();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
if (result.data.length === 0) {
|
|
24
|
+
throw new Error(`Language ${languageCode} not found`);
|
|
25
|
+
}
|
|
26
|
+
return result.data[0];
|
|
27
27
|
};
|
|
28
28
|
const getSnippetSetId = async (languageCode, adminApiContext) => {
|
|
29
29
|
const resp = await adminApiContext.post("search/snippet-set", {
|
|
@@ -51,6 +51,9 @@ const getCurrency = async (isoCode, adminApiContext) => {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
const result = await resp.json();
|
|
54
|
+
if (result.data.length === 0) {
|
|
55
|
+
throw new Error(`Currency ${isoCode} not found`);
|
|
56
|
+
}
|
|
54
57
|
return result.data[0];
|
|
55
58
|
};
|
|
56
59
|
const getTaxId = async (adminApiContext) => {
|
|
@@ -217,7 +220,7 @@ const test$b = test$d.extend({
|
|
|
217
220
|
const lang = await requests.language;
|
|
218
221
|
const currency = await requests.currencyEUR;
|
|
219
222
|
await use({
|
|
220
|
-
enGBLocaleId: lang.
|
|
223
|
+
enGBLocaleId: lang.translationCode.id,
|
|
221
224
|
enGBLanguageId: lang.id,
|
|
222
225
|
storefrontTypeId: "8a243080f92e4c719546314b577cf82b",
|
|
223
226
|
eurCurrencyId: currency.id,
|
|
@@ -1841,23 +1844,22 @@ const test$6 = test$d.extend({
|
|
|
1841
1844
|
{ scope: "worker" }
|
|
1842
1845
|
],
|
|
1843
1846
|
SaaSInstanceSetup: [
|
|
1844
|
-
async ({ AdminApiContext }, use) => {
|
|
1845
|
-
const SetupInstance = async function SetupInstance2(
|
|
1846
|
-
await test$6.skip(!await isSaaSInstance(
|
|
1847
|
-
|
|
1847
|
+
async ({ AdminApiContext: context }, use) => {
|
|
1848
|
+
const SetupInstance = async function SetupInstance2() {
|
|
1849
|
+
await test$6.skip(!await isSaaSInstance(context), "Skipping SaaS setup, could not detect SaaS instance");
|
|
1850
|
+
expect(context.options.admin_username, "setup requires admin user credentials").toEqual(expect.any(String));
|
|
1851
|
+
expect(context.options.admin_password, "setup requires admin user credentials").toEqual(expect.any(String));
|
|
1852
|
+
const instanceStatusResponse = await context.get("./instance/status");
|
|
1848
1853
|
const instanceStatus = await instanceStatusResponse.json();
|
|
1849
1854
|
await expect(instanceStatus.tags, 'expect instance to have "ci" tag').toContain("ci");
|
|
1850
|
-
|
|
1851
|
-
await
|
|
1852
|
-
await
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
await
|
|
1857
|
-
await
|
|
1858
|
-
await page.getByRole("button", { name: "Log in" }).click();
|
|
1859
|
-
await page.getByRole("button", { name: "Launch your business" }).click();
|
|
1860
|
-
await expect(page.getByRole("button", { name: "Launch your business" })).toBeHidden();
|
|
1855
|
+
const currency = await getCurrency("USD", context);
|
|
1856
|
+
const language = await getLanguageData("en-US", context);
|
|
1857
|
+
await context.post(
|
|
1858
|
+
"./_actions/set-default-entities",
|
|
1859
|
+
{ data: { currencyId: currency.id, languageId: language.id } }
|
|
1860
|
+
);
|
|
1861
|
+
const token = await AdminApiContext.authenticateWithUserPassword(context.context, context.options);
|
|
1862
|
+
await context.post("./sbp/request-live-status", { headers: { Authorization: `Bearer ${token}` } });
|
|
1861
1863
|
};
|
|
1862
1864
|
await use(SetupInstance);
|
|
1863
1865
|
},
|