@shopware-ag/acceptance-test-suite 3.7.0 → 3.8.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
@@ -292,6 +292,9 @@ type OrderLineItem = components['schemas']['OrderLineItem'] & {
292
292
  type PropertyGroupOption = components['schemas']['PropertyGroupOption'] & {
293
293
  id: string;
294
294
  };
295
+ type DeliveryTime = components['schemas']['DeliveryTime'] & {
296
+ id: string;
297
+ };
295
298
 
296
299
  interface CreatedRecord {
297
300
  resource: string;
@@ -489,9 +492,23 @@ declare class TestDataService {
489
492
  /**
490
493
  * Creates basic variant products based on property group.
491
494
  *
495
+ * @param parentProduct Parent product of the variants
496
+ * @param propertyGroups Property group collection which contain options
492
497
  * @param overrides - Specific data overrides that will be applied to the variant data struct.
493
498
  */
494
499
  createVariantProducts(parentProduct: Product, propertyGroups: PropertyGroup[], overrides?: Partial<Product>): Promise<Product[]>;
500
+ /**
501
+ * Creates a shipping method with one randomly generated image.
502
+ *
503
+ * @param overrides - Specific data overrides that will be applied to the shipping method data struct.
504
+ */
505
+ createShippingMethodWithImage(overrides?: Partial<ShippingMethod>): Promise<ShippingMethod>;
506
+ /**
507
+ * Creates a new basic shipping method with random delivery time.
508
+ *
509
+ * @param overrides - Specific data overrides that will be applied to the shipping method data struct.
510
+ */
511
+ createBasicShippingMethod(overrides?: Partial<ShippingMethod>): Promise<ShippingMethod>;
495
512
  /**
496
513
  * Function that generates combinations from n number of arrays
497
514
  * with m number of elements in them.
@@ -565,6 +582,17 @@ declare class TestDataService {
565
582
  * @param name - The name of the shipping method. Default is "Standard".
566
583
  */
567
584
  getShippingMethod(name?: string): Promise<ShippingMethod>;
585
+ /**
586
+ * Assigns a media resource to a shipping method as a logo.
587
+ *
588
+ * @param shippingMethodId - The uuid of the shipping method.
589
+ * @param mediaId - The uuid of the media resource.
590
+ */
591
+ assignShippingMethodMedia(shippingMethodId: string, mediaId: string): Promise<any>;
592
+ /**
593
+ * Retrieves all delivery time resources.
594
+ */
595
+ getAllDeliveryTimeResources(): Promise<DeliveryTime[]>;
568
596
  /**
569
597
  * Retrieves a payment method by its name.
570
598
  *
@@ -661,6 +689,13 @@ declare class TestDataService {
661
689
  } & Partial<Category$1>;
662
690
  getBasicCustomerStruct(salesChannelId: string, customerGroupId: string, languageId: string, countryId: string, defaultPaymentMethodId: string, salutationId: string, overrides?: Partial<Customer>): Partial<Customer>;
663
691
  getBasicOrderDeliveryStruct(deliveryState: StateMachineState, shippingMethod: ShippingMethod, customerAddress: CustomerAddress): Partial<OrderDelivery>;
692
+ getBasicShippingMethodStruct(deliveryTimeId: string, overrides?: Partial<ShippingMethod>): {
693
+ id: string;
694
+ name: string;
695
+ technicalName: string;
696
+ deliveryTimeId: string;
697
+ active: boolean;
698
+ } & Partial<ShippingMethod>;
664
699
  isProduct(item: Product | Promotion): item is Product;
665
700
  isPromotion(item: Product | Promotion): item is Promotion;
666
701
  getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency$1, paymentMethod: PaymentMethod, shippingMethod: ShippingMethod, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>;
@@ -831,6 +866,23 @@ declare class CheckoutCart implements PageObject {
831
866
  getLineItemByProductNumber(productNumber: string): Promise<Record<string, Locator>>;
832
867
  }
833
868
 
869
+ declare class OffCanvasCart implements PageObject {
870
+ readonly page: Page;
871
+ readonly headline: Locator;
872
+ readonly itemCount: Locator;
873
+ readonly goToCheckoutButton: Locator;
874
+ readonly goToCartButton: Locator;
875
+ readonly continueShoppingButton: Locator;
876
+ readonly enterDiscountInput: Locator;
877
+ readonly submitDiscountButton: Locator;
878
+ readonly subTotalPrice: Locator;
879
+ readonly shippingCosts: Locator;
880
+ readonly cartQuantityNumber: Locator;
881
+ constructor(page: Page);
882
+ url(): string;
883
+ getLineItemByProductNumber(productNumber: string): Promise<Record<string, Locator>>;
884
+ }
885
+
834
886
  declare class CheckoutConfirm implements PageObject {
835
887
  readonly page: Page;
836
888
  readonly headline: Locator;
@@ -982,6 +1034,7 @@ interface StorefrontPageTypes {
982
1034
  StorefrontProductDetail: ProductDetail$1;
983
1035
  StorefrontCategory: Category;
984
1036
  StorefrontCheckoutCart: CheckoutCart;
1037
+ StorefrontOffCanvasCart: OffCanvasCart;
985
1038
  StorefrontCheckoutConfirm: CheckoutConfirm;
986
1039
  StorefrontCheckoutFinish: CheckoutFinish;
987
1040
  StorefrontCheckoutRegister: CheckoutRegister;
@@ -999,6 +1052,7 @@ declare const StorefrontPageObjects: {
999
1052
  ProductDetail: typeof ProductDetail$1;
1000
1053
  Category: typeof Category;
1001
1054
  CheckoutCart: typeof CheckoutCart;
1055
+ OffCanvasCart: typeof OffCanvasCart;
1002
1056
  CheckoutConfirm: typeof CheckoutConfirm;
1003
1057
  CheckoutFinish: typeof CheckoutFinish;
1004
1058
  CheckoutRegister: typeof CheckoutRegister;
@@ -1314,4 +1368,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1314
1368
  ValidateAccessibility: (pageName: string, assertViolations?: number | boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<axe_core.Result[]>;
1315
1369
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
1316
1370
 
1317
- export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type DataServiceOptions, type FixtureTypes, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, type TaxRules, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
1371
+ export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, type TaxRules, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
package/dist/index.d.ts CHANGED
@@ -292,6 +292,9 @@ type OrderLineItem = components['schemas']['OrderLineItem'] & {
292
292
  type PropertyGroupOption = components['schemas']['PropertyGroupOption'] & {
293
293
  id: string;
294
294
  };
295
+ type DeliveryTime = components['schemas']['DeliveryTime'] & {
296
+ id: string;
297
+ };
295
298
 
296
299
  interface CreatedRecord {
297
300
  resource: string;
@@ -489,9 +492,23 @@ declare class TestDataService {
489
492
  /**
490
493
  * Creates basic variant products based on property group.
491
494
  *
495
+ * @param parentProduct Parent product of the variants
496
+ * @param propertyGroups Property group collection which contain options
492
497
  * @param overrides - Specific data overrides that will be applied to the variant data struct.
493
498
  */
494
499
  createVariantProducts(parentProduct: Product, propertyGroups: PropertyGroup[], overrides?: Partial<Product>): Promise<Product[]>;
500
+ /**
501
+ * Creates a shipping method with one randomly generated image.
502
+ *
503
+ * @param overrides - Specific data overrides that will be applied to the shipping method data struct.
504
+ */
505
+ createShippingMethodWithImage(overrides?: Partial<ShippingMethod>): Promise<ShippingMethod>;
506
+ /**
507
+ * Creates a new basic shipping method with random delivery time.
508
+ *
509
+ * @param overrides - Specific data overrides that will be applied to the shipping method data struct.
510
+ */
511
+ createBasicShippingMethod(overrides?: Partial<ShippingMethod>): Promise<ShippingMethod>;
495
512
  /**
496
513
  * Function that generates combinations from n number of arrays
497
514
  * with m number of elements in them.
@@ -565,6 +582,17 @@ declare class TestDataService {
565
582
  * @param name - The name of the shipping method. Default is "Standard".
566
583
  */
567
584
  getShippingMethod(name?: string): Promise<ShippingMethod>;
585
+ /**
586
+ * Assigns a media resource to a shipping method as a logo.
587
+ *
588
+ * @param shippingMethodId - The uuid of the shipping method.
589
+ * @param mediaId - The uuid of the media resource.
590
+ */
591
+ assignShippingMethodMedia(shippingMethodId: string, mediaId: string): Promise<any>;
592
+ /**
593
+ * Retrieves all delivery time resources.
594
+ */
595
+ getAllDeliveryTimeResources(): Promise<DeliveryTime[]>;
568
596
  /**
569
597
  * Retrieves a payment method by its name.
570
598
  *
@@ -661,6 +689,13 @@ declare class TestDataService {
661
689
  } & Partial<Category$1>;
662
690
  getBasicCustomerStruct(salesChannelId: string, customerGroupId: string, languageId: string, countryId: string, defaultPaymentMethodId: string, salutationId: string, overrides?: Partial<Customer>): Partial<Customer>;
663
691
  getBasicOrderDeliveryStruct(deliveryState: StateMachineState, shippingMethod: ShippingMethod, customerAddress: CustomerAddress): Partial<OrderDelivery>;
692
+ getBasicShippingMethodStruct(deliveryTimeId: string, overrides?: Partial<ShippingMethod>): {
693
+ id: string;
694
+ name: string;
695
+ technicalName: string;
696
+ deliveryTimeId: string;
697
+ active: boolean;
698
+ } & Partial<ShippingMethod>;
664
699
  isProduct(item: Product | Promotion): item is Product;
665
700
  isPromotion(item: Product | Promotion): item is Promotion;
666
701
  getBasicOrderStruct(lineItems: SimpleLineItem[], languageId: string, currency: Currency$1, paymentMethod: PaymentMethod, shippingMethod: ShippingMethod, orderState: StateMachineState, deliveryState: StateMachineState, transactionState: StateMachineState, customer: Customer, customerAddress: CustomerAddress, salesChannelId?: string, overrides?: Partial<Order>): Partial<Order>;
@@ -831,6 +866,23 @@ declare class CheckoutCart implements PageObject {
831
866
  getLineItemByProductNumber(productNumber: string): Promise<Record<string, Locator>>;
832
867
  }
833
868
 
869
+ declare class OffCanvasCart implements PageObject {
870
+ readonly page: Page;
871
+ readonly headline: Locator;
872
+ readonly itemCount: Locator;
873
+ readonly goToCheckoutButton: Locator;
874
+ readonly goToCartButton: Locator;
875
+ readonly continueShoppingButton: Locator;
876
+ readonly enterDiscountInput: Locator;
877
+ readonly submitDiscountButton: Locator;
878
+ readonly subTotalPrice: Locator;
879
+ readonly shippingCosts: Locator;
880
+ readonly cartQuantityNumber: Locator;
881
+ constructor(page: Page);
882
+ url(): string;
883
+ getLineItemByProductNumber(productNumber: string): Promise<Record<string, Locator>>;
884
+ }
885
+
834
886
  declare class CheckoutConfirm implements PageObject {
835
887
  readonly page: Page;
836
888
  readonly headline: Locator;
@@ -982,6 +1034,7 @@ interface StorefrontPageTypes {
982
1034
  StorefrontProductDetail: ProductDetail$1;
983
1035
  StorefrontCategory: Category;
984
1036
  StorefrontCheckoutCart: CheckoutCart;
1037
+ StorefrontOffCanvasCart: OffCanvasCart;
985
1038
  StorefrontCheckoutConfirm: CheckoutConfirm;
986
1039
  StorefrontCheckoutFinish: CheckoutFinish;
987
1040
  StorefrontCheckoutRegister: CheckoutRegister;
@@ -999,6 +1052,7 @@ declare const StorefrontPageObjects: {
999
1052
  ProductDetail: typeof ProductDetail$1;
1000
1053
  Category: typeof Category;
1001
1054
  CheckoutCart: typeof CheckoutCart;
1055
+ OffCanvasCart: typeof OffCanvasCart;
1002
1056
  CheckoutConfirm: typeof CheckoutConfirm;
1003
1057
  CheckoutFinish: typeof CheckoutFinish;
1004
1058
  CheckoutRegister: typeof CheckoutRegister;
@@ -1314,4 +1368,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1314
1368
  ValidateAccessibility: (pageName: string, assertViolations?: number | boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<axe_core.Result[]>;
1315
1369
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
1316
1370
 
1317
- export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type DataServiceOptions, type FixtureTypes, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, type TaxRules, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
1371
+ export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod, type Price, type Product, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type Rule, type SalesChannel, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type Tag, type Task, type TaxRules, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
package/dist/index.mjs CHANGED
@@ -370,16 +370,16 @@ const test$c = test$e.extend({
370
370
  ]
371
371
  });
372
372
 
373
- var __defProp$u = Object.defineProperty;
374
- var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
375
- var __publicField$u = (obj, key, value) => {
376
- __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
373
+ var __defProp$v = Object.defineProperty;
374
+ var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
375
+ var __publicField$v = (obj, key, value) => {
376
+ __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
377
377
  return value;
378
378
  };
379
379
  const _AdminApiContext = class _AdminApiContext {
380
380
  constructor(context, options) {
381
- __publicField$u(this, "context");
382
- __publicField$u(this, "options");
381
+ __publicField$v(this, "context");
382
+ __publicField$v(this, "options");
383
383
  this.context = context;
384
384
  this.options = options;
385
385
  }
@@ -471,7 +471,7 @@ const _AdminApiContext = class _AdminApiContext {
471
471
  return this.context.head(url, options);
472
472
  }
473
473
  };
474
- __publicField$u(_AdminApiContext, "defaultOptions", {
474
+ __publicField$v(_AdminApiContext, "defaultOptions", {
475
475
  app_url: process.env["APP_URL"],
476
476
  client_id: process.env["SHOPWARE_ACCESS_KEY_ID"],
477
477
  client_secret: process.env["SHOPWARE_SECRET_ACCESS_KEY"],
@@ -481,16 +481,16 @@ __publicField$u(_AdminApiContext, "defaultOptions", {
481
481
  });
482
482
  let AdminApiContext = _AdminApiContext;
483
483
 
484
- var __defProp$t = Object.defineProperty;
485
- var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
486
- var __publicField$t = (obj, key, value) => {
487
- __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
484
+ var __defProp$u = Object.defineProperty;
485
+ var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
486
+ var __publicField$u = (obj, key, value) => {
487
+ __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
488
488
  return value;
489
489
  };
490
490
  const _StoreApiContext = class _StoreApiContext {
491
491
  constructor(context, options) {
492
- __publicField$t(this, "context");
493
- __publicField$t(this, "options");
492
+ __publicField$u(this, "context");
493
+ __publicField$u(this, "options");
494
494
  this.context = context;
495
495
  this.options = options;
496
496
  }
@@ -549,21 +549,21 @@ const _StoreApiContext = class _StoreApiContext {
549
549
  return this.context.head(url, options);
550
550
  }
551
551
  };
552
- __publicField$t(_StoreApiContext, "defaultOptions", {
552
+ __publicField$u(_StoreApiContext, "defaultOptions", {
553
553
  app_url: process.env["APP_URL"],
554
554
  ignoreHTTPSErrors: true
555
555
  });
556
556
  let StoreApiContext = _StoreApiContext;
557
557
 
558
- var __defProp$s = Object.defineProperty;
559
- var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
560
- var __publicField$s = (obj, key, value) => {
561
- __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
558
+ var __defProp$t = Object.defineProperty;
559
+ var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
560
+ var __publicField$t = (obj, key, value) => {
561
+ __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
562
562
  return value;
563
563
  };
564
564
  class MailpitApiContext {
565
565
  constructor(context) {
566
- __publicField$s(this, "context");
566
+ __publicField$t(this, "context");
567
567
  this.context = context;
568
568
  }
569
569
  /**
@@ -845,17 +845,17 @@ const test$a = test$e.extend({
845
845
  }
846
846
  });
847
847
 
848
- var __defProp$r = Object.defineProperty;
849
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
850
- var __publicField$r = (obj, key, value) => {
851
- __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
848
+ var __defProp$s = Object.defineProperty;
849
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
850
+ var __publicField$s = (obj, key, value) => {
851
+ __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
852
852
  return value;
853
853
  };
854
854
  class Actor {
855
855
  constructor(name, page) {
856
- __publicField$r(this, "page");
857
- __publicField$r(this, "name");
858
- __publicField$r(this, "expects", expect);
856
+ __publicField$s(this, "page");
857
+ __publicField$s(this, "name");
858
+ __publicField$s(this, "expects", expect);
859
859
  this.name = name;
860
860
  this.page = page;
861
861
  }
@@ -904,31 +904,31 @@ function createRandomImage(width = 800, height = 600) {
904
904
  return new Image(width, height, buffer);
905
905
  }
906
906
 
907
- var __defProp$q = Object.defineProperty;
908
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
909
- var __publicField$q = (obj, key, value) => {
910
- __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
907
+ var __defProp$r = Object.defineProperty;
908
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
909
+ var __publicField$r = (obj, key, value) => {
910
+ __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
911
911
  return value;
912
912
  };
913
913
  class TestDataService {
914
914
  constructor(AdminApiClient, IdProvider, options) {
915
- __publicField$q(this, "AdminApiClient");
916
- __publicField$q(this, "IdProvider");
917
- __publicField$q(this, "namePrefix", "Test-");
918
- __publicField$q(this, "nameSuffix", "");
919
- __publicField$q(this, "defaultSalesChannel");
920
- __publicField$q(this, "defaultTaxId");
921
- __publicField$q(this, "defaultCurrencyId");
922
- __publicField$q(this, "defaultCategoryId");
923
- __publicField$q(this, "defaultLanguageId");
924
- __publicField$q(this, "defaultCountryId");
925
- __publicField$q(this, "defaultCustomerGroupId");
915
+ __publicField$r(this, "AdminApiClient");
916
+ __publicField$r(this, "IdProvider");
917
+ __publicField$r(this, "namePrefix", "Test-");
918
+ __publicField$r(this, "nameSuffix", "");
919
+ __publicField$r(this, "defaultSalesChannel");
920
+ __publicField$r(this, "defaultTaxId");
921
+ __publicField$r(this, "defaultCurrencyId");
922
+ __publicField$r(this, "defaultCategoryId");
923
+ __publicField$r(this, "defaultLanguageId");
924
+ __publicField$r(this, "defaultCountryId");
925
+ __publicField$r(this, "defaultCustomerGroupId");
926
926
  /**
927
927
  * Configures if an automated cleanup of the data should be executed.
928
928
  *
929
929
  * @private
930
930
  */
931
- __publicField$q(this, "shouldCleanUp", true);
931
+ __publicField$r(this, "shouldCleanUp", true);
932
932
  /**
933
933
  * Configuration of higher priority entities for the cleanup operation.
934
934
  * These entities will be deleted before others.
@@ -936,19 +936,19 @@ class TestDataService {
936
936
  *
937
937
  * @private
938
938
  */
939
- __publicField$q(this, "highPriorityEntities", ["order", "product"]);
939
+ __publicField$r(this, "highPriorityEntities", ["order", "product"]);
940
940
  /**
941
941
  * A registry of all created records.
942
942
  *
943
943
  * @private
944
944
  */
945
- __publicField$q(this, "createdRecords", []);
945
+ __publicField$r(this, "createdRecords", []);
946
946
  /**
947
947
  * Function that generates combinations from n number of arrays
948
948
  * with m number of elements in them.
949
949
  * @param array
950
950
  */
951
- __publicField$q(this, "combineAll", (array) => {
951
+ __publicField$r(this, "combineAll", (array) => {
952
952
  const result = [];
953
953
  const max = array.length - 1;
954
954
  const helper = (tmpArray, i) => {
@@ -1340,6 +1340,8 @@ class TestDataService {
1340
1340
  /**
1341
1341
  * Creates basic variant products based on property group.
1342
1342
  *
1343
+ * @param parentProduct Parent product of the variants
1344
+ * @param propertyGroups Property group collection which contain options
1343
1345
  * @param overrides - Specific data overrides that will be applied to the variant data struct.
1344
1346
  */
1345
1347
  async createVariantProducts(parentProduct, propertyGroups, overrides = {}) {
@@ -1367,6 +1369,35 @@ class TestDataService {
1367
1369
  }
1368
1370
  return variantProducts;
1369
1371
  }
1372
+ /**
1373
+ * Creates a shipping method with one randomly generated image.
1374
+ *
1375
+ * @param overrides - Specific data overrides that will be applied to the shipping method data struct.
1376
+ */
1377
+ async createShippingMethodWithImage(overrides = {}) {
1378
+ const shippingMethod = await this.createBasicShippingMethod(overrides);
1379
+ const media = await this.createMediaPNG();
1380
+ await this.assignShippingMethodMedia(shippingMethod.id, media.id);
1381
+ return shippingMethod;
1382
+ }
1383
+ /**
1384
+ * Creates a new basic shipping method with random delivery time.
1385
+ *
1386
+ * @param overrides - Specific data overrides that will be applied to the shipping method data struct.
1387
+ */
1388
+ async createBasicShippingMethod(overrides = {}) {
1389
+ const deliveryTime = await this.getAllDeliveryTimeResources();
1390
+ const basicShippingMethod = this.getBasicShippingMethodStruct(
1391
+ deliveryTime[0].id,
1392
+ overrides
1393
+ );
1394
+ const shippingMethodResponse = await this.AdminApiClient.post("shipping-method?_response=detail", {
1395
+ data: basicShippingMethod
1396
+ });
1397
+ const { data: shippingMethod } = await shippingMethodResponse.json();
1398
+ this.addCreatedRecord("shipping_method", shippingMethod.id);
1399
+ return shippingMethod;
1400
+ }
1370
1401
  /**
1371
1402
  * Assigns a media resource to a payment method as a logo.
1372
1403
  *
@@ -1537,6 +1568,29 @@ class TestDataService {
1537
1568
  const { data: result } = await response.json();
1538
1569
  return result[0];
1539
1570
  }
1571
+ /**
1572
+ * Assigns a media resource to a shipping method as a logo.
1573
+ *
1574
+ * @param shippingMethodId - The uuid of the shipping method.
1575
+ * @param mediaId - The uuid of the media resource.
1576
+ */
1577
+ async assignShippingMethodMedia(shippingMethodId, mediaId) {
1578
+ const shippingMethodResponse = await this.AdminApiClient.patch(`shipping-method/${shippingMethodId}?_response=basic`, {
1579
+ data: {
1580
+ mediaId
1581
+ }
1582
+ });
1583
+ const { data: shippingMethodMedia } = await shippingMethodResponse.json();
1584
+ return shippingMethodMedia;
1585
+ }
1586
+ /**
1587
+ * Retrieves all delivery time resources.
1588
+ */
1589
+ async getAllDeliveryTimeResources() {
1590
+ const response = await this.AdminApiClient.get("delivery-time");
1591
+ const { data: deliveryTimeResources } = await response.json();
1592
+ return deliveryTimeResources;
1593
+ }
1540
1594
  /**
1541
1595
  * Retrieves a payment method by its name.
1542
1596
  *
@@ -1983,6 +2037,18 @@ class TestDataService {
1983
2037
  }
1984
2038
  };
1985
2039
  }
2040
+ getBasicShippingMethodStruct(deliveryTimeId, overrides = {}) {
2041
+ const { id: shippingMethodId, uuid: shippingMethodUuid } = this.IdProvider.getIdPair();
2042
+ const shippingMethodName = `${this.namePrefix}ShippingMethod-${shippingMethodId}${this.nameSuffix}`;
2043
+ const basicShippingMethod = {
2044
+ id: shippingMethodUuid,
2045
+ name: shippingMethodName,
2046
+ technicalName: shippingMethodName.toLowerCase(),
2047
+ deliveryTimeId,
2048
+ active: true
2049
+ };
2050
+ return Object.assign({}, basicShippingMethod, overrides);
2051
+ }
1986
2052
  isProduct(item) {
1987
2053
  return item.productNumber !== void 0;
1988
2054
  }
@@ -2240,16 +2306,16 @@ const test$8 = test$e.extend({
2240
2306
  }
2241
2307
  });
2242
2308
 
2243
- var __defProp$p = Object.defineProperty;
2244
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2245
- var __publicField$p = (obj, key, value) => {
2246
- __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
2309
+ var __defProp$q = Object.defineProperty;
2310
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2311
+ var __publicField$q = (obj, key, value) => {
2312
+ __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
2247
2313
  return value;
2248
2314
  };
2249
2315
  class IdProvider {
2250
2316
  constructor(workerIndex, seed) {
2251
- __publicField$p(this, "workerIndex");
2252
- __publicField$p(this, "seed");
2317
+ __publicField$q(this, "workerIndex");
2318
+ __publicField$q(this, "seed");
2253
2319
  this.workerIndex = workerIndex;
2254
2320
  this.seed = seed;
2255
2321
  }
@@ -2311,17 +2377,17 @@ const test$7 = test$e.extend({
2311
2377
  ]
2312
2378
  });
2313
2379
 
2314
- var __defProp$o = Object.defineProperty;
2315
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2316
- var __publicField$o = (obj, key, value) => {
2317
- __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
2380
+ var __defProp$p = Object.defineProperty;
2381
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2382
+ var __publicField$p = (obj, key, value) => {
2383
+ __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
2318
2384
  return value;
2319
2385
  };
2320
2386
  class Home {
2321
2387
  constructor(page) {
2322
2388
  this.page = page;
2323
- __publicField$o(this, "productImages");
2324
- __publicField$o(this, "productListItems");
2389
+ __publicField$p(this, "productImages");
2390
+ __publicField$p(this, "productListItems");
2325
2391
  this.productImages = page.locator(".product-image-link");
2326
2392
  this.productListItems = page.getByRole("listitem");
2327
2393
  }
@@ -2330,26 +2396,26 @@ class Home {
2330
2396
  }
2331
2397
  }
2332
2398
 
2333
- var __defProp$n = Object.defineProperty;
2334
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2335
- var __publicField$n = (obj, key, value) => {
2336
- __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
2399
+ var __defProp$o = Object.defineProperty;
2400
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2401
+ var __publicField$o = (obj, key, value) => {
2402
+ __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
2337
2403
  return value;
2338
2404
  };
2339
2405
  let ProductDetail$1 = class ProductDetail {
2340
2406
  constructor(page) {
2341
2407
  this.page = page;
2342
- __publicField$n(this, "addToCartButton");
2343
- __publicField$n(this, "quantitySelect");
2344
- __publicField$n(this, "productSingleImage");
2345
- __publicField$n(this, "productSinglePrice");
2346
- __publicField$n(this, "productPriceRangesRow");
2347
- __publicField$n(this, "offCanvasCartTitle");
2348
- __publicField$n(this, "offCanvasCart");
2349
- __publicField$n(this, "offCanvasCartGoToCheckoutButton");
2350
- __publicField$n(this, "offCanvasLineItemImages");
2351
- __publicField$n(this, "offCanvasSummaryTotalPrice");
2352
- __publicField$n(this, "offCanvas");
2408
+ __publicField$o(this, "addToCartButton");
2409
+ __publicField$o(this, "quantitySelect");
2410
+ __publicField$o(this, "productSingleImage");
2411
+ __publicField$o(this, "productSinglePrice");
2412
+ __publicField$o(this, "productPriceRangesRow");
2413
+ __publicField$o(this, "offCanvasCartTitle");
2414
+ __publicField$o(this, "offCanvasCart");
2415
+ __publicField$o(this, "offCanvasCartGoToCheckoutButton");
2416
+ __publicField$o(this, "offCanvasLineItemImages");
2417
+ __publicField$o(this, "offCanvasSummaryTotalPrice");
2418
+ __publicField$o(this, "offCanvas");
2353
2419
  this.addToCartButton = page.getByRole("button", { name: "Add to shopping cart" });
2354
2420
  this.quantitySelect = page.getByLabel("Quantity", { exact: true });
2355
2421
  this.productSingleImage = page.locator(".gallery-slider-single-image");
@@ -2371,18 +2437,18 @@ let ProductDetail$1 = class ProductDetail {
2371
2437
  }
2372
2438
  };
2373
2439
 
2374
- var __defProp$m = Object.defineProperty;
2375
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2376
- var __publicField$m = (obj, key, value) => {
2377
- __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
2440
+ var __defProp$n = Object.defineProperty;
2441
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2442
+ var __publicField$n = (obj, key, value) => {
2443
+ __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
2378
2444
  return value;
2379
2445
  };
2380
2446
  class Category {
2381
2447
  constructor(page) {
2382
2448
  this.page = page;
2383
- __publicField$m(this, "sortingSelect");
2384
- __publicField$m(this, "firstProductBuyButton");
2385
- __publicField$m(this, "noProductsFoundAlert");
2449
+ __publicField$n(this, "sortingSelect");
2450
+ __publicField$n(this, "firstProductBuyButton");
2451
+ __publicField$n(this, "noProductsFoundAlert");
2386
2452
  this.sortingSelect = page.getByLabel("Sorting");
2387
2453
  this.firstProductBuyButton = page.getByRole("button", { name: "Add to shopping cart" }).first();
2388
2454
  this.noProductsFoundAlert = page.getByText("No products found.");
@@ -2392,24 +2458,24 @@ class Category {
2392
2458
  }
2393
2459
  }
2394
2460
 
2395
- var __defProp$l = Object.defineProperty;
2396
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2397
- var __publicField$l = (obj, key, value) => {
2398
- __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
2461
+ var __defProp$m = Object.defineProperty;
2462
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2463
+ var __publicField$m = (obj, key, value) => {
2464
+ __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
2399
2465
  return value;
2400
2466
  };
2401
2467
  class CheckoutCart {
2402
2468
  constructor(page) {
2403
2469
  this.page = page;
2404
- __publicField$l(this, "headline");
2405
- __publicField$l(this, "goToCheckoutButton");
2406
- __publicField$l(this, "enterDiscountInput");
2407
- __publicField$l(this, "grandTotalPrice");
2408
- __publicField$l(this, "emptyCartAlert");
2409
- __publicField$l(this, "stockReachedAlert");
2410
- __publicField$l(this, "cartLineItemImages");
2411
- __publicField$l(this, "unitPriceInfo");
2412
- __publicField$l(this, "cartQuantityNumber");
2470
+ __publicField$m(this, "headline");
2471
+ __publicField$m(this, "goToCheckoutButton");
2472
+ __publicField$m(this, "enterDiscountInput");
2473
+ __publicField$m(this, "grandTotalPrice");
2474
+ __publicField$m(this, "emptyCartAlert");
2475
+ __publicField$m(this, "stockReachedAlert");
2476
+ __publicField$m(this, "cartLineItemImages");
2477
+ __publicField$m(this, "unitPriceInfo");
2478
+ __publicField$m(this, "cartQuantityNumber");
2413
2479
  this.headline = page.getByRole("heading", { name: "Shopping cart" });
2414
2480
  this.goToCheckoutButton = page.getByRole("link", { name: "Go to checkout" });
2415
2481
  this.enterDiscountInput = page.getByLabel("Discount code");
@@ -2450,6 +2516,66 @@ class CheckoutCart {
2450
2516
  }
2451
2517
  }
2452
2518
 
2519
+ var __defProp$l = Object.defineProperty;
2520
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2521
+ var __publicField$l = (obj, key, value) => {
2522
+ __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
2523
+ return value;
2524
+ };
2525
+ class OffCanvasCart {
2526
+ constructor(page) {
2527
+ this.page = page;
2528
+ __publicField$l(this, "headline");
2529
+ __publicField$l(this, "itemCount");
2530
+ __publicField$l(this, "goToCheckoutButton");
2531
+ __publicField$l(this, "goToCartButton");
2532
+ __publicField$l(this, "continueShoppingButton");
2533
+ __publicField$l(this, "enterDiscountInput");
2534
+ __publicField$l(this, "submitDiscountButton");
2535
+ __publicField$l(this, "subTotalPrice");
2536
+ __publicField$l(this, "shippingCosts");
2537
+ __publicField$l(this, "cartQuantityNumber");
2538
+ this.headline = page.getByRole("heading", { name: "Shopping cart" });
2539
+ this.itemCount = page.locator(".offcanvas-cart-header-count");
2540
+ this.goToCheckoutButton = page.getByRole("link", { name: "Go to checkout" });
2541
+ this.goToCartButton = page.getByRole("link", { name: "Display shopping cart" });
2542
+ this.continueShoppingButton = page.getByRole("button", { name: "Continue shopping" });
2543
+ this.enterDiscountInput = page.getByPlaceholder("Enter discount code...");
2544
+ this.submitDiscountButton = page.locator("#addPromotionOffcanvasCart");
2545
+ this.subTotalPrice = page.locator('dt:has-text("Subtotal") + dd:visible');
2546
+ this.shippingCosts = page.locator('dt:has-text("Shipping costs") + dd:visible');
2547
+ this.cartQuantityNumber = page.getByLabel("Quantity", { exact: true });
2548
+ }
2549
+ url() {
2550
+ throw new Error("Off Canvas Cart does not have an own url.");
2551
+ }
2552
+ async getLineItemByProductNumber(productNumber) {
2553
+ const lineItem = this.page.locator(".line-item-product", { hasText: productNumber });
2554
+ const lineItemImage = lineItem.locator("line-item-img-container");
2555
+ const productNameLabel = lineItem.locator(".line-item-label");
2556
+ const productNumberLabel = lineItem.locator(".line-item-product-number");
2557
+ const productDeliveryDateLabel = lineItem.locator(".line-item-delivery-date");
2558
+ const productQuantityMinusButton = lineItem.locator(".btn-minus");
2559
+ const productQuantityPlusButton = lineItem.locator(".btn-plus");
2560
+ const productQuantityInput = lineItem.locator(".quantity-selector-group-input");
2561
+ const productUnitPriceValue = lineItem.locator(".line-item-unit-price-value");
2562
+ const productTotalPriceValue = lineItem.locator(".line-item-total-price-value");
2563
+ const removeButton = lineItem.locator(".line-item-remove-button");
2564
+ return {
2565
+ lineItemImage,
2566
+ productNameLabel,
2567
+ productNumberLabel,
2568
+ productDeliveryDateLabel,
2569
+ productQuantityMinusButton,
2570
+ productQuantityPlusButton,
2571
+ productQuantityInput,
2572
+ productUnitPriceValue,
2573
+ productTotalPriceValue,
2574
+ removeButton
2575
+ };
2576
+ }
2577
+ }
2578
+
2453
2579
  var __defProp$k = Object.defineProperty;
2454
2580
  var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2455
2581
  var __publicField$k = (obj, key, value) => {
@@ -2785,6 +2911,7 @@ const StorefrontPageObjects = {
2785
2911
  ProductDetail: ProductDetail$1,
2786
2912
  Category,
2787
2913
  CheckoutCart,
2914
+ OffCanvasCart,
2788
2915
  CheckoutConfirm,
2789
2916
  CheckoutFinish,
2790
2917
  CheckoutRegister,
@@ -2810,6 +2937,9 @@ const test$6 = test$e.extend({
2810
2937
  StorefrontCheckoutCart: async ({ StorefrontPage }, use) => {
2811
2938
  await use(new CheckoutCart(StorefrontPage));
2812
2939
  },
2940
+ StorefrontOffCanvasCart: async ({ StorefrontPage }, use) => {
2941
+ await use(new OffCanvasCart(StorefrontPage));
2942
+ },
2813
2943
  StorefrontCheckoutConfirm: async ({ StorefrontPage }, use) => {
2814
2944
  await use(new CheckoutConfirm(StorefrontPage));
2815
2945
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "3.7.0",
3
+ "version": "3.8.1",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",