@shopware-ag/acceptance-test-suite 1.1.4 → 1.2.0

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/README.md CHANGED
@@ -1,6 +1,21 @@
1
+ [![NPM Version](https://img.shields.io/npm/v/%40shopware-ag%2Facceptance-test-suite)](https://www.npmjs.com/package/@shopware-ag/acceptance-test-suite)
2
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
3
+ [![License](https://img.shields.io/github/license/shopware/acceptance-test-suite.svg)](https://github.com/shopware/acceptance-test-suite/blob/trunk/LICENSE)
4
+
1
5
  # Shopware Acceptance Test Suite
2
6
  This test suite is an extension to [Playwright](https://playwright.dev/) to easily create end-to-end and API acceptance tests for [Shopware](https://github.com/shopware/shopware). It provides several useful Playwright [fixtures](https://playwright.dev/docs/test-fixtures) to start testing with Shopware right away, including page contexts and [page objects](https://playwright.dev/docs/pom) for Storefront and Administration, API clients, test data creation and reusable test logic.
3
7
 
8
+ ## Table of contents
9
+
10
+ * [Installation](#installation)
11
+ * [Configuration](#configuration)
12
+ * [Usage](#usage)
13
+ * [General Fixtures](#general-fixtures)
14
+ * [Page Objects](#page-objects)
15
+ * [Actor Pattern](#actor-pattern)
16
+ * [Data Fixtures](#data-fixtures)
17
+ * [Code Contribution](#code-contribution)
18
+
4
19
  ## Installation
5
20
  Start by creating your own [Playwright](https://playwright.dev/docs/intro) project.
6
21
 
@@ -354,4 +369,9 @@ test('Property group test scenario', async ({ PropertiesData }) => {
354
369
  });
355
370
  ```
356
371
 
357
- If you create your own data fixtures make sure to import and merge them in your base test file with other fixtures you created.
372
+ If you create your own data fixtures make sure to import and merge them in your base test file with other fixtures you created.
373
+
374
+ ## Code Contribution
375
+ You can contribute to this project via its [official repository](https://github.com/shopware/acceptance-test-suite/) on GitHub.
376
+
377
+ This project uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). Please make sure to form your commits accordingly to the spec.
package/dist/index.d.mts CHANGED
@@ -164,6 +164,16 @@ declare class ProductDetail$1 implements PageObject {
164
164
  goTo(productData?: components['schemas']['Product']): Promise<void>;
165
165
  }
166
166
 
167
+ declare class Category implements PageObject {
168
+ readonly page: Page;
169
+ readonly categoryData: components['schemas']['Category'];
170
+ readonly sortingSelect: Locator;
171
+ readonly firstProductBuyButton: Locator;
172
+ readonly noProductsFoundAlert: Locator;
173
+ constructor(page: Page, CategoryData: components['schemas']['Category']);
174
+ goTo(): Promise<void>;
175
+ }
176
+
167
177
  declare class CheckoutCart implements PageObject {
168
178
  readonly page: Page;
169
179
  readonly headline: Locator;
@@ -228,6 +238,11 @@ declare class Account implements PageObject {
228
238
  readonly page: Page;
229
239
  readonly headline: Locator;
230
240
  readonly personalDataCardTitle: Locator;
241
+ readonly paymentMethodCardTitle: Locator;
242
+ readonly billingAddressCardTitle: Locator;
243
+ readonly shippingAddressCardTitle: Locator;
244
+ readonly newsletterCheckbox: Locator;
245
+ readonly newsletterRegistrationSuccessMessage: Locator;
231
246
  constructor(page: Page);
232
247
  goTo(): Promise<void>;
233
248
  }
@@ -253,6 +268,26 @@ declare class AccountLogin implements PageObject {
253
268
  goTo(): Promise<void>;
254
269
  }
255
270
 
271
+ declare class AccountProfile implements PageObject {
272
+ readonly page: Page;
273
+ readonly salutationSelect: Locator;
274
+ readonly firstNameInput: Locator;
275
+ readonly lastNameInput: Locator;
276
+ readonly saveProfileButton: Locator;
277
+ readonly changeEmailButton: Locator;
278
+ readonly emailAddressInput: Locator;
279
+ readonly emailAddressConfirmInput: Locator;
280
+ readonly emailConfirmPasswordInput: Locator;
281
+ readonly saveEmailAddressButton: Locator;
282
+ readonly changePasswordButton: Locator;
283
+ readonly newPasswordInput: Locator;
284
+ readonly newPasswordConfirmInput: Locator;
285
+ readonly currentPasswordInput: Locator;
286
+ readonly saveNewPasswordButton: Locator;
287
+ constructor(page: Page);
288
+ goTo(): Promise<void>;
289
+ }
290
+
256
291
  declare class AccountOrder implements PageObject {
257
292
  readonly page: Page;
258
293
  readonly cartLineItemImages: Locator;
@@ -262,6 +297,27 @@ declare class AccountOrder implements PageObject {
262
297
  goTo(): Promise<void>;
263
298
  }
264
299
 
300
+ declare class AccountAddresses implements PageObject {
301
+ readonly page: Page;
302
+ readonly addNewAddressButton: Locator;
303
+ readonly editBillingAddressButton: Locator;
304
+ readonly editShippingAddressButton: Locator;
305
+ readonly useDefaultBillingAddressButton: Locator;
306
+ readonly useDefaultShippingAddressButton: Locator;
307
+ constructor(page: Page);
308
+ goTo(): Promise<void>;
309
+ }
310
+
311
+ declare class AccountPayment implements PageObject {
312
+ readonly page: Page;
313
+ readonly cashOnDeliveryOption: Locator;
314
+ readonly paidInAdvanceOption: Locator;
315
+ readonly invoiceOption: Locator;
316
+ readonly changeDefaultPaymentButton: Locator;
317
+ constructor(page: Page);
318
+ goTo(): Promise<void>;
319
+ }
320
+
265
321
  declare class Search implements PageObject {
266
322
  readonly page: Page;
267
323
  readonly productImages: Locator;
@@ -279,26 +335,34 @@ declare class SearchSuggest implements PageObject {
279
335
  interface StorefrontPageTypes {
280
336
  StorefrontHome: Home;
281
337
  StorefrontProductDetail: ProductDetail$1;
338
+ StorefrontCategory: Category;
282
339
  StorefrontCheckoutCart: CheckoutCart;
283
340
  StorefrontCheckoutConfirm: CheckoutConfirm;
284
341
  StorefrontCheckoutFinish: CheckoutFinish;
285
342
  StorefrontCheckoutRegister: CheckoutRegister;
286
343
  StorefrontAccount: Account;
287
344
  StorefrontAccountLogin: AccountLogin;
345
+ StorefrontAccountProfile: AccountProfile;
288
346
  StorefrontAccountOrder: AccountOrder;
347
+ StorefrontAccountAddresses: AccountAddresses;
348
+ StorefrontAccountPayment: AccountPayment;
289
349
  StorefrontSearch: Search;
290
350
  StorefrontSearchSuggest: SearchSuggest;
291
351
  }
292
352
  declare const StorefrontPageObjects: {
293
353
  Home: typeof Home;
294
354
  ProductDetail: typeof ProductDetail$1;
355
+ Category: typeof Category;
295
356
  CheckoutCart: typeof CheckoutCart;
296
357
  CheckoutConfirm: typeof CheckoutConfirm;
297
358
  CheckoutFinish: typeof CheckoutFinish;
298
359
  CheckoutRegister: typeof CheckoutRegister;
299
360
  Account: typeof Account;
300
361
  AccountLogin: typeof AccountLogin;
362
+ AccountProfile: typeof AccountProfile;
301
363
  AccountOrder: typeof AccountOrder;
364
+ AccountAddresses: typeof AccountAddresses;
365
+ AccountPayment: typeof AccountPayment;
302
366
  Search: typeof Search;
303
367
  SearchSuggest: typeof SearchSuggest;
304
368
  };
@@ -452,6 +516,7 @@ declare const AdminPageObjects: {
452
516
 
453
517
  interface DataFixtureTypes {
454
518
  ProductData: components['schemas']['Product'];
519
+ CategoryData: components['schemas']['Category'];
455
520
  DigitalProductData: {
456
521
  product: components['schemas']['Product'];
457
522
  fileContent: string;
package/dist/index.d.ts CHANGED
@@ -164,6 +164,16 @@ declare class ProductDetail$1 implements PageObject {
164
164
  goTo(productData?: components['schemas']['Product']): Promise<void>;
165
165
  }
166
166
 
167
+ declare class Category implements PageObject {
168
+ readonly page: Page;
169
+ readonly categoryData: components['schemas']['Category'];
170
+ readonly sortingSelect: Locator;
171
+ readonly firstProductBuyButton: Locator;
172
+ readonly noProductsFoundAlert: Locator;
173
+ constructor(page: Page, CategoryData: components['schemas']['Category']);
174
+ goTo(): Promise<void>;
175
+ }
176
+
167
177
  declare class CheckoutCart implements PageObject {
168
178
  readonly page: Page;
169
179
  readonly headline: Locator;
@@ -228,6 +238,11 @@ declare class Account implements PageObject {
228
238
  readonly page: Page;
229
239
  readonly headline: Locator;
230
240
  readonly personalDataCardTitle: Locator;
241
+ readonly paymentMethodCardTitle: Locator;
242
+ readonly billingAddressCardTitle: Locator;
243
+ readonly shippingAddressCardTitle: Locator;
244
+ readonly newsletterCheckbox: Locator;
245
+ readonly newsletterRegistrationSuccessMessage: Locator;
231
246
  constructor(page: Page);
232
247
  goTo(): Promise<void>;
233
248
  }
@@ -253,6 +268,26 @@ declare class AccountLogin implements PageObject {
253
268
  goTo(): Promise<void>;
254
269
  }
255
270
 
271
+ declare class AccountProfile implements PageObject {
272
+ readonly page: Page;
273
+ readonly salutationSelect: Locator;
274
+ readonly firstNameInput: Locator;
275
+ readonly lastNameInput: Locator;
276
+ readonly saveProfileButton: Locator;
277
+ readonly changeEmailButton: Locator;
278
+ readonly emailAddressInput: Locator;
279
+ readonly emailAddressConfirmInput: Locator;
280
+ readonly emailConfirmPasswordInput: Locator;
281
+ readonly saveEmailAddressButton: Locator;
282
+ readonly changePasswordButton: Locator;
283
+ readonly newPasswordInput: Locator;
284
+ readonly newPasswordConfirmInput: Locator;
285
+ readonly currentPasswordInput: Locator;
286
+ readonly saveNewPasswordButton: Locator;
287
+ constructor(page: Page);
288
+ goTo(): Promise<void>;
289
+ }
290
+
256
291
  declare class AccountOrder implements PageObject {
257
292
  readonly page: Page;
258
293
  readonly cartLineItemImages: Locator;
@@ -262,6 +297,27 @@ declare class AccountOrder implements PageObject {
262
297
  goTo(): Promise<void>;
263
298
  }
264
299
 
300
+ declare class AccountAddresses implements PageObject {
301
+ readonly page: Page;
302
+ readonly addNewAddressButton: Locator;
303
+ readonly editBillingAddressButton: Locator;
304
+ readonly editShippingAddressButton: Locator;
305
+ readonly useDefaultBillingAddressButton: Locator;
306
+ readonly useDefaultShippingAddressButton: Locator;
307
+ constructor(page: Page);
308
+ goTo(): Promise<void>;
309
+ }
310
+
311
+ declare class AccountPayment implements PageObject {
312
+ readonly page: Page;
313
+ readonly cashOnDeliveryOption: Locator;
314
+ readonly paidInAdvanceOption: Locator;
315
+ readonly invoiceOption: Locator;
316
+ readonly changeDefaultPaymentButton: Locator;
317
+ constructor(page: Page);
318
+ goTo(): Promise<void>;
319
+ }
320
+
265
321
  declare class Search implements PageObject {
266
322
  readonly page: Page;
267
323
  readonly productImages: Locator;
@@ -279,26 +335,34 @@ declare class SearchSuggest implements PageObject {
279
335
  interface StorefrontPageTypes {
280
336
  StorefrontHome: Home;
281
337
  StorefrontProductDetail: ProductDetail$1;
338
+ StorefrontCategory: Category;
282
339
  StorefrontCheckoutCart: CheckoutCart;
283
340
  StorefrontCheckoutConfirm: CheckoutConfirm;
284
341
  StorefrontCheckoutFinish: CheckoutFinish;
285
342
  StorefrontCheckoutRegister: CheckoutRegister;
286
343
  StorefrontAccount: Account;
287
344
  StorefrontAccountLogin: AccountLogin;
345
+ StorefrontAccountProfile: AccountProfile;
288
346
  StorefrontAccountOrder: AccountOrder;
347
+ StorefrontAccountAddresses: AccountAddresses;
348
+ StorefrontAccountPayment: AccountPayment;
289
349
  StorefrontSearch: Search;
290
350
  StorefrontSearchSuggest: SearchSuggest;
291
351
  }
292
352
  declare const StorefrontPageObjects: {
293
353
  Home: typeof Home;
294
354
  ProductDetail: typeof ProductDetail$1;
355
+ Category: typeof Category;
295
356
  CheckoutCart: typeof CheckoutCart;
296
357
  CheckoutConfirm: typeof CheckoutConfirm;
297
358
  CheckoutFinish: typeof CheckoutFinish;
298
359
  CheckoutRegister: typeof CheckoutRegister;
299
360
  Account: typeof Account;
300
361
  AccountLogin: typeof AccountLogin;
362
+ AccountProfile: typeof AccountProfile;
301
363
  AccountOrder: typeof AccountOrder;
364
+ AccountAddresses: typeof AccountAddresses;
365
+ AccountPayment: typeof AccountPayment;
302
366
  Search: typeof Search;
303
367
  SearchSuggest: typeof SearchSuggest;
304
368
  };
@@ -452,6 +516,7 @@ declare const AdminPageObjects: {
452
516
 
453
517
  interface DataFixtureTypes {
454
518
  ProductData: components['schemas']['Product'];
519
+ CategoryData: components['schemas']['Category'];
455
520
  DigitalProductData: {
456
521
  product: components['schemas']['Product'];
457
522
  fileContent: string;
package/dist/index.mjs CHANGED
@@ -413,16 +413,16 @@ const test$a = test$c.extend({
413
413
  ]
414
414
  });
415
415
 
416
- var __defProp$k = Object.defineProperty;
417
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
418
- var __publicField$k = (obj, key, value) => {
419
- __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
416
+ var __defProp$o = Object.defineProperty;
417
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
418
+ var __publicField$o = (obj, key, value) => {
419
+ __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
420
420
  return value;
421
421
  };
422
422
  const _AdminApiContext = class _AdminApiContext {
423
423
  constructor(context, options) {
424
- __publicField$k(this, "context");
425
- __publicField$k(this, "options");
424
+ __publicField$o(this, "context");
425
+ __publicField$o(this, "options");
426
426
  this.context = context;
427
427
  this.options = options;
428
428
  }
@@ -514,7 +514,7 @@ const _AdminApiContext = class _AdminApiContext {
514
514
  return this.context.head(url, options);
515
515
  }
516
516
  };
517
- __publicField$k(_AdminApiContext, "defaultOptions", {
517
+ __publicField$o(_AdminApiContext, "defaultOptions", {
518
518
  app_url: process.env["APP_URL"],
519
519
  client_id: process.env["SHOPWARE_ACCESS_KEY_ID"],
520
520
  client_secret: process.env["SHOPWARE_SECRET_ACCESS_KEY"],
@@ -524,16 +524,16 @@ __publicField$k(_AdminApiContext, "defaultOptions", {
524
524
  });
525
525
  let AdminApiContext = _AdminApiContext;
526
526
 
527
- var __defProp$j = Object.defineProperty;
528
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
529
- var __publicField$j = (obj, key, value) => {
530
- __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
527
+ var __defProp$n = Object.defineProperty;
528
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
529
+ var __publicField$n = (obj, key, value) => {
530
+ __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
531
531
  return value;
532
532
  };
533
533
  const _StoreApiContext = class _StoreApiContext {
534
534
  constructor(context, options) {
535
- __publicField$j(this, "context");
536
- __publicField$j(this, "options");
535
+ __publicField$n(this, "context");
536
+ __publicField$n(this, "options");
537
537
  this.context = context;
538
538
  this.options = options;
539
539
  }
@@ -592,7 +592,7 @@ const _StoreApiContext = class _StoreApiContext {
592
592
  return this.context.head(url, options);
593
593
  }
594
594
  };
595
- __publicField$j(_StoreApiContext, "defaultOptions", {
595
+ __publicField$n(_StoreApiContext, "defaultOptions", {
596
596
  app_url: process.env["APP_URL"],
597
597
  ignoreHTTPSErrors: true
598
598
  });
@@ -684,17 +684,17 @@ const test$8 = test$c.extend({
684
684
  }
685
685
  });
686
686
 
687
- var __defProp$i = Object.defineProperty;
688
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
689
- var __publicField$i = (obj, key, value) => {
690
- __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
687
+ var __defProp$m = Object.defineProperty;
688
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
689
+ var __publicField$m = (obj, key, value) => {
690
+ __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
691
691
  return value;
692
692
  };
693
693
  class Actor {
694
694
  constructor(name, page) {
695
- __publicField$i(this, "page");
696
- __publicField$i(this, "name");
697
- __publicField$i(this, "expects", expect);
695
+ __publicField$m(this, "page");
696
+ __publicField$m(this, "name");
697
+ __publicField$m(this, "expects", expect);
698
698
  this.name = name;
699
699
  this.page = page;
700
700
  }
@@ -734,16 +734,16 @@ const test$7 = test$c.extend({
734
734
  }
735
735
  });
736
736
 
737
- var __defProp$h = Object.defineProperty;
738
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
739
- var __publicField$h = (obj, key, value) => {
740
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
737
+ var __defProp$l = Object.defineProperty;
738
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
739
+ var __publicField$l = (obj, key, value) => {
740
+ __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
741
741
  return value;
742
742
  };
743
743
  class IdProvider {
744
744
  constructor(workerIndex, seed) {
745
- __publicField$h(this, "workerIndex");
746
- __publicField$h(this, "seed");
745
+ __publicField$l(this, "workerIndex");
746
+ __publicField$l(this, "seed");
747
747
  this.workerIndex = workerIndex;
748
748
  this.seed = seed;
749
749
  }
@@ -783,16 +783,16 @@ const test$6 = test$c.extend({
783
783
  ]
784
784
  });
785
785
 
786
- var __defProp$g = Object.defineProperty;
787
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
788
- var __publicField$g = (obj, key, value) => {
789
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
786
+ var __defProp$k = Object.defineProperty;
787
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
788
+ var __publicField$k = (obj, key, value) => {
789
+ __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
790
790
  return value;
791
791
  };
792
792
  class Home {
793
793
  constructor(page) {
794
794
  this.page = page;
795
- __publicField$g(this, "productImages");
795
+ __publicField$k(this, "productImages");
796
796
  this.productImages = page.locator(".product-image-link");
797
797
  }
798
798
  async goTo() {
@@ -800,25 +800,25 @@ class Home {
800
800
  }
801
801
  }
802
802
 
803
- var __defProp$f = Object.defineProperty;
804
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
805
- var __publicField$f = (obj, key, value) => {
806
- __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
803
+ var __defProp$j = Object.defineProperty;
804
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
805
+ var __publicField$j = (obj, key, value) => {
806
+ __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
807
807
  return value;
808
808
  };
809
809
  let ProductDetail$1 = class ProductDetail {
810
810
  constructor(page, productData) {
811
811
  this.page = page;
812
812
  this.productData = productData;
813
- __publicField$f(this, "addToCartButton");
814
- __publicField$f(this, "offCanvasCartTitle");
815
- __publicField$f(this, "offCanvasCart");
816
- __publicField$f(this, "offCanvasCartGoToCheckoutButton");
817
- __publicField$f(this, "productSingleImage");
818
- __publicField$f(this, "offCanvasLineItemImages");
819
- __publicField$f(this, "quantitySelect");
820
- __publicField$f(this, "offCanvasSummaryTotalPrice");
821
- __publicField$f(this, "offCanvas");
813
+ __publicField$j(this, "addToCartButton");
814
+ __publicField$j(this, "offCanvasCartTitle");
815
+ __publicField$j(this, "offCanvasCart");
816
+ __publicField$j(this, "offCanvasCartGoToCheckoutButton");
817
+ __publicField$j(this, "productSingleImage");
818
+ __publicField$j(this, "offCanvasLineItemImages");
819
+ __publicField$j(this, "quantitySelect");
820
+ __publicField$j(this, "offCanvasSummaryTotalPrice");
821
+ __publicField$j(this, "offCanvas");
822
822
  this.addToCartButton = page.getByRole("button", { name: "Add to shopping cart" });
823
823
  this.offCanvasCartTitle = page.getByText("Shopping cart", { exact: true });
824
824
  this.offCanvasCart = page.getByRole("dialog");
@@ -839,23 +839,47 @@ let ProductDetail$1 = class ProductDetail {
839
839
  }
840
840
  };
841
841
 
842
- var __defProp$e = Object.defineProperty;
843
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
844
- var __publicField$e = (obj, key, value) => {
845
- __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
842
+ var __defProp$i = Object.defineProperty;
843
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
844
+ var __publicField$i = (obj, key, value) => {
845
+ __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
846
+ return value;
847
+ };
848
+ class Category {
849
+ constructor(page, CategoryData) {
850
+ this.page = page;
851
+ __publicField$i(this, "categoryData");
852
+ __publicField$i(this, "sortingSelect");
853
+ __publicField$i(this, "firstProductBuyButton");
854
+ __publicField$i(this, "noProductsFoundAlert");
855
+ this.categoryData = CategoryData;
856
+ this.sortingSelect = page.getByLabel("Sorting");
857
+ this.firstProductBuyButton = page.getByRole("button", { name: "Add to shopping cart" }).first();
858
+ this.noProductsFoundAlert = page.getByText("No products found.");
859
+ }
860
+ async goTo() {
861
+ const url = `${this.categoryData.name}`;
862
+ await this.page.goto(url);
863
+ }
864
+ }
865
+
866
+ var __defProp$h = Object.defineProperty;
867
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
868
+ var __publicField$h = (obj, key, value) => {
869
+ __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
846
870
  return value;
847
871
  };
848
872
  class CheckoutCart {
849
873
  constructor(page) {
850
874
  this.page = page;
851
- __publicField$e(this, "headline");
852
- __publicField$e(this, "goToCheckoutButton");
853
- __publicField$e(this, "enterDiscountInput");
854
- __publicField$e(this, "grandTotalPrice");
855
- __publicField$e(this, "emptyCartAlert");
856
- __publicField$e(this, "stockReachedAlert");
857
- __publicField$e(this, "cartLineItemImages");
858
- __publicField$e(this, "unitPriceInfo");
875
+ __publicField$h(this, "headline");
876
+ __publicField$h(this, "goToCheckoutButton");
877
+ __publicField$h(this, "enterDiscountInput");
878
+ __publicField$h(this, "grandTotalPrice");
879
+ __publicField$h(this, "emptyCartAlert");
880
+ __publicField$h(this, "stockReachedAlert");
881
+ __publicField$h(this, "cartLineItemImages");
882
+ __publicField$h(this, "unitPriceInfo");
859
883
  this.headline = page.getByRole("heading", { name: "Shopping cart" });
860
884
  this.goToCheckoutButton = page.getByRole("link", { name: "Go to checkout" });
861
885
  this.enterDiscountInput = page.getByLabel("Discount code");
@@ -870,35 +894,35 @@ class CheckoutCart {
870
894
  }
871
895
  }
872
896
 
873
- var __defProp$d = Object.defineProperty;
874
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
875
- var __publicField$d = (obj, key, value) => {
876
- __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
897
+ var __defProp$g = Object.defineProperty;
898
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
899
+ var __publicField$g = (obj, key, value) => {
900
+ __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
877
901
  return value;
878
902
  };
879
903
  class CheckoutConfirm {
880
904
  constructor(page) {
881
905
  this.page = page;
882
- __publicField$d(this, "headline");
883
- __publicField$d(this, "termsAndConditionsCheckbox");
884
- __publicField$d(this, "immediateAccessToDigitalProductCheckbox");
885
- __publicField$d(this, "grandTotalPrice");
886
- __publicField$d(this, "submitOrderButton");
906
+ __publicField$g(this, "headline");
907
+ __publicField$g(this, "termsAndConditionsCheckbox");
908
+ __publicField$g(this, "immediateAccessToDigitalProductCheckbox");
909
+ __publicField$g(this, "grandTotalPrice");
910
+ __publicField$g(this, "submitOrderButton");
887
911
  /**
888
912
  * Payment options
889
913
  */
890
- __publicField$d(this, "paymentCashOnDelivery");
891
- __publicField$d(this, "paymentPaidInAdvance");
892
- __publicField$d(this, "paymentInvoice");
914
+ __publicField$g(this, "paymentCashOnDelivery");
915
+ __publicField$g(this, "paymentPaidInAdvance");
916
+ __publicField$g(this, "paymentInvoice");
893
917
  /**
894
918
  * Shipping options
895
919
  */
896
- __publicField$d(this, "shippingStandard");
897
- __publicField$d(this, "shippingExpress");
920
+ __publicField$g(this, "shippingStandard");
921
+ __publicField$g(this, "shippingExpress");
898
922
  /**
899
923
  * Product details
900
924
  */
901
- __publicField$d(this, "cartLineItemImages");
925
+ __publicField$g(this, "cartLineItemImages");
902
926
  this.headline = page.getByRole("heading", { name: "Complete order" });
903
927
  this.termsAndConditionsCheckbox = page.getByLabel("I have read and accepted the general terms and conditions.");
904
928
  this.immediateAccessToDigitalProductCheckbox = page.getByLabel("I want immediate access to the digital content and I acknowledge that thereby I waive my right to cancel.");
@@ -916,20 +940,20 @@ class CheckoutConfirm {
916
940
  }
917
941
  }
918
942
 
919
- var __defProp$c = Object.defineProperty;
920
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
921
- var __publicField$c = (obj, key, value) => {
922
- __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
943
+ var __defProp$f = Object.defineProperty;
944
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
945
+ var __publicField$f = (obj, key, value) => {
946
+ __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
923
947
  return value;
924
948
  };
925
949
  class CheckoutFinish {
926
950
  constructor(page) {
927
951
  this.page = page;
928
- __publicField$c(this, "headline");
929
- __publicField$c(this, "orderNumberText");
930
- __publicField$c(this, "grandTotalPrice");
931
- __publicField$c(this, "cartLineItemImages");
932
- __publicField$c(this, "orderNumberRegex", /Your order number: #(\d+)/);
952
+ __publicField$f(this, "headline");
953
+ __publicField$f(this, "orderNumberText");
954
+ __publicField$f(this, "grandTotalPrice");
955
+ __publicField$f(this, "cartLineItemImages");
956
+ __publicField$f(this, "orderNumberRegex", /Your order number: #(\d+)/);
933
957
  this.headline = page.getByRole("heading", { name: "Thank you for your order" });
934
958
  this.orderNumberText = page.getByText(this.orderNumberRegex);
935
959
  this.grandTotalPrice = page.locator('dt:has-text("Grand total") + dd');
@@ -957,16 +981,16 @@ class CheckoutFinish {
957
981
  }
958
982
  }
959
983
 
960
- var __defProp$b = Object.defineProperty;
961
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
962
- var __publicField$b = (obj, key, value) => {
963
- __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
984
+ var __defProp$e = Object.defineProperty;
985
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
986
+ var __publicField$e = (obj, key, value) => {
987
+ __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
964
988
  return value;
965
989
  };
966
990
  class CheckoutRegister {
967
991
  constructor(page) {
968
992
  this.page = page;
969
- __publicField$b(this, "cartLineItemImages");
993
+ __publicField$e(this, "cartLineItemImages");
970
994
  this.cartLineItemImages = page.locator(".line-item-img-link");
971
995
  }
972
996
  async goTo() {
@@ -974,50 +998,60 @@ class CheckoutRegister {
974
998
  }
975
999
  }
976
1000
 
977
- var __defProp$a = Object.defineProperty;
978
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
979
- var __publicField$a = (obj, key, value) => {
980
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
1001
+ var __defProp$d = Object.defineProperty;
1002
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1003
+ var __publicField$d = (obj, key, value) => {
1004
+ __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
981
1005
  return value;
982
1006
  };
983
1007
  class Account {
984
1008
  constructor(page) {
985
1009
  this.page = page;
986
- __publicField$a(this, "headline");
987
- __publicField$a(this, "personalDataCardTitle");
1010
+ __publicField$d(this, "headline");
1011
+ __publicField$d(this, "personalDataCardTitle");
1012
+ __publicField$d(this, "paymentMethodCardTitle");
1013
+ __publicField$d(this, "billingAddressCardTitle");
1014
+ __publicField$d(this, "shippingAddressCardTitle");
1015
+ __publicField$d(this, "newsletterCheckbox");
1016
+ __publicField$d(this, "newsletterRegistrationSuccessMessage");
988
1017
  this.headline = page.getByRole("heading", { name: "Overview" });
989
1018
  this.personalDataCardTitle = page.getByRole("heading", { name: "Personal data" });
1019
+ this.paymentMethodCardTitle = page.getByRole("heading", { name: "Default payment method" });
1020
+ this.billingAddressCardTitle = page.getByRole("heading", { name: "Default billing address" });
1021
+ this.shippingAddressCardTitle = page.getByRole("heading", { name: "Default shipping address" });
1022
+ this.newsletterCheckbox = page.getByLabel("Yes, I would like to");
1023
+ this.newsletterRegistrationSuccessMessage = page.getByText("You have successfully subscribed to the newsletter.");
990
1024
  }
991
1025
  async goTo() {
992
1026
  await this.page.goto("account");
993
1027
  }
994
1028
  }
995
1029
 
996
- var __defProp$9 = Object.defineProperty;
997
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
998
- var __publicField$9 = (obj, key, value) => {
999
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
1030
+ var __defProp$c = Object.defineProperty;
1031
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1032
+ var __publicField$c = (obj, key, value) => {
1033
+ __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
1000
1034
  return value;
1001
1035
  };
1002
1036
  class AccountLogin {
1003
1037
  constructor(page) {
1004
1038
  this.page = page;
1005
- __publicField$9(this, "emailInput");
1006
- __publicField$9(this, "passwordInput");
1007
- __publicField$9(this, "loginButton");
1008
- __publicField$9(this, "logoutLink");
1009
- __publicField$9(this, "successAlert");
1039
+ __publicField$c(this, "emailInput");
1040
+ __publicField$c(this, "passwordInput");
1041
+ __publicField$c(this, "loginButton");
1042
+ __publicField$c(this, "logoutLink");
1043
+ __publicField$c(this, "successAlert");
1010
1044
  // Inputs for registration
1011
- __publicField$9(this, "personalFormArea");
1012
- __publicField$9(this, "billingAddressFormArea");
1013
- __publicField$9(this, "firstNameInput");
1014
- __publicField$9(this, "lastNameInput");
1015
- __publicField$9(this, "registerEmailInput");
1016
- __publicField$9(this, "registerPasswordInput");
1017
- __publicField$9(this, "streetAddressInput");
1018
- __publicField$9(this, "cityInput");
1019
- __publicField$9(this, "countryInput");
1020
- __publicField$9(this, "registerButton");
1045
+ __publicField$c(this, "personalFormArea");
1046
+ __publicField$c(this, "billingAddressFormArea");
1047
+ __publicField$c(this, "firstNameInput");
1048
+ __publicField$c(this, "lastNameInput");
1049
+ __publicField$c(this, "registerEmailInput");
1050
+ __publicField$c(this, "registerPasswordInput");
1051
+ __publicField$c(this, "streetAddressInput");
1052
+ __publicField$c(this, "cityInput");
1053
+ __publicField$c(this, "countryInput");
1054
+ __publicField$c(this, "registerButton");
1021
1055
  this.emailInput = page.getByLabel("Your email address");
1022
1056
  this.passwordInput = page.getByLabel("Your password");
1023
1057
  this.loginButton = page.getByRole("button", { name: "Log in" });
@@ -1040,18 +1074,61 @@ class AccountLogin {
1040
1074
  }
1041
1075
  }
1042
1076
 
1043
- var __defProp$8 = Object.defineProperty;
1044
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1045
- var __publicField$8 = (obj, key, value) => {
1046
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
1077
+ var __defProp$b = Object.defineProperty;
1078
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1079
+ var __publicField$b = (obj, key, value) => {
1080
+ __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
1081
+ return value;
1082
+ };
1083
+ class AccountProfile {
1084
+ constructor(page) {
1085
+ this.page = page;
1086
+ __publicField$b(this, "salutationSelect");
1087
+ __publicField$b(this, "firstNameInput");
1088
+ __publicField$b(this, "lastNameInput");
1089
+ __publicField$b(this, "saveProfileButton");
1090
+ __publicField$b(this, "changeEmailButton");
1091
+ __publicField$b(this, "emailAddressInput");
1092
+ __publicField$b(this, "emailAddressConfirmInput");
1093
+ __publicField$b(this, "emailConfirmPasswordInput");
1094
+ __publicField$b(this, "saveEmailAddressButton");
1095
+ __publicField$b(this, "changePasswordButton");
1096
+ __publicField$b(this, "newPasswordInput");
1097
+ __publicField$b(this, "newPasswordConfirmInput");
1098
+ __publicField$b(this, "currentPasswordInput");
1099
+ __publicField$b(this, "saveNewPasswordButton");
1100
+ this.salutationSelect = page.getByLabel("Salutation");
1101
+ this.firstNameInput = page.getByPlaceholder("Enter first name...");
1102
+ this.lastNameInput = page.getByPlaceholder("Enter last name...");
1103
+ this.saveProfileButton = page.locator("#profilePersonalForm").getByRole("button", { name: "Save changes" });
1104
+ this.changeEmailButton = page.getByRole("button", { name: "Change email address" });
1105
+ this.emailAddressInput = page.getByPlaceholder("Enter email address...");
1106
+ this.emailAddressConfirmInput = page.getByPlaceholder("Enter your email address once again...");
1107
+ this.emailConfirmPasswordInput = page.getByPlaceholder("Enter password...");
1108
+ this.saveEmailAddressButton = page.locator("#profileMailForm").getByRole("button", { name: "Save changes" });
1109
+ this.changePasswordButton = page.getByRole("button", { name: "Change password" });
1110
+ this.newPasswordInput = page.getByPlaceholder("Enter new password...");
1111
+ this.newPasswordConfirmInput = page.getByPlaceholder("Enter your new password once again...");
1112
+ this.currentPasswordInput = page.getByPlaceholder("Enter current password...");
1113
+ this.saveNewPasswordButton = page.locator("#profilePasswordForm").getByRole("button", { name: "Save changes" });
1114
+ }
1115
+ async goTo() {
1116
+ await this.page.goto("account/profile");
1117
+ }
1118
+ }
1119
+
1120
+ var __defProp$a = Object.defineProperty;
1121
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1122
+ var __publicField$a = (obj, key, value) => {
1123
+ __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
1047
1124
  return value;
1048
1125
  };
1049
1126
  class AccountOrder {
1050
1127
  constructor(page) {
1051
1128
  this.page = page;
1052
- __publicField$8(this, "cartLineItemImages");
1053
- __publicField$8(this, "orderExpandButton");
1054
- __publicField$8(this, "digitalProductDownloadButton");
1129
+ __publicField$a(this, "cartLineItemImages");
1130
+ __publicField$a(this, "orderExpandButton");
1131
+ __publicField$a(this, "digitalProductDownloadButton");
1055
1132
  this.orderExpandButton = page.getByRole("button", { name: "Expand" }).first();
1056
1133
  this.cartLineItemImages = page.locator(".line-item-img-link");
1057
1134
  this.digitalProductDownloadButton = page.getByRole("link", { name: "Download" }).first();
@@ -1061,6 +1138,54 @@ class AccountOrder {
1061
1138
  }
1062
1139
  }
1063
1140
 
1141
+ var __defProp$9 = Object.defineProperty;
1142
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1143
+ var __publicField$9 = (obj, key, value) => {
1144
+ __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
1145
+ return value;
1146
+ };
1147
+ class AccountAddresses {
1148
+ constructor(page) {
1149
+ this.page = page;
1150
+ __publicField$9(this, "addNewAddressButton");
1151
+ __publicField$9(this, "editBillingAddressButton");
1152
+ __publicField$9(this, "editShippingAddressButton");
1153
+ __publicField$9(this, "useDefaultBillingAddressButton");
1154
+ __publicField$9(this, "useDefaultShippingAddressButton");
1155
+ this.addNewAddressButton = page.getByRole("link", { name: "Add new address" });
1156
+ this.editBillingAddressButton = page.getByRole("link", { name: "Edit address" }).first();
1157
+ this.editShippingAddressButton = page.getByRole("link", { name: "Edit address" }).nth(1);
1158
+ this.useDefaultBillingAddressButton = page.getByRole("button", { name: "Use as default billing address" });
1159
+ this.useDefaultShippingAddressButton = page.getByRole("button", { name: "Use as default shipping address" });
1160
+ }
1161
+ async goTo() {
1162
+ await this.page.goto("account/address");
1163
+ }
1164
+ }
1165
+
1166
+ var __defProp$8 = Object.defineProperty;
1167
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1168
+ var __publicField$8 = (obj, key, value) => {
1169
+ __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
1170
+ return value;
1171
+ };
1172
+ class AccountPayment {
1173
+ constructor(page) {
1174
+ this.page = page;
1175
+ __publicField$8(this, "cashOnDeliveryOption");
1176
+ __publicField$8(this, "paidInAdvanceOption");
1177
+ __publicField$8(this, "invoiceOption");
1178
+ __publicField$8(this, "changeDefaultPaymentButton");
1179
+ this.cashOnDeliveryOption = page.getByLabel("Cash on delivery");
1180
+ this.paidInAdvanceOption = page.getByLabel("Paid in advance");
1181
+ this.invoiceOption = page.getByLabel("Invoice");
1182
+ this.changeDefaultPaymentButton = page.getByRole("button", { name: "Change" });
1183
+ }
1184
+ async goTo() {
1185
+ await this.page.goto("account/payment");
1186
+ }
1187
+ }
1188
+
1064
1189
  var __defProp$7 = Object.defineProperty;
1065
1190
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1066
1191
  var __publicField$7 = (obj, key, value) => {
@@ -1100,13 +1225,17 @@ class SearchSuggest {
1100
1225
  const StorefrontPageObjects = {
1101
1226
  Home,
1102
1227
  ProductDetail: ProductDetail$1,
1228
+ Category,
1103
1229
  CheckoutCart,
1104
1230
  CheckoutConfirm,
1105
1231
  CheckoutFinish,
1106
1232
  CheckoutRegister,
1107
1233
  Account,
1108
1234
  AccountLogin,
1235
+ AccountProfile,
1109
1236
  AccountOrder,
1237
+ AccountAddresses,
1238
+ AccountPayment,
1110
1239
  Search,
1111
1240
  SearchSuggest
1112
1241
  };
@@ -1117,6 +1246,9 @@ const test$5 = test$c.extend({
1117
1246
  StorefrontProductDetail: async ({ StorefrontPage, ProductData }, use) => {
1118
1247
  await use(new ProductDetail$1(StorefrontPage, ProductData));
1119
1248
  },
1249
+ StorefrontCategory: async ({ StorefrontPage, CategoryData }, use) => {
1250
+ await use(new Category(StorefrontPage, CategoryData));
1251
+ },
1120
1252
  StorefrontCheckoutCart: async ({ StorefrontPage }, use) => {
1121
1253
  await use(new CheckoutCart(StorefrontPage));
1122
1254
  },
@@ -1135,9 +1267,18 @@ const test$5 = test$c.extend({
1135
1267
  StorefrontAccountLogin: async ({ StorefrontPage }, use) => {
1136
1268
  await use(new AccountLogin(StorefrontPage));
1137
1269
  },
1270
+ StorefrontAccountProfile: async ({ StorefrontPage }, use) => {
1271
+ await use(new AccountProfile(StorefrontPage));
1272
+ },
1138
1273
  StorefrontAccountOrder: async ({ StorefrontPage }, use) => {
1139
1274
  await use(new AccountOrder(StorefrontPage));
1140
1275
  },
1276
+ StorefrontAccountAddresses: async ({ StorefrontPage }, use) => {
1277
+ await use(new AccountAddresses(StorefrontPage));
1278
+ },
1279
+ StorefrontAccountPayment: async ({ StorefrontPage }, use) => {
1280
+ await use(new AccountPayment(StorefrontPage));
1281
+ },
1141
1282
  StorefrontSearch: async ({ StorefrontPage }, use) => {
1142
1283
  await use(new Search(StorefrontPage));
1143
1284
  },
@@ -1466,45 +1607,98 @@ const ProductData = test$c.extend({
1466
1607
  linked: false,
1467
1608
  net: 6.7
1468
1609
  }
1610
+ ],
1611
+ visibilities: [
1612
+ {
1613
+ salesChannelId: DefaultSalesChannel.salesChannel.id,
1614
+ visibility: 30
1615
+ }
1616
+ ],
1617
+ categories: [
1618
+ {
1619
+ id: DefaultSalesChannel.salesChannel.navigationCategoryId
1620
+ }
1469
1621
  ]
1470
1622
  }
1471
1623
  });
1472
1624
  expect(productResponse.ok()).toBeTruthy();
1473
1625
  const { data: product } = await productResponse.json();
1474
- const syncResp = await AdminApiContext.post("./_action/sync", {
1626
+ await use(product);
1627
+ const cleanupResponse = await AdminApiContext.delete(`./product/${productUuid}`);
1628
+ expect(cleanupResponse.ok()).toBeTruthy();
1629
+ }
1630
+ });
1631
+
1632
+ const CategoryData = test$c.extend({
1633
+ CategoryData: async ({ IdProvider, AdminApiContext, DefaultSalesChannel, ProductData }, use) => {
1634
+ const { id: categoryId, uuid: categoryUuid } = IdProvider.getIdPair();
1635
+ const categoryName = `Category-${categoryId}`;
1636
+ const categoryResponse = await AdminApiContext.post("category?_response", {
1475
1637
  data: {
1476
- "add product to sales channel": {
1477
- entity: "product_visibility",
1478
- action: "upsert",
1479
- payload: [
1480
- {
1481
- productId: product.id,
1482
- salesChannelId: DefaultSalesChannel.salesChannel.id,
1483
- visibility: 30
1484
- }
1485
- ]
1486
- },
1487
- "add product to root navigation": {
1488
- entity: "product_category",
1489
- action: "upsert",
1490
- payload: [
1491
- {
1492
- productId: product.id,
1493
- categoryId: DefaultSalesChannel.salesChannel.navigationCategoryId
1494
- }
1495
- ]
1496
- }
1638
+ id: categoryUuid,
1639
+ name: categoryName,
1640
+ parentId: DefaultSalesChannel.salesChannel.navigationCategoryId,
1641
+ displayNestedProducts: true,
1642
+ type: "page",
1643
+ productAssignmentType: "product",
1644
+ visible: true,
1645
+ active: true,
1646
+ products: [{
1647
+ id: ProductData.id
1648
+ }]
1497
1649
  }
1498
1650
  });
1499
- expect(syncResp.ok()).toBeTruthy();
1500
- await use(product);
1501
- const cleanupResponse = await AdminApiContext.delete(`./product/${productUuid}`);
1651
+ expect(categoryResponse.ok()).toBeTruthy();
1652
+ const { data: category } = await categoryResponse.json();
1653
+ await use(category);
1654
+ const cleanupResponse = await AdminApiContext.delete(`category/${categoryUuid}`);
1502
1655
  expect(cleanupResponse.ok()).toBeTruthy();
1503
1656
  }
1504
1657
  });
1505
1658
 
1506
1659
  const DigitalProductData = test$c.extend({
1507
- DigitalProductData: async ({ IdProvider, AdminApiContext, ProductData }, use) => {
1660
+ DigitalProductData: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, DefaultSalesChannel }, use) => {
1661
+ const { id: productId, uuid: productUuid } = IdProvider.getIdPair();
1662
+ const productName = `Digital_Product_test_${productId}`;
1663
+ const productResponse = await AdminApiContext.post("./product?_response", {
1664
+ data: {
1665
+ active: true,
1666
+ stock: 10,
1667
+ taxId: SalesChannelBaseConfig.taxId,
1668
+ id: productUuid,
1669
+ name: productName,
1670
+ productNumber: "Product-" + productId,
1671
+ price: [
1672
+ {
1673
+ currencyId: SalesChannelBaseConfig.eurCurrencyId,
1674
+ gross: 10,
1675
+ linked: false,
1676
+ net: 8.4
1677
+ }
1678
+ ],
1679
+ purchasePrices: [
1680
+ {
1681
+ currencyId: SalesChannelBaseConfig.eurCurrencyId,
1682
+ gross: 8,
1683
+ linked: false,
1684
+ net: 6.7
1685
+ }
1686
+ ],
1687
+ visibilities: [
1688
+ {
1689
+ salesChannelId: DefaultSalesChannel.salesChannel.id,
1690
+ visibility: 30
1691
+ }
1692
+ ],
1693
+ categories: [
1694
+ {
1695
+ id: DefaultSalesChannel.salesChannel.navigationCategoryId
1696
+ }
1697
+ ]
1698
+ }
1699
+ });
1700
+ expect(productResponse.ok()).toBeTruthy();
1701
+ const { data: productData } = await productResponse.json();
1508
1702
  const newMediaResource = await AdminApiContext.post("./media?_response", {
1509
1703
  data: {
1510
1704
  private: false
@@ -1524,14 +1718,14 @@ const DigitalProductData = test$c.extend({
1524
1718
  expect(newMediaUpload.ok()).toBeTruthy();
1525
1719
  const productDownloadResponse = await AdminApiContext.post(`./product-download?_response`, {
1526
1720
  data: {
1527
- productId: ProductData.id,
1721
+ productId: productData.id,
1528
1722
  mediaId: newMediaId
1529
1723
  }
1530
1724
  });
1531
1725
  expect(productDownloadResponse.ok()).toBeTruthy();
1532
1726
  const { data: productDownload } = await productDownloadResponse.json();
1533
1727
  const returnData = {
1534
- product: ProductData,
1728
+ product: productData,
1535
1729
  fileContent
1536
1730
  };
1537
1731
  await use(returnData);
@@ -1542,7 +1736,7 @@ const DigitalProductData = test$c.extend({
1542
1736
  {
1543
1737
  type: "equals",
1544
1738
  field: "lineItems.productId",
1545
- value: ProductData.id
1739
+ value: productData.id
1546
1740
  }
1547
1741
  ]
1548
1742
  }
@@ -1557,6 +1751,8 @@ const DigitalProductData = test$c.extend({
1557
1751
  expect(unlinkMediaResponse.ok()).toBeTruthy();
1558
1752
  const cleanupMediaResponse = await AdminApiContext.delete(`./media/${newMediaId}`);
1559
1753
  expect(cleanupMediaResponse.ok()).toBeTruthy();
1754
+ const cleanupResponse = await AdminApiContext.delete(`./product/${productUuid}`);
1755
+ expect(cleanupResponse.ok()).toBeTruthy();
1560
1756
  }
1561
1757
  });
1562
1758
 
@@ -1972,6 +2168,7 @@ const TagData = test$c.extend({
1972
2168
 
1973
2169
  const test$3 = mergeTests(
1974
2170
  ProductData,
2171
+ CategoryData,
1975
2172
  DigitalProductData,
1976
2173
  CartWithProductData,
1977
2174
  PromotionWithCodeData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",