@shopware-ag/acceptance-test-suite 12.8.3 → 12.9.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/dist/index.d.mts CHANGED
@@ -497,6 +497,7 @@ declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<bool
497
497
  declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>;
498
498
 
499
499
  declare function createRandomImage(width?: number, height?: number): Image;
500
+ declare function createSolidColorImage(width?: number, height?: number, color?: [number, number, number]): Image;
500
501
  declare function encodeImage(image: Image): Buffer<ArrayBuffer>;
501
502
 
502
503
  interface IdPair {
@@ -668,6 +669,15 @@ declare class TestDataService {
668
669
  * @param height - The height of the image in pixel. Default is 600.
669
670
  */
670
671
  createMediaPNG(width?: number, height?: number): Promise<Media$1>;
672
+ /**
673
+ * Creates a new media resource containing a solid color PNG image.
674
+ * Unlike `createMediaPNG`, the result is deterministic and suitable for visual regression tests.
675
+ *
676
+ * @param width - The width of the image in pixel. Default is 800.
677
+ * @param height - The height of the image in pixel. Default is 600.
678
+ * @param color - RGB color as `[r, g, b]` with values 0..255. Default is red `[255, 0, 0]`.
679
+ */
680
+ createMediaPNGSolid(width?: number, height?: number, color?: [number, number, number]): Promise<Media$1>;
671
681
  /**
672
682
  * Creates a new media resource containing a text file.
673
683
  *
@@ -6448,5 +6458,5 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6448
6458
  CheckVisibilityInHome: Task;
6449
6459
  }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
6450
6460
 
6451
- export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
6461
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
6452
6462
  export type { AccountData, AclRole, Address, CalculatedTaxes, Category$1 as Category, CategoryCustomizableLinkData, CategoryData, CmsPage, Country$1 as Country, CreatedRecord, Currency$2 as Currency, CustomField, CustomFieldData, CustomFieldSet, Customer, CustomerAddress, CustomerGroup, DataServiceOptions, DeliveryTime, FixtureTypes, Flow, FlowConfig, FlowTemplate, Language$2 as Language, Manufacturer, Media$1 as Media, Options, Order, OrderDelivery, OrderLineItem, OrderStatus, PageObject, PaymentMethod$1 as PaymentMethod, Price, Product, ProductCrossSelling, ProductPrice, ProductReview, Promotion, PromotionDiscount, PropertyGroup, PropertyGroupOption, RegistrationData, ReplaceTarget, Rule, RuleAssignmentEntity, SalesChannel, SalesChannelAnalytics, SalesChannelDomain, SalesChannelRecord, Salutation, ShippingMethod$1 as ShippingMethod, SimpleLineItem, StateMachine, StateMachineState, SyncApiOperation, SystemConfig, Tag, TagData, Task, Tax$1 as Tax, TaxRules, TranslateFn, TranslationKey, User, VariantListingConfig };
package/dist/index.d.ts CHANGED
@@ -497,6 +497,7 @@ declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<bool
497
497
  declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>;
498
498
 
499
499
  declare function createRandomImage(width?: number, height?: number): Image;
500
+ declare function createSolidColorImage(width?: number, height?: number, color?: [number, number, number]): Image;
500
501
  declare function encodeImage(image: Image): Buffer<ArrayBuffer>;
501
502
 
502
503
  interface IdPair {
@@ -668,6 +669,15 @@ declare class TestDataService {
668
669
  * @param height - The height of the image in pixel. Default is 600.
669
670
  */
670
671
  createMediaPNG(width?: number, height?: number): Promise<Media$1>;
672
+ /**
673
+ * Creates a new media resource containing a solid color PNG image.
674
+ * Unlike `createMediaPNG`, the result is deterministic and suitable for visual regression tests.
675
+ *
676
+ * @param width - The width of the image in pixel. Default is 800.
677
+ * @param height - The height of the image in pixel. Default is 600.
678
+ * @param color - RGB color as `[r, g, b]` with values 0..255. Default is red `[255, 0, 0]`.
679
+ */
680
+ createMediaPNGSolid(width?: number, height?: number, color?: [number, number, number]): Promise<Media$1>;
671
681
  /**
672
682
  * Creates a new media resource containing a text file.
673
683
  *
@@ -6448,5 +6458,5 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6448
6458
  CheckVisibilityInHome: Task;
6449
6459
  }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
6450
6460
 
6451
- export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
6461
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
6452
6462
  export type { AccountData, AclRole, Address, CalculatedTaxes, Category$1 as Category, CategoryCustomizableLinkData, CategoryData, CmsPage, Country$1 as Country, CreatedRecord, Currency$2 as Currency, CustomField, CustomFieldData, CustomFieldSet, Customer, CustomerAddress, CustomerGroup, DataServiceOptions, DeliveryTime, FixtureTypes, Flow, FlowConfig, FlowTemplate, Language$2 as Language, Manufacturer, Media$1 as Media, Options, Order, OrderDelivery, OrderLineItem, OrderStatus, PageObject, PaymentMethod$1 as PaymentMethod, Price, Product, ProductCrossSelling, ProductPrice, ProductReview, Promotion, PromotionDiscount, PropertyGroup, PropertyGroupOption, RegistrationData, ReplaceTarget, Rule, RuleAssignmentEntity, SalesChannel, SalesChannelAnalytics, SalesChannelDomain, SalesChannelRecord, Salutation, ShippingMethod$1 as ShippingMethod, SimpleLineItem, StateMachine, StateMachineState, SyncApiOperation, SystemConfig, Tag, TagData, Task, Tax$1 as Tax, TaxRules, TranslateFn, TranslationKey, User, VariantListingConfig };
package/dist/index.mjs CHANGED
@@ -3970,6 +3970,21 @@ function createRandomImage(width = 800, height = 600) {
3970
3970
  data
3971
3971
  });
3972
3972
  }
3973
+ function createSolidColorImage(width = 800, height = 600, color = [255, 0, 0]) {
3974
+ const channels = 3;
3975
+ const data = new Uint8Array(width * height * channels);
3976
+ const [r, g, b] = color;
3977
+ for (let i = 0; i < data.length; i += channels) {
3978
+ data[i] = r;
3979
+ data[i + 1] = g;
3980
+ data[i + 2] = b;
3981
+ }
3982
+ return new Image(width, height, {
3983
+ colorModel: "RGB",
3984
+ bitDepth: 8,
3985
+ data
3986
+ });
3987
+ }
3973
3988
  function encodeImage(image) {
3974
3989
  return Buffer.from(encode(image));
3975
3990
  }
@@ -4254,6 +4269,26 @@ class TestDataService {
4254
4269
  this.addCreatedRecord("media", media.id);
4255
4270
  return media;
4256
4271
  }
4272
+ /**
4273
+ * Creates a new media resource containing a solid color PNG image.
4274
+ * Unlike `createMediaPNG`, the result is deterministic and suitable for visual regression tests.
4275
+ *
4276
+ * @param width - The width of the image in pixel. Default is 800.
4277
+ * @param height - The height of the image in pixel. Default is 600.
4278
+ * @param color - RGB color as `[r, g, b]` with values 0..255. Default is red `[255, 0, 0]`.
4279
+ */
4280
+ async createMediaPNGSolid(width = 800, height = 600, color = [255, 0, 0]) {
4281
+ const image = createSolidColorImage(width, height, color);
4282
+ const media = await this.createMediaResource();
4283
+ const filename = `${this.namePrefix}Media-${media.id}${this.nameSuffix}`;
4284
+ const response = await this.AdminApiClient.post(`_action/media/${media.id}/upload?extension=png&fileName=${filename}`, {
4285
+ data: encodeImage(image),
4286
+ headers: { "content-type": "image/png" }
4287
+ });
4288
+ expect(response.ok()).toBeTruthy();
4289
+ this.addCreatedRecord("media", media.id);
4290
+ return media;
4291
+ }
4257
4292
  /**
4258
4293
  * Creates a new media resource containing a text file.
4259
4294
  *
@@ -7267,7 +7302,7 @@ class AccountLogin {
7267
7302
  this.shippingAddressCountryInput = this.registerShippingAddressFormArea.getByLabel(translate("storefront:login:register.country"));
7268
7303
  this.shippingAddressPostalCodeInput = this.registerShippingAddressFormArea.getByLabel(translate("storefront:login:register.postalCode"));
7269
7304
  this.shippingAddressStateInput = this.registerShippingAddressFormArea.getByLabel(translate("storefront:login:register.state"));
7270
- this.registerButton = page.getByRole("button", { name: translate("storefront:login:register.continue") });
7305
+ this.registerButton = page.locator('form.register-form button[type="submit"]');
7271
7306
  this.logoutLink = page.getByRole("link", { name: translate("storefront:login:logout") });
7272
7307
  this.successAlert = page.getByText(translate("storefront:login:successfulLogout"));
7273
7308
  this.passwordUpdatedAlert = page.getByText(translate("storefront:login:passwordUpdated"));
@@ -9605,8 +9640,13 @@ class RuleDetail extends RuleCreate {
9605
9640
  }
9606
9641
  this.conditionFilterModal = page.locator(".sw-modal__header").getByText(translate("administration:rule:text.filter"));
9607
9642
  this.conditionFilterModalCloseButtonX = page.locator(".sw-modal__header").getByRole("button");
9608
- this.conditionCartLineItemInStockOperator = page.locator(".sw-condition__condition-type-cartLineItemStock").locator(".sw-single-select__selection-text");
9609
- this.conditionCartLineItemInStockValue = page.locator(".sw-condition__condition-type-cartLineItemStock").getByRole("textbox");
9643
+ if (satisfies(instanceMeta.version, "<6.7.9.0")) {
9644
+ this.conditionCartLineItemInStockOperator = page.locator(".sw-condition__condition-type-cartLineItemStock").locator(".sw-single-select__selection-text");
9645
+ this.conditionCartLineItemInStockValue = page.locator(".sw-condition__condition-type-cartLineItemStock").getByRole("textbox");
9646
+ } else {
9647
+ this.conditionCartLineItemInStockOperator = page.locator(".sw-condition__condition-type-cartLineItemActualStock").locator(".sw-single-select__selection-text");
9648
+ this.conditionCartLineItemInStockValue = page.locator(".sw-condition__condition-type-cartLineItemActualStock").getByRole("textbox");
9649
+ }
9610
9650
  if (satisfies(instanceMeta.version, "<6.7")) {
9611
9651
  this.assignmentModalAddButton = this.assignmentModal.locator(".sw-button--primary").getByText(translate("administration:rule:buttons.add"));
9612
9652
  } else {
@@ -12716,4 +12756,4 @@ const test = mergeTests(
12716
12756
  test$3
12717
12757
  );
12718
12758
 
12719
- export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
12759
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "12.8.3",
3
+ "version": "12.9.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "keywords": [
6
6
  "fixtures",