@shopware-ag/acceptance-test-suite 2.2.0 → 2.3.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 CHANGED
@@ -2,6 +2,7 @@ import * as _playwright_test from '@playwright/test';
2
2
  import { APIRequestContext, APIResponse, Page, Locator } from '@playwright/test';
3
3
  export * from '@playwright/test';
4
4
  import * as playwright_core from 'playwright-core';
5
+ import { Page as Page$1 } from 'playwright-core';
5
6
  import { components } from '@shopware/api-client/admin-api-types';
6
7
  import { Image } from 'image-js';
7
8
 
@@ -70,6 +71,31 @@ declare class StoreApiContext {
70
71
  head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
71
72
  }
72
73
 
74
+ interface ApiContextTypes {
75
+ AdminApiContext: AdminApiContext;
76
+ StoreApiContext: StoreApiContext;
77
+ }
78
+
79
+ interface PageContextTypes {
80
+ AdminPage: Page;
81
+ StorefrontPage: Page;
82
+ }
83
+
84
+ declare class Actor {
85
+ page: Page;
86
+ readonly name: string;
87
+ constructor(name: string, page: Page);
88
+ expects: _playwright_test.Expect<{}>;
89
+ attemptsTo(task: () => Promise<void>): Promise<void>;
90
+ goesTo(url: string): Promise<void>;
91
+ private camelCaseToLowerCase;
92
+ }
93
+
94
+ interface ActorFixtureTypes {
95
+ ShopCustomer: Actor;
96
+ ShopAdmin: Actor;
97
+ }
98
+
73
99
  interface IdPair {
74
100
  id: string;
75
101
  uuid: string;
@@ -168,7 +194,7 @@ type Promotion = components['schemas']['Promotion'] & {
168
194
 
169
195
  interface CreatedRecord {
170
196
  resource: string;
171
- id: string;
197
+ payload: Record<string, string>;
172
198
  }
173
199
  interface SimpleLineItem {
174
200
  product: Product;
@@ -203,7 +229,25 @@ declare class TestDataService {
203
229
  readonly defaultLanguageId: string;
204
230
  readonly defaultCountryId: string;
205
231
  readonly defaultCustomerGroupId: string;
232
+ /**
233
+ * Configures if an automated cleanup of the data should be executed.
234
+ *
235
+ * @private
236
+ */
206
237
  private shouldCleanUp;
238
+ /**
239
+ * Configuration of higher priority entities for the cleanup operation.
240
+ * These entities will be deleted before others.
241
+ * This will prevent restricted delete operations of associated entities.
242
+ *
243
+ * @private
244
+ */
245
+ private highPriorityEntities;
246
+ /**
247
+ * A registry of all created records.
248
+ *
249
+ * @private
250
+ */
207
251
  private createdRecords;
208
252
  constructor(AdminApiClient: AdminApiContext, IdProvider: IdProvider, options: DataServiceOptions);
209
253
  /**
@@ -404,9 +448,9 @@ declare class TestDataService {
404
448
  * All entities added to the registry will be deleted by the cleanup call.
405
449
  *
406
450
  * @param resource - The resource name of the entity.
407
- * @param id - The uuid of the entity.
451
+ * @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity.
408
452
  */
409
- addCreatedRecord(resource: string, id: string): void;
453
+ addCreatedRecord(resource: string, payload: string | Record<string, string>): void;
410
454
  /**
411
455
  * Set the configuration of automated data clean up.
412
456
  * If set to "true" the data service will delete all entities created by it.
@@ -479,32 +523,10 @@ declare class TestDataService {
479
523
  getBasicPromotionStruct(salesChannelId?: string, overrides?: Partial<Promotion>): Partial<Promotion>;
480
524
  }
481
525
 
482
- interface ApiContextTypes {
483
- AdminApiContext: AdminApiContext;
484
- StoreApiContext: StoreApiContext;
526
+ interface TestDataFixtureTypes {
485
527
  TestDataService: TestDataService;
486
528
  }
487
529
 
488
- interface PageContextTypes {
489
- AdminPage: Page;
490
- StorefrontPage: Page;
491
- }
492
-
493
- declare class Actor {
494
- page: Page;
495
- readonly name: string;
496
- constructor(name: string, page: Page);
497
- expects: _playwright_test.Expect<{}>;
498
- attemptsTo(task: () => Promise<void>): Promise<void>;
499
- goesTo(url: string): Promise<void>;
500
- private camelCaseToLowerCase;
501
- }
502
-
503
- interface ActorFixtureTypes {
504
- ShopCustomer: Actor;
505
- ShopAdmin: Actor;
506
- }
507
-
508
530
  interface HelperFixtureTypes {
509
531
  IdProvider: IdProvider;
510
532
  SaaSInstanceSetup: () => Promise<void>;
@@ -531,7 +553,6 @@ interface DefaultSalesChannelTypes {
531
553
  salesChannel: SalesChannel;
532
554
  customer: Customer;
533
555
  url: string;
534
- themeSeed: string | null;
535
556
  };
536
557
  DefaultStorefront: {
537
558
  salesChannel: SalesChannel;
@@ -972,7 +993,7 @@ interface DataFixtureTypes {
972
993
  TagData: components['schemas']['Tag'];
973
994
  }
974
995
 
975
- interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
996
+ interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, TestDataFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
976
997
  }
977
998
 
978
999
  declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<{
@@ -999,6 +1020,7 @@ type OrderStatus = 'cancel' | 'complete' | 'reopen' | 'process';
999
1020
  declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
1000
1021
 
1001
1022
  declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
1023
+ declare const isThemeCompiled: (page: Page$1) => Promise<boolean>;
1002
1024
 
1003
1025
  declare function createRandomImage(width?: number, height?: number): Image;
1004
1026
 
@@ -1038,4 +1060,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1038
1060
  ValidateAccessibility: (pageName: string, assertViolations?: boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<void>;
1039
1061
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
1040
1062
 
1041
- 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, setOrderStatus, test };
1063
+ 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 };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as _playwright_test from '@playwright/test';
2
2
  import { APIRequestContext, APIResponse, Page, Locator } from '@playwright/test';
3
3
  export * from '@playwright/test';
4
4
  import * as playwright_core from 'playwright-core';
5
+ import { Page as Page$1 } from 'playwright-core';
5
6
  import { components } from '@shopware/api-client/admin-api-types';
6
7
  import { Image } from 'image-js';
7
8
 
@@ -70,6 +71,31 @@ declare class StoreApiContext {
70
71
  head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
71
72
  }
72
73
 
74
+ interface ApiContextTypes {
75
+ AdminApiContext: AdminApiContext;
76
+ StoreApiContext: StoreApiContext;
77
+ }
78
+
79
+ interface PageContextTypes {
80
+ AdminPage: Page;
81
+ StorefrontPage: Page;
82
+ }
83
+
84
+ declare class Actor {
85
+ page: Page;
86
+ readonly name: string;
87
+ constructor(name: string, page: Page);
88
+ expects: _playwright_test.Expect<{}>;
89
+ attemptsTo(task: () => Promise<void>): Promise<void>;
90
+ goesTo(url: string): Promise<void>;
91
+ private camelCaseToLowerCase;
92
+ }
93
+
94
+ interface ActorFixtureTypes {
95
+ ShopCustomer: Actor;
96
+ ShopAdmin: Actor;
97
+ }
98
+
73
99
  interface IdPair {
74
100
  id: string;
75
101
  uuid: string;
@@ -168,7 +194,7 @@ type Promotion = components['schemas']['Promotion'] & {
168
194
 
169
195
  interface CreatedRecord {
170
196
  resource: string;
171
- id: string;
197
+ payload: Record<string, string>;
172
198
  }
173
199
  interface SimpleLineItem {
174
200
  product: Product;
@@ -203,7 +229,25 @@ declare class TestDataService {
203
229
  readonly defaultLanguageId: string;
204
230
  readonly defaultCountryId: string;
205
231
  readonly defaultCustomerGroupId: string;
232
+ /**
233
+ * Configures if an automated cleanup of the data should be executed.
234
+ *
235
+ * @private
236
+ */
206
237
  private shouldCleanUp;
238
+ /**
239
+ * Configuration of higher priority entities for the cleanup operation.
240
+ * These entities will be deleted before others.
241
+ * This will prevent restricted delete operations of associated entities.
242
+ *
243
+ * @private
244
+ */
245
+ private highPriorityEntities;
246
+ /**
247
+ * A registry of all created records.
248
+ *
249
+ * @private
250
+ */
207
251
  private createdRecords;
208
252
  constructor(AdminApiClient: AdminApiContext, IdProvider: IdProvider, options: DataServiceOptions);
209
253
  /**
@@ -404,9 +448,9 @@ declare class TestDataService {
404
448
  * All entities added to the registry will be deleted by the cleanup call.
405
449
  *
406
450
  * @param resource - The resource name of the entity.
407
- * @param id - The uuid of the entity.
451
+ * @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity.
408
452
  */
409
- addCreatedRecord(resource: string, id: string): void;
453
+ addCreatedRecord(resource: string, payload: string | Record<string, string>): void;
410
454
  /**
411
455
  * Set the configuration of automated data clean up.
412
456
  * If set to "true" the data service will delete all entities created by it.
@@ -479,32 +523,10 @@ declare class TestDataService {
479
523
  getBasicPromotionStruct(salesChannelId?: string, overrides?: Partial<Promotion>): Partial<Promotion>;
480
524
  }
481
525
 
482
- interface ApiContextTypes {
483
- AdminApiContext: AdminApiContext;
484
- StoreApiContext: StoreApiContext;
526
+ interface TestDataFixtureTypes {
485
527
  TestDataService: TestDataService;
486
528
  }
487
529
 
488
- interface PageContextTypes {
489
- AdminPage: Page;
490
- StorefrontPage: Page;
491
- }
492
-
493
- declare class Actor {
494
- page: Page;
495
- readonly name: string;
496
- constructor(name: string, page: Page);
497
- expects: _playwright_test.Expect<{}>;
498
- attemptsTo(task: () => Promise<void>): Promise<void>;
499
- goesTo(url: string): Promise<void>;
500
- private camelCaseToLowerCase;
501
- }
502
-
503
- interface ActorFixtureTypes {
504
- ShopCustomer: Actor;
505
- ShopAdmin: Actor;
506
- }
507
-
508
530
  interface HelperFixtureTypes {
509
531
  IdProvider: IdProvider;
510
532
  SaaSInstanceSetup: () => Promise<void>;
@@ -531,7 +553,6 @@ interface DefaultSalesChannelTypes {
531
553
  salesChannel: SalesChannel;
532
554
  customer: Customer;
533
555
  url: string;
534
- themeSeed: string | null;
535
556
  };
536
557
  DefaultStorefront: {
537
558
  salesChannel: SalesChannel;
@@ -972,7 +993,7 @@ interface DataFixtureTypes {
972
993
  TagData: components['schemas']['Tag'];
973
994
  }
974
995
 
975
- interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
996
+ interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, TestDataFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
976
997
  }
977
998
 
978
999
  declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<{
@@ -999,6 +1020,7 @@ type OrderStatus = 'cancel' | 'complete' | 'reopen' | 'process';
999
1020
  declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
1000
1021
 
1001
1022
  declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
1023
+ declare const isThemeCompiled: (page: Page$1) => Promise<boolean>;
1002
1024
 
1003
1025
  declare function createRandomImage(width?: number, height?: number): Image;
1004
1026
 
@@ -1038,4 +1060,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1038
1060
  ValidateAccessibility: (pageName: string, assertViolations?: boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<void>;
1039
1061
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
1040
1062
 
1041
- 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, setOrderStatus, test };
1063
+ 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 };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { test as test$c, expect, request, mergeTests } from '@playwright/test';
1
+ import { test as test$d, expect, request, mergeTests } from '@playwright/test';
2
2
  export * from '@playwright/test';
3
3
  import { Image } from 'image-js';
4
4
  import crypto from 'crypto';
@@ -204,8 +204,20 @@ const isSaaSInstance = async (adminApiContext) => {
204
204
  const instanceFeatures = await adminApiContext.get("./instance/features");
205
205
  return instanceFeatures.ok();
206
206
  };
207
+ const isThemeCompiled = async (page) => {
208
+ let allCSSFound = false;
209
+ const listener = (request) => {
210
+ if (request.url().includes("all.css")) {
211
+ allCSSFound = true;
212
+ }
213
+ };
214
+ page.on("request", listener);
215
+ await page.goto("./", { waitUntil: "load" });
216
+ page.off("request", listener);
217
+ return allCSSFound;
218
+ };
207
219
 
208
- const test$a = test$c.extend({
220
+ const test$b = test$d.extend({
209
221
  SalesChannelBaseConfig: [
210
222
  async ({ AdminApiContext }, use) => {
211
223
  const requests = {
@@ -247,26 +259,6 @@ const test$a = test$c.extend({
247
259
  const { uuid: domainUuid } = IdProvider.getWorkerDerivedStableId("domain");
248
260
  const { uuid: customerUuid } = IdProvider.getWorkerDerivedStableId("customer");
249
261
  const baseUrl = `${SalesChannelBaseConfig.appUrl}test-${uuid}/`;
250
- const response = await AdminApiContext.post(`./search/system-config`, {
251
- data: {
252
- page: 1,
253
- limit: 1,
254
- filter: [
255
- {
256
- type: "equals",
257
- field: "salesChannelId",
258
- value: uuid
259
- },
260
- {
261
- type: "equals",
262
- field: "configurationKey",
263
- value: "storefront.themeSeed"
264
- }
265
- ]
266
- }
267
- });
268
- const currentConfig = await response.json();
269
- const themeSeed = currentConfig.total > 0 ? currentConfig.data[0].configurationValue : null;
270
262
  await AdminApiContext.delete(`./customer/${customerUuid}`);
271
263
  const ordersResp = await AdminApiContext.post(`./search/order`, {
272
264
  data: {
@@ -313,7 +305,6 @@ const test$a = test$c.extend({
313
305
  }
314
306
  }
315
307
  }
316
- await AdminApiContext.delete(`./sales-channel/${uuid}`);
317
308
  const syncResp = await AdminApiContext.post("./_action/sync", {
318
309
  data: {
319
310
  "write-sales-channel": {
@@ -360,16 +351,6 @@ const test$a = test$c.extend({
360
351
  }
361
352
  });
362
353
  expect(syncResp.ok()).toBeTruthy();
363
- if (themeSeed) {
364
- await AdminApiContext.post("./system-config", {
365
- data: {
366
- id: uuid,
367
- salesChannelId: uuid,
368
- configurationKey: "storefront.themeSeed",
369
- configurationValue: themeSeed
370
- }
371
- });
372
- }
373
354
  const salesChannelPromise = AdminApiContext.get(`./sales-channel/${uuid}`);
374
355
  const salutationResponse = await AdminApiContext.get(`./salutation`);
375
356
  const salutations = await salutationResponse.json();
@@ -418,8 +399,7 @@ const test$a = test$c.extend({
418
399
  await use({
419
400
  salesChannel: salesChannel.data,
420
401
  customer: { ...customer.data, password: customerData.password },
421
- url: baseUrl,
422
- themeSeed
402
+ url: baseUrl
423
403
  });
424
404
  },
425
405
  { scope: "worker" }
@@ -428,26 +408,19 @@ const test$a = test$c.extend({
428
408
  async ({ browser, AdminApiContext, DefaultSalesChannel, SalesChannelBaseConfig }, use) => {
429
409
  const { id: uuid } = DefaultSalesChannel.salesChannel;
430
410
  const isSaasInstance = await isSaaSInstance(AdminApiContext);
431
- await AdminApiContext.post(
432
- `./_action/theme/${SalesChannelBaseConfig.defaultThemeId}/assign/${uuid}`
433
- );
434
- test$c.slow();
435
- if (isSaasInstance) {
436
- const tmpContext = await browser.newContext();
437
- const tmpPage = await tmpContext.newPage();
438
- for (let i = 0; i < 100; ++i) {
439
- let latestTimestamp = (/* @__PURE__ */ new Date()).toISOString();
440
- const response = await AdminApiContext.get(`./notification/message?limit=10&latestTimestamp=${latestTimestamp}`);
441
- const json = await response.json();
442
- if (json.timestamp) {
443
- latestTimestamp = json.timestamp;
444
- }
445
- if (json.notifications.find((n) => n.message.includes(`Compilation for sales channel ${DefaultSalesChannel.salesChannel.name} completed`))) {
446
- tmpPage.close();
447
- tmpContext.close();
448
- break;
411
+ const tmpContext = await browser.newContext({
412
+ baseURL: DefaultSalesChannel.url
413
+ });
414
+ const tmpPage = await tmpContext.newPage();
415
+ if (!await isThemeCompiled(tmpPage)) {
416
+ test$d.slow();
417
+ await AdminApiContext.post(
418
+ `./_action/theme/${SalesChannelBaseConfig.defaultThemeId}/assign/${uuid}`
419
+ );
420
+ if (isSaasInstance) {
421
+ while (!await isThemeCompiled(tmpPage)) {
422
+ await tmpPage.waitForTimeout(2e3);
449
423
  }
450
- await tmpPage.waitForTimeout(1e3);
451
424
  }
452
425
  }
453
426
  await use({
@@ -643,6 +616,177 @@ __publicField$r(_StoreApiContext, "defaultOptions", {
643
616
  });
644
617
  let StoreApiContext = _StoreApiContext;
645
618
 
619
+ const test$a = test$d.extend({
620
+ AdminApiContext: [
621
+ async ({}, use) => {
622
+ const adminApiContext = await AdminApiContext.create();
623
+ await use(adminApiContext);
624
+ },
625
+ { scope: "worker" }
626
+ ],
627
+ StoreApiContext: [
628
+ async ({ DefaultSalesChannel }, use) => {
629
+ const options = {
630
+ app_url: process.env["APP_URL"],
631
+ "sw-access-key": DefaultSalesChannel.salesChannel.accessKey,
632
+ ignoreHTTPSErrors: true
633
+ };
634
+ const storeApiContext = await StoreApiContext.create(options);
635
+ await use(storeApiContext);
636
+ },
637
+ { scope: "worker" }
638
+ ]
639
+ });
640
+
641
+ async function mockApiCalls(page) {
642
+ await page.route("**/api/notification/message*", (route) => route.fulfill({
643
+ status: 200,
644
+ contentType: "application/json",
645
+ body: JSON.stringify({ notifications: [], timestamp: "2024-06-19 06:23:25.040" })
646
+ }));
647
+ await page.route("**/api/_action/store/plugin/search*", (route) => route.fulfill({
648
+ status: 200,
649
+ contentType: "application/json",
650
+ body: JSON.stringify({ items: [], total: 0 })
651
+ }));
652
+ await page.route("**/api/_action/store/updates*", (route) => route.fulfill({
653
+ status: 200,
654
+ contentType: "application/json",
655
+ body: JSON.stringify({ items: [], total: 0 })
656
+ }));
657
+ await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
658
+ status: 200,
659
+ contentType: "application/json",
660
+ body: JSON.stringify({ items: [], total: 0 })
661
+ }));
662
+ await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
663
+ status: 200,
664
+ contentType: "application/json",
665
+ body: process.env.SBP_SHOP_INFO_JSON ?? "{}"
666
+ }));
667
+ await page.route("**/api/sbp/bookableplans*", (route) => route.fulfill({
668
+ status: 200,
669
+ contentType: "application/json",
670
+ body: process.env.SBP_BOOKABLE_PLANS_JSON ?? "{}"
671
+ }));
672
+ }
673
+
674
+ const test$9 = test$d.extend({
675
+ AdminPage: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, browser }, use) => {
676
+ const context = await browser.newContext({
677
+ baseURL: SalesChannelBaseConfig.adminUrl,
678
+ serviceWorkers: "block"
679
+ });
680
+ const page = await context.newPage();
681
+ await mockApiCalls(page);
682
+ const { id, uuid } = IdProvider.getIdPair();
683
+ const adminUser = {
684
+ id: uuid,
685
+ username: `admin_${id}`,
686
+ firstName: `${id} admin`,
687
+ lastName: `${id} admin`,
688
+ localeId: SalesChannelBaseConfig.enGBLocaleId,
689
+ email: `admin_${id}@example.com`,
690
+ timezone: "Europe/Berlin",
691
+ password: "shopware",
692
+ admin: true
693
+ };
694
+ const response = await AdminApiContext.post("user", {
695
+ data: adminUser
696
+ });
697
+ expect(response.ok()).toBeTruthy();
698
+ await page.goto("#/login");
699
+ await page.addStyleTag({
700
+ content: `
701
+ .sf-toolbar {
702
+ width: 0 !important;
703
+ height: 0 !important;
704
+ display: none !important;
705
+ pointer-events: none !important;
706
+ }
707
+ `.trim()
708
+ });
709
+ await page.getByLabel(/Username|Email address/).fill(adminUser.username);
710
+ await page.getByLabel("Password").fill(adminUser.password);
711
+ await page.getByRole("button", { name: "Log in" }).click();
712
+ await expect(page.locator("css=.sw-admin-menu__header-logo").first()).toBeVisible({
713
+ timeout: 2e4
714
+ });
715
+ await expect(page.locator(".sw-skeleton")).toHaveCount(0, {
716
+ timeout: 1e4
717
+ });
718
+ await expect(page.locator(".sw-loader")).toHaveCount(0, {
719
+ timeout: 1e4
720
+ });
721
+ await use(page);
722
+ await page.close();
723
+ await context.close();
724
+ const cleanupResponse = await AdminApiContext.delete(`user/${uuid}`);
725
+ expect(cleanupResponse.ok()).toBeTruthy();
726
+ },
727
+ StorefrontPage: async ({ DefaultStorefront, browser }, use) => {
728
+ const { url } = DefaultStorefront;
729
+ const context = await browser.newContext({
730
+ baseURL: url
731
+ });
732
+ const page = await context.newPage();
733
+ await page.goto("./", { waitUntil: "load" });
734
+ await use(page);
735
+ await page.close();
736
+ await context.close();
737
+ }
738
+ });
739
+
740
+ var __defProp$q = Object.defineProperty;
741
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
742
+ var __publicField$q = (obj, key, value) => {
743
+ __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
744
+ return value;
745
+ };
746
+ class Actor {
747
+ constructor(name, page) {
748
+ __publicField$q(this, "page");
749
+ __publicField$q(this, "name");
750
+ __publicField$q(this, "expects", expect);
751
+ this.name = name;
752
+ this.page = page;
753
+ }
754
+ async attemptsTo(task) {
755
+ const stepTitle = `${this.name} attempts to ${this.camelCaseToLowerCase(task.name)}`;
756
+ await test$d.step(stepTitle, async () => await task());
757
+ }
758
+ async goesTo(url) {
759
+ const stepTitle = `${this.name} navigates to "${url}"`;
760
+ await test$d.step(stepTitle, async () => {
761
+ await this.page.goto(url);
762
+ await this.page.addStyleTag({
763
+ content: `
764
+ .sf-toolbar {
765
+ width: 0 !important;
766
+ height: 0 !important;
767
+ display: none !important;
768
+ pointer-events: none !important;
769
+ }
770
+ `.trim()
771
+ });
772
+ });
773
+ }
774
+ camelCaseToLowerCase(str) {
775
+ return str.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);
776
+ }
777
+ }
778
+
779
+ const test$8 = test$d.extend({
780
+ ShopCustomer: async ({ StorefrontPage }, use) => {
781
+ const shopCustomer = new Actor("Shop customer", StorefrontPage);
782
+ await use(shopCustomer);
783
+ },
784
+ ShopAdmin: async ({ AdminPage }, use) => {
785
+ const shopAdmin = new Actor("Shop administrator", AdminPage);
786
+ await use(shopAdmin);
787
+ }
788
+ });
789
+
646
790
  function createRandomImage(width = 800, height = 600) {
647
791
  const buffer = Buffer.alloc(width * height * 4);
648
792
  let i = 0;
@@ -652,27 +796,45 @@ function createRandomImage(width = 800, height = 600) {
652
796
  return new Image(width, height, buffer);
653
797
  }
654
798
 
655
- var __defProp$q = Object.defineProperty;
656
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
657
- var __publicField$q = (obj, key, value) => {
658
- __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
799
+ var __defProp$p = Object.defineProperty;
800
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
801
+ var __publicField$p = (obj, key, value) => {
802
+ __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
659
803
  return value;
660
804
  };
661
805
  class TestDataService {
662
806
  constructor(AdminApiClient, IdProvider, options) {
663
- __publicField$q(this, "AdminApiClient");
664
- __publicField$q(this, "IdProvider");
665
- __publicField$q(this, "namePrefix", "Test-");
666
- __publicField$q(this, "nameSuffix", "");
667
- __publicField$q(this, "defaultSalesChannel");
668
- __publicField$q(this, "defaultTaxId");
669
- __publicField$q(this, "defaultCurrencyId");
670
- __publicField$q(this, "defaultCategoryId");
671
- __publicField$q(this, "defaultLanguageId");
672
- __publicField$q(this, "defaultCountryId");
673
- __publicField$q(this, "defaultCustomerGroupId");
674
- __publicField$q(this, "shouldCleanUp", true);
675
- __publicField$q(this, "createdRecords", []);
807
+ __publicField$p(this, "AdminApiClient");
808
+ __publicField$p(this, "IdProvider");
809
+ __publicField$p(this, "namePrefix", "Test-");
810
+ __publicField$p(this, "nameSuffix", "");
811
+ __publicField$p(this, "defaultSalesChannel");
812
+ __publicField$p(this, "defaultTaxId");
813
+ __publicField$p(this, "defaultCurrencyId");
814
+ __publicField$p(this, "defaultCategoryId");
815
+ __publicField$p(this, "defaultLanguageId");
816
+ __publicField$p(this, "defaultCountryId");
817
+ __publicField$p(this, "defaultCustomerGroupId");
818
+ /**
819
+ * Configures if an automated cleanup of the data should be executed.
820
+ *
821
+ * @private
822
+ */
823
+ __publicField$p(this, "shouldCleanUp", true);
824
+ /**
825
+ * Configuration of higher priority entities for the cleanup operation.
826
+ * These entities will be deleted before others.
827
+ * This will prevent restricted delete operations of associated entities.
828
+ *
829
+ * @private
830
+ */
831
+ __publicField$p(this, "highPriorityEntities", ["order", "product"]);
832
+ /**
833
+ * A registry of all created records.
834
+ *
835
+ * @private
836
+ */
837
+ __publicField$p(this, "createdRecords", []);
676
838
  this.AdminApiClient = AdminApiClient;
677
839
  this.IdProvider = IdProvider;
678
840
  this.defaultSalesChannel = options.defaultSalesChannel;
@@ -738,8 +900,7 @@ class TestDataService {
738
900
  async createDigitalProduct(content = "Lorem ipsum dolor", overrides = {}, taxId = this.defaultTaxId, currencyId = this.defaultCurrencyId) {
739
901
  const product = await this.createBasicProduct(overrides, taxId, currencyId);
740
902
  const media = await this.createMediaTXT(content);
741
- const productDownload = await this.assignProductDownload(product.id, media.id);
742
- this.addCreatedRecord("product-download", productDownload.id);
903
+ await this.assignProductDownload(product.id, media.id);
743
904
  return product;
744
905
  }
745
906
  /**
@@ -849,7 +1010,7 @@ class TestDataService {
849
1010
  data: Object.assign({}, colorPropertyGroup, overrides)
850
1011
  });
851
1012
  const { data: propertyGroup } = await propertyGroupResponse.json();
852
- this.addCreatedRecord("property-group", propertyGroup.id);
1013
+ this.addCreatedRecord("property_group", propertyGroup.id);
853
1014
  return propertyGroup;
854
1015
  }
855
1016
  /**
@@ -876,7 +1037,7 @@ class TestDataService {
876
1037
  data: Object.assign({}, textPropertyGroup, overrides)
877
1038
  });
878
1039
  const { data: propertyGroup } = await propertyGroupResponse.json();
879
- this.addCreatedRecord("property-group", propertyGroup.id);
1040
+ this.addCreatedRecord("property_group", propertyGroup.id);
880
1041
  return propertyGroup;
881
1042
  }
882
1043
  /**
@@ -1217,10 +1378,18 @@ class TestDataService {
1217
1378
  * All entities added to the registry will be deleted by the cleanup call.
1218
1379
  *
1219
1380
  * @param resource - The resource name of the entity.
1220
- * @param id - The uuid of the entity.
1381
+ * @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity.
1221
1382
  */
1222
- addCreatedRecord(resource, id) {
1223
- this.createdRecords.push({ resource, id });
1383
+ addCreatedRecord(resource, payload) {
1384
+ const res = resource.replace("-", "_");
1385
+ if (typeof payload === "string") {
1386
+ this.createdRecords.push({
1387
+ resource: res,
1388
+ payload: { id: payload }
1389
+ });
1390
+ } else {
1391
+ this.createdRecords.push({ resource: res, payload });
1392
+ }
1224
1393
  }
1225
1394
  /**
1226
1395
  * Set the configuration of automated data clean up.
@@ -1238,16 +1407,31 @@ class TestDataService {
1238
1407
  if (!this.shouldCleanUp) {
1239
1408
  return Promise.reject();
1240
1409
  }
1410
+ const priorityDeleteOperations = {};
1241
1411
  const deleteOperations = {};
1242
1412
  this.createdRecords.forEach((record) => {
1243
- if (!deleteOperations[`delete-${record.resource}`]) {
1244
- deleteOperations[`delete-${record.resource}`] = {
1245
- entity: record.resource,
1246
- action: "delete",
1247
- payload: []
1248
- };
1413
+ if (this.highPriorityEntities.includes(record.resource)) {
1414
+ if (!priorityDeleteOperations[`delete-${record.resource}`]) {
1415
+ priorityDeleteOperations[`delete-${record.resource}`] = {
1416
+ entity: record.resource,
1417
+ action: "delete",
1418
+ payload: []
1419
+ };
1420
+ }
1421
+ priorityDeleteOperations[`delete-${record.resource}`].payload.push(record.payload);
1422
+ } else {
1423
+ if (!deleteOperations[`delete-${record.resource}`]) {
1424
+ deleteOperations[`delete-${record.resource}`] = {
1425
+ entity: record.resource,
1426
+ action: "delete",
1427
+ payload: []
1428
+ };
1429
+ }
1430
+ deleteOperations[`delete-${record.resource}`].payload.push(record.payload);
1249
1431
  }
1250
- deleteOperations[`delete-${record.resource}`].payload.push({ id: record.id });
1432
+ });
1433
+ await this.AdminApiClient.post("_action/sync", {
1434
+ data: priorityDeleteOperations
1251
1435
  });
1252
1436
  return await this.AdminApiClient.post("_action/sync", {
1253
1437
  data: deleteOperations
@@ -1608,190 +1792,19 @@ class TestDataService {
1608
1792
  }
1609
1793
  }
1610
1794
 
1611
- const test$9 = test$c.extend({
1612
- AdminApiContext: [
1613
- async ({}, use) => {
1614
- const adminApiContext = await AdminApiContext.create();
1615
- await use(adminApiContext);
1616
- },
1617
- { scope: "worker" }
1618
- ],
1619
- StoreApiContext: [
1620
- async ({ DefaultSalesChannel }, use) => {
1621
- const options = {
1622
- app_url: process.env["APP_URL"],
1623
- "sw-access-key": DefaultSalesChannel.salesChannel.accessKey,
1624
- ignoreHTTPSErrors: true
1625
- };
1626
- const storeApiContext = await StoreApiContext.create(options);
1627
- await use(storeApiContext);
1628
- },
1629
- { scope: "worker" }
1630
- ],
1631
- TestDataService: [
1632
- async ({ AdminApiContext: AdminApiContext2, IdProvider, DefaultSalesChannel, SalesChannelBaseConfig }, use) => {
1633
- const DataService = new TestDataService(AdminApiContext2, IdProvider, {
1634
- defaultSalesChannel: DefaultSalesChannel.salesChannel,
1635
- defaultTaxId: SalesChannelBaseConfig.taxId,
1636
- defaultCurrencyId: SalesChannelBaseConfig.defaultCurrencyId,
1637
- defaultCategoryId: DefaultSalesChannel.salesChannel.navigationCategoryId,
1638
- defaultLanguageId: DefaultSalesChannel.salesChannel.languageId,
1639
- defaultCountryId: DefaultSalesChannel.salesChannel.countryId,
1640
- defaultCustomerGroupId: DefaultSalesChannel.salesChannel.customerGroupId
1641
- });
1642
- await use(DataService);
1643
- await DataService.cleanUp();
1644
- },
1645
- { scope: "worker" }
1646
- ]
1647
- });
1648
-
1649
- async function mockApiCalls(page) {
1650
- await page.route("**/api/notification/message*", (route) => route.fulfill({
1651
- status: 200,
1652
- contentType: "application/json",
1653
- body: JSON.stringify({ notifications: [], timestamp: "2024-06-19 06:23:25.040" })
1654
- }));
1655
- await page.route("**/api/_action/store/plugin/search*", (route) => route.fulfill({
1656
- status: 200,
1657
- contentType: "application/json",
1658
- body: JSON.stringify({ items: [], total: 0 })
1659
- }));
1660
- await page.route("**/api/_action/store/updates*", (route) => route.fulfill({
1661
- status: 200,
1662
- contentType: "application/json",
1663
- body: JSON.stringify({ items: [], total: 0 })
1664
- }));
1665
- await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
1666
- status: 200,
1667
- contentType: "application/json",
1668
- body: JSON.stringify({ items: [], total: 0 })
1669
- }));
1670
- await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
1671
- status: 200,
1672
- contentType: "application/json",
1673
- body: process.env.SBP_SHOP_INFO_JSON ?? "{}"
1674
- }));
1675
- await page.route("**/api/sbp/bookableplans*", (route) => route.fulfill({
1676
- status: 200,
1677
- contentType: "application/json",
1678
- body: process.env.SBP_BOOKABLE_PLANS_JSON ?? "{}"
1679
- }));
1680
- }
1681
-
1682
- const test$8 = test$c.extend({
1683
- AdminPage: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, browser }, use) => {
1684
- const context = await browser.newContext({
1685
- baseURL: SalesChannelBaseConfig.adminUrl,
1686
- serviceWorkers: "block"
1795
+ const test$7 = test$d.extend({
1796
+ TestDataService: async ({ AdminApiContext, IdProvider, DefaultSalesChannel, SalesChannelBaseConfig }, use) => {
1797
+ const DataService = new TestDataService(AdminApiContext, IdProvider, {
1798
+ defaultSalesChannel: DefaultSalesChannel.salesChannel,
1799
+ defaultTaxId: SalesChannelBaseConfig.taxId,
1800
+ defaultCurrencyId: SalesChannelBaseConfig.defaultCurrencyId,
1801
+ defaultCategoryId: DefaultSalesChannel.salesChannel.navigationCategoryId,
1802
+ defaultLanguageId: DefaultSalesChannel.salesChannel.languageId,
1803
+ defaultCountryId: DefaultSalesChannel.salesChannel.countryId,
1804
+ defaultCustomerGroupId: DefaultSalesChannel.salesChannel.customerGroupId
1687
1805
  });
1688
- const page = await context.newPage();
1689
- await mockApiCalls(page);
1690
- const { id, uuid } = IdProvider.getIdPair();
1691
- const adminUser = {
1692
- id: uuid,
1693
- username: `admin_${id}`,
1694
- firstName: `${id} admin`,
1695
- lastName: `${id} admin`,
1696
- localeId: SalesChannelBaseConfig.enGBLocaleId,
1697
- email: `admin_${id}@example.com`,
1698
- timezone: "Europe/Berlin",
1699
- password: "shopware",
1700
- admin: true
1701
- };
1702
- const response = await AdminApiContext.post("user", {
1703
- data: adminUser
1704
- });
1705
- expect(response.ok()).toBeTruthy();
1706
- await page.goto("#/login");
1707
- await page.addStyleTag({
1708
- content: `
1709
- .sf-toolbar {
1710
- width: 0 !important;
1711
- height: 0 !important;
1712
- display: none !important;
1713
- pointer-events: none !important;
1714
- }
1715
- `.trim()
1716
- });
1717
- await page.getByLabel(/Username|Email address/).fill(adminUser.username);
1718
- await page.getByLabel("Password").fill(adminUser.password);
1719
- await page.getByRole("button", { name: "Log in" }).click();
1720
- await expect(page.locator("css=.sw-admin-menu__header-logo").first()).toBeVisible({
1721
- timeout: 2e4
1722
- });
1723
- await expect(page.locator(".sw-skeleton")).toHaveCount(0, {
1724
- timeout: 1e4
1725
- });
1726
- await expect(page.locator(".sw-loader")).toHaveCount(0, {
1727
- timeout: 1e4
1728
- });
1729
- await use(page);
1730
- await page.close();
1731
- await context.close();
1732
- const cleanupResponse = await AdminApiContext.delete(`user/${uuid}`);
1733
- expect(cleanupResponse.ok()).toBeTruthy();
1734
- },
1735
- StorefrontPage: async ({ DefaultStorefront, browser }, use) => {
1736
- const { url } = DefaultStorefront;
1737
- const context = await browser.newContext({
1738
- baseURL: url
1739
- });
1740
- const page = await context.newPage();
1741
- await page.goto("./", { waitUntil: "load" });
1742
- await use(page);
1743
- await page.close();
1744
- await context.close();
1745
- }
1746
- });
1747
-
1748
- var __defProp$p = Object.defineProperty;
1749
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1750
- var __publicField$p = (obj, key, value) => {
1751
- __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
1752
- return value;
1753
- };
1754
- class Actor {
1755
- constructor(name, page) {
1756
- __publicField$p(this, "page");
1757
- __publicField$p(this, "name");
1758
- __publicField$p(this, "expects", expect);
1759
- this.name = name;
1760
- this.page = page;
1761
- }
1762
- async attemptsTo(task) {
1763
- const stepTitle = `${this.name} attempts to ${this.camelCaseToLowerCase(task.name)}`;
1764
- await test$c.step(stepTitle, async () => await task());
1765
- }
1766
- async goesTo(url) {
1767
- const stepTitle = `${this.name} navigates to "${url}"`;
1768
- await test$c.step(stepTitle, async () => {
1769
- await this.page.goto(url);
1770
- await this.page.addStyleTag({
1771
- content: `
1772
- .sf-toolbar {
1773
- width: 0 !important;
1774
- height: 0 !important;
1775
- display: none !important;
1776
- pointer-events: none !important;
1777
- }
1778
- `.trim()
1779
- });
1780
- });
1781
- }
1782
- camelCaseToLowerCase(str) {
1783
- return str.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);
1784
- }
1785
- }
1786
-
1787
- const test$7 = test$c.extend({
1788
- ShopCustomer: async ({ StorefrontPage }, use) => {
1789
- const shopCustomer = new Actor("Shop customer", StorefrontPage);
1790
- await use(shopCustomer);
1791
- },
1792
- ShopAdmin: async ({ AdminPage }, use) => {
1793
- const shopAdmin = new Actor("Shop administrator", AdminPage);
1794
- await use(shopAdmin);
1806
+ await use(DataService);
1807
+ await DataService.cleanUp();
1795
1808
  }
1796
1809
  });
1797
1810
 
@@ -1833,7 +1846,7 @@ class IdProvider {
1833
1846
  }
1834
1847
  }
1835
1848
 
1836
- const test$6 = test$c.extend({
1849
+ const test$6 = test$d.extend({
1837
1850
  IdProvider: [
1838
1851
  async ({}, use, workerInfo) => {
1839
1852
  const seed = process.env.SHOPWARE_ACCESS_KEY_ID || process.env.SHOPWARE_ADMIN_PASSWORD || "test-suite";
@@ -2318,7 +2331,7 @@ const StorefrontPageObjects = {
2318
2331
  Search,
2319
2332
  SearchSuggest
2320
2333
  };
2321
- const test$5 = test$c.extend({
2334
+ const test$5 = test$d.extend({
2322
2335
  StorefrontHome: async ({ StorefrontPage }, use) => {
2323
2336
  await use(new Home(StorefrontPage));
2324
2337
  },
@@ -2711,7 +2724,7 @@ const AdminPageObjects = {
2711
2724
  Dashboard,
2712
2725
  DataSharing
2713
2726
  };
2714
- const test$4 = test$c.extend({
2727
+ const test$4 = test$d.extend({
2715
2728
  AdminProductDetail: async ({ AdminPage }, use) => {
2716
2729
  await use(new ProductDetail(AdminPage));
2717
2730
  },
@@ -2741,7 +2754,7 @@ const test$4 = test$c.extend({
2741
2754
  }
2742
2755
  });
2743
2756
 
2744
- const ProductData = test$c.extend({
2757
+ const ProductData = test$d.extend({
2745
2758
  ProductData: async ({ IdProvider, SalesChannelBaseConfig, AdminApiContext, DefaultSalesChannel }, use) => {
2746
2759
  const { id: productId, uuid: productUuid } = IdProvider.getIdPair();
2747
2760
  const productName = `Product_test_${productId}`;
@@ -2802,7 +2815,7 @@ const ProductData = test$c.extend({
2802
2815
  }
2803
2816
  });
2804
2817
 
2805
- const CategoryData = test$c.extend({
2818
+ const CategoryData = test$d.extend({
2806
2819
  CategoryData: async ({ IdProvider, AdminApiContext, DefaultSalesChannel, ProductData }, use) => {
2807
2820
  const { id: categoryId, uuid: categoryUuid } = IdProvider.getIdPair();
2808
2821
  const categoryName = `Category-${categoryId}`;
@@ -2829,7 +2842,7 @@ const CategoryData = test$c.extend({
2829
2842
  }
2830
2843
  });
2831
2844
 
2832
- const DigitalProductData = test$c.extend({
2845
+ const DigitalProductData = test$d.extend({
2833
2846
  DigitalProductData: async ({ ProductData, IdProvider, AdminApiContext }, use) => {
2834
2847
  const newMediaResource = await AdminApiContext.post("./media?_response", {
2835
2848
  data: {
@@ -2884,7 +2897,7 @@ const DigitalProductData = test$c.extend({
2884
2897
  }
2885
2898
  });
2886
2899
 
2887
- const PropertiesData = test$c.extend({
2900
+ const PropertiesData = test$d.extend({
2888
2901
  PropertiesData: async ({ AdminApiContext }, use) => {
2889
2902
  const propertyGroupColorResponse = await AdminApiContext.post("property-group?_response=1", {
2890
2903
  data: {
@@ -2934,7 +2947,7 @@ const PropertiesData = test$c.extend({
2934
2947
  }
2935
2948
  });
2936
2949
 
2937
- const CartWithProductData = test$c.extend({
2950
+ const CartWithProductData = test$d.extend({
2938
2951
  CartWithProductData: async ({ StoreApiContext, DefaultSalesChannel, ProductData }, use) => {
2939
2952
  await StoreApiContext.login(DefaultSalesChannel.customer);
2940
2953
  const cartResponse = await StoreApiContext.post("checkout/cart", {
@@ -2960,7 +2973,7 @@ const CartWithProductData = test$c.extend({
2960
2973
  }
2961
2974
  });
2962
2975
 
2963
- const PromotionWithCodeData = test$c.extend({
2976
+ const PromotionWithCodeData = test$d.extend({
2964
2977
  PromotionWithCodeData: async ({ AdminApiContext, DefaultSalesChannel, IdProvider }, use) => {
2965
2978
  const promotionCode = `${IdProvider.getIdPair().id}`;
2966
2979
  const promotionName = `Test Promotion ${promotionCode}`;
@@ -3002,7 +3015,7 @@ const PromotionWithCodeData = test$c.extend({
3002
3015
  }
3003
3016
  });
3004
3017
 
3005
- const MediaData = test$c.extend({
3018
+ const MediaData = test$d.extend({
3006
3019
  MediaData: async ({ AdminApiContext, IdProvider }, use) => {
3007
3020
  const imageId = IdProvider.getIdPair().id;
3008
3021
  const imageFilePath = `./tmp/image-${imageId}.png`;
@@ -3049,7 +3062,7 @@ const MediaData = test$c.extend({
3049
3062
  }
3050
3063
  });
3051
3064
 
3052
- const OrderData = test$c.extend({
3065
+ const OrderData = test$d.extend({
3053
3066
  OrderData: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, DefaultSalesChannel, ProductData }, use) => {
3054
3067
  const requests = {
3055
3068
  currencyEUR: getCurrency("EUR", AdminApiContext),
@@ -3266,7 +3279,7 @@ const OrderData = test$c.extend({
3266
3279
  }
3267
3280
  });
3268
3281
 
3269
- const TagData = test$c.extend({
3282
+ const TagData = test$d.extend({
3270
3283
  TagData: async ({ IdProvider, AdminApiContext }, use) => {
3271
3284
  const tagUUID = IdProvider.getIdPair().uuid;
3272
3285
  const tagId = IdProvider.getIdPair().id;
@@ -3297,7 +3310,7 @@ const test$3 = mergeTests(
3297
3310
  TagData
3298
3311
  );
3299
3312
 
3300
- const SaveProduct = test$c.extend({
3313
+ const SaveProduct = test$d.extend({
3301
3314
  SaveProduct: async ({ ShopAdmin, AdminProductDetail }, use) => {
3302
3315
  const task = () => {
3303
3316
  return async function SaveProduct2() {
@@ -3319,7 +3332,7 @@ const test$2 = mergeTests(
3319
3332
  SaveProduct
3320
3333
  );
3321
3334
 
3322
- const Login = test$c.extend({
3335
+ const Login = test$d.extend({
3323
3336
  Login: async ({ ShopCustomer, DefaultSalesChannel, StorefrontAccountLogin, StorefrontAccount }, use) => {
3324
3337
  const task = () => {
3325
3338
  return async function Login2() {
@@ -3335,7 +3348,7 @@ const Login = test$c.extend({
3335
3348
  }
3336
3349
  });
3337
3350
 
3338
- const Logout = test$c.extend({
3351
+ const Logout = test$d.extend({
3339
3352
  Logout: async ({ ShopCustomer, StorefrontAccountLogin }, use) => {
3340
3353
  const task = () => {
3341
3354
  return async function Logout2() {
@@ -3349,7 +3362,7 @@ const Logout = test$c.extend({
3349
3362
  }
3350
3363
  });
3351
3364
 
3352
- const Register = test$c.extend({
3365
+ const Register = test$d.extend({
3353
3366
  Register: async ({ StorefrontAccountLogin, AdminApiContext }, use) => {
3354
3367
  const registrationData = {
3355
3368
  firstName: "Jeff",
@@ -3392,7 +3405,7 @@ const Register = test$c.extend({
3392
3405
  }
3393
3406
  });
3394
3407
 
3395
- const AddProductToCart = test$c.extend({
3408
+ const AddProductToCart = test$d.extend({
3396
3409
  AddProductToCart: async ({ ShopCustomer, StorefrontProductDetail }, use) => {
3397
3410
  const task = (ProductData, quantity = "1") => {
3398
3411
  return async function AddProductToCart2() {
@@ -3406,7 +3419,7 @@ const AddProductToCart = test$c.extend({
3406
3419
  }
3407
3420
  });
3408
3421
 
3409
- const ProceedFromProductToCheckout = test$c.extend({
3422
+ const ProceedFromProductToCheckout = test$d.extend({
3410
3423
  ProceedFromProductToCheckout: async ({ ShopCustomer, StorefrontProductDetail, StorefrontCheckoutConfirm }, use) => {
3411
3424
  const task = () => {
3412
3425
  return async function ProceedFromProductToCheckout2() {
@@ -3418,7 +3431,7 @@ const ProceedFromProductToCheckout = test$c.extend({
3418
3431
  }
3419
3432
  });
3420
3433
 
3421
- const ProceedFromCartToCheckout = test$c.extend({
3434
+ const ProceedFromCartToCheckout = test$d.extend({
3422
3435
  ProceedFromCartToCheckout: async ({
3423
3436
  ShopCustomer,
3424
3437
  StorefrontCheckoutCart,
@@ -3434,7 +3447,7 @@ const ProceedFromCartToCheckout = test$c.extend({
3434
3447
  }
3435
3448
  });
3436
3449
 
3437
- const ConfirmTermsAndConditions = test$c.extend({
3450
+ const ConfirmTermsAndConditions = test$d.extend({
3438
3451
  ConfirmTermsAndConditions: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
3439
3452
  const task = () => {
3440
3453
  return async function ConfirmTermsAndConditions2() {
@@ -3446,7 +3459,7 @@ const ConfirmTermsAndConditions = test$c.extend({
3446
3459
  }
3447
3460
  });
3448
3461
 
3449
- const SelectCashOnDeliveryPaymentOption = test$c.extend({
3462
+ const SelectCashOnDeliveryPaymentOption = test$d.extend({
3450
3463
  SelectCashOnDeliveryPaymentOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
3451
3464
  const task = () => {
3452
3465
  return async function SelectCashOnDeliveryPaymentOption2() {
@@ -3458,7 +3471,7 @@ const SelectCashOnDeliveryPaymentOption = test$c.extend({
3458
3471
  }
3459
3472
  });
3460
3473
 
3461
- const SelectInvoicePaymentOption = test$c.extend({
3474
+ const SelectInvoicePaymentOption = test$d.extend({
3462
3475
  SelectInvoicePaymentOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
3463
3476
  const task = () => {
3464
3477
  return async function SelectInvoicePaymentOption2() {
@@ -3470,7 +3483,7 @@ const SelectInvoicePaymentOption = test$c.extend({
3470
3483
  }
3471
3484
  });
3472
3485
 
3473
- const SelectPaidInAdvancePaymentOption = test$c.extend({
3486
+ const SelectPaidInAdvancePaymentOption = test$d.extend({
3474
3487
  SelectPaidInAdvancePaymentOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
3475
3488
  const task = () => {
3476
3489
  return async function SelectPaidInAdvancePaymentOption2() {
@@ -3482,7 +3495,7 @@ const SelectPaidInAdvancePaymentOption = test$c.extend({
3482
3495
  }
3483
3496
  });
3484
3497
 
3485
- const SelectStandardShippingOption = test$c.extend({
3498
+ const SelectStandardShippingOption = test$d.extend({
3486
3499
  SelectStandardShippingOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
3487
3500
  const task = () => {
3488
3501
  return async function SelectStandardShippingOption2() {
@@ -3494,7 +3507,7 @@ const SelectStandardShippingOption = test$c.extend({
3494
3507
  }
3495
3508
  });
3496
3509
 
3497
- const SelectExpressShippingOption = test$c.extend({
3510
+ const SelectExpressShippingOption = test$d.extend({
3498
3511
  SelectExpressShippingOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
3499
3512
  const task = () => {
3500
3513
  return async function SelectExpressShippingOption2() {
@@ -3506,7 +3519,7 @@ const SelectExpressShippingOption = test$c.extend({
3506
3519
  }
3507
3520
  });
3508
3521
 
3509
- const SubmitOrder = test$c.extend({
3522
+ const SubmitOrder = test$d.extend({
3510
3523
  SubmitOrder: async ({ ShopCustomer, StorefrontCheckoutConfirm, StorefrontCheckoutFinish }, use) => {
3511
3524
  const task = () => {
3512
3525
  return async function SubmitOrder2() {
@@ -3518,7 +3531,7 @@ const SubmitOrder = test$c.extend({
3518
3531
  }
3519
3532
  });
3520
3533
 
3521
- const OpenSearchResultPage = test$c.extend({
3534
+ const OpenSearchResultPage = test$d.extend({
3522
3535
  OpenSearchResultPage: async ({ StorefrontSearch }, use) => {
3523
3536
  const task = (searchTerm) => {
3524
3537
  return async function OpenSearchResultPage2() {
@@ -3530,7 +3543,7 @@ const OpenSearchResultPage = test$c.extend({
3530
3543
  }
3531
3544
  });
3532
3545
 
3533
- const OpenSearchSuggestPage = test$c.extend({
3546
+ const OpenSearchSuggestPage = test$d.extend({
3534
3547
  OpenSearchSuggestPage: async ({ StorefrontSearchSuggest }, use) => {
3535
3548
  const task = (searchTerm) => {
3536
3549
  return async function OpenSearchSuggestPage2() {
@@ -3542,7 +3555,7 @@ const OpenSearchSuggestPage = test$c.extend({
3542
3555
  }
3543
3556
  });
3544
3557
 
3545
- const ValidateAccessibility = test$c.extend({
3558
+ const ValidateAccessibility = test$d.extend({
3546
3559
  ValidateAccessibility: async ({ ShopCustomer }, use) => {
3547
3560
  const task = (pageName, assertViolations = true, createReport = true, ruleTags = ["wcag2a", "wcag2aa", "wcag2aaa", "wcag21a", "wcag21aa", "best-practice"], outputDir = "test-results/AccessibilityReports") => {
3548
3561
  return async function ValidateAccessibility2() {
@@ -3588,6 +3601,7 @@ const test$1 = mergeTests(
3588
3601
 
3589
3602
  const test = mergeTests(
3590
3603
  test$6,
3604
+ test$b,
3591
3605
  test$a,
3592
3606
  test$9,
3593
3607
  test$8,
@@ -3599,4 +3613,4 @@ const test = mergeTests(
3599
3613
  test$1
3600
3614
  );
3601
3615
 
3602
- export { AdminPageObjects, StorefrontPageObjects, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, setOrderStatus, test };
3616
+ export { AdminPageObjects, StorefrontPageObjects, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",