@shopware-ag/acceptance-test-suite 11.33.1 → 11.34.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
@@ -763,7 +763,7 @@ declare class TestDataService {
763
763
  * @param productId - The uuid of the product.
764
764
  * @param manufacturerId - The uuid of the manufacturer.
765
765
  */
766
- assignProductManufacturer(productId: string, manufacturerId: string): Promise<void>;
766
+ assignProductManufacturer(productId: string, manufacturerId: string): Promise<any>;
767
767
  /**
768
768
  * Assigns a country to a currency with default roundings of 2.
769
769
  *
@@ -778,14 +778,14 @@ declare class TestDataService {
778
778
  * @param productId - The uuid of the product.
779
779
  * @param categoryId - The uuid of the category.
780
780
  */
781
- assignProductCategory(productId: string, categoryId: string): Promise<playwright_core.APIResponse>;
781
+ assignProductCategory(productId: string, categoryId: string): Promise<any>;
782
782
  /**
783
783
  * Assigns a tag to a product.
784
784
  *
785
785
  * @param productId - The uuid of the product.
786
786
  * @param tagId - The uuid of the tag.
787
787
  */
788
- assignProductTag(productId: string, tagId: string): Promise<playwright_core.APIResponse>;
788
+ assignProductTag(productId: string, tagId: string): Promise<any>;
789
789
  /**
790
790
  * Assigns a media resource to a manufacturer as a logo.
791
791
  *
@@ -1011,6 +1011,14 @@ declare class TestDataService {
1011
1011
  * @param array
1012
1012
  */
1013
1013
  combineAll: (array: Record<string, string>[][]) => Record<string, string>[][];
1014
+ /**
1015
+ * Generates a random alphanumeric string of a specified length.
1016
+ * Ensures at least one numeric character is included.
1017
+ *
1018
+ * @param length - The desired length of the random string (default: 3)
1019
+ * @returns A random alphanumeric string containing at least one digit
1020
+ */
1021
+ generateRandomId(length?: number): string;
1014
1022
  /**
1015
1023
  * @deprecated Use `getCountry` instead.
1016
1024
  * Retrieves a country Id based on its iso2 code.
@@ -5082,6 +5090,17 @@ declare class ListingPageLayoutDetail implements PageObject {
5082
5090
  url(layoutId: string): string;
5083
5091
  }
5084
5092
 
5093
+ declare class SalesChannelDetail implements PageObject {
5094
+ readonly page: Page$1;
5095
+ readonly generalTabLink: Locator$1;
5096
+ readonly productsTabLink: Locator$1;
5097
+ readonly themeTabLink: Locator$1;
5098
+ readonly analyticsTabLink: Locator$1;
5099
+ readonly addDomainButton: Locator$1;
5100
+ constructor(page: Page$1);
5101
+ url(salesChannelId: string): string;
5102
+ }
5103
+
5085
5104
  interface AdministrationPageTypes {
5086
5105
  AdminProductDetail: ProductDetail$1;
5087
5106
  AdminOrderDetail: OrderDetail;
@@ -5122,6 +5141,7 @@ interface AdministrationPageTypes {
5122
5141
  AdminPromotionsListing: PromotionsListing;
5123
5142
  AdminPromotionCreate: PromotionCreate;
5124
5143
  AdminPromotionDetail: PromotionDetail;
5144
+ AdminSalesChannelDetail: SalesChannelDetail;
5125
5145
  AdminShopwareServices: ShopwareServices;
5126
5146
  AdminMedia: Media;
5127
5147
  AdminYourProfile: YourProfile;
@@ -5169,6 +5189,7 @@ declare const AdminPageObjects: {
5169
5189
  SettingsListing: typeof SettingsListing;
5170
5190
  DocumentListing: typeof DocumentListing;
5171
5191
  DocumentDetail: typeof DocumentDetail;
5192
+ SalesChannelDetail: typeof SalesChannelDetail;
5172
5193
  ShopwareServices: typeof ShopwareServices;
5173
5194
  PromotionsListing: typeof PromotionsListing;
5174
5195
  PromotionCreate: typeof PromotionCreate;
@@ -5438,7 +5459,7 @@ declare class CheckoutFinish implements PageObject {
5438
5459
  constructor(page: Page);
5439
5460
  url(): string;
5440
5461
  getOrderNumber(): Promise<string | null>;
5441
- getOrderId(): string | null;
5462
+ getOrderId(): string;
5442
5463
  }
5443
5464
 
5444
5465
  declare class CheckoutRegister implements PageObject {
@@ -5900,6 +5921,8 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
5900
5921
  AddProductToWishlist: Task;
5901
5922
  } & {
5902
5923
  SelectProductFilterOption: Task;
5924
+ } & {
5925
+ CheckVisibilityInHome: Task;
5903
5926
  }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
5904
5927
 
5905
5928
  export { AdminPageObjects, BUNDLED_RESOURCES, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, compareFlowTemplateWithFlow, createRandomImage, encodeImage, extractIdFromUrl, getCountryId, getCurrency, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
package/dist/index.d.ts CHANGED
@@ -763,7 +763,7 @@ declare class TestDataService {
763
763
  * @param productId - The uuid of the product.
764
764
  * @param manufacturerId - The uuid of the manufacturer.
765
765
  */
766
- assignProductManufacturer(productId: string, manufacturerId: string): Promise<void>;
766
+ assignProductManufacturer(productId: string, manufacturerId: string): Promise<any>;
767
767
  /**
768
768
  * Assigns a country to a currency with default roundings of 2.
769
769
  *
@@ -778,14 +778,14 @@ declare class TestDataService {
778
778
  * @param productId - The uuid of the product.
779
779
  * @param categoryId - The uuid of the category.
780
780
  */
781
- assignProductCategory(productId: string, categoryId: string): Promise<playwright_core.APIResponse>;
781
+ assignProductCategory(productId: string, categoryId: string): Promise<any>;
782
782
  /**
783
783
  * Assigns a tag to a product.
784
784
  *
785
785
  * @param productId - The uuid of the product.
786
786
  * @param tagId - The uuid of the tag.
787
787
  */
788
- assignProductTag(productId: string, tagId: string): Promise<playwright_core.APIResponse>;
788
+ assignProductTag(productId: string, tagId: string): Promise<any>;
789
789
  /**
790
790
  * Assigns a media resource to a manufacturer as a logo.
791
791
  *
@@ -1011,6 +1011,14 @@ declare class TestDataService {
1011
1011
  * @param array
1012
1012
  */
1013
1013
  combineAll: (array: Record<string, string>[][]) => Record<string, string>[][];
1014
+ /**
1015
+ * Generates a random alphanumeric string of a specified length.
1016
+ * Ensures at least one numeric character is included.
1017
+ *
1018
+ * @param length - The desired length of the random string (default: 3)
1019
+ * @returns A random alphanumeric string containing at least one digit
1020
+ */
1021
+ generateRandomId(length?: number): string;
1014
1022
  /**
1015
1023
  * @deprecated Use `getCountry` instead.
1016
1024
  * Retrieves a country Id based on its iso2 code.
@@ -5082,6 +5090,17 @@ declare class ListingPageLayoutDetail implements PageObject {
5082
5090
  url(layoutId: string): string;
5083
5091
  }
5084
5092
 
5093
+ declare class SalesChannelDetail implements PageObject {
5094
+ readonly page: Page$1;
5095
+ readonly generalTabLink: Locator$1;
5096
+ readonly productsTabLink: Locator$1;
5097
+ readonly themeTabLink: Locator$1;
5098
+ readonly analyticsTabLink: Locator$1;
5099
+ readonly addDomainButton: Locator$1;
5100
+ constructor(page: Page$1);
5101
+ url(salesChannelId: string): string;
5102
+ }
5103
+
5085
5104
  interface AdministrationPageTypes {
5086
5105
  AdminProductDetail: ProductDetail$1;
5087
5106
  AdminOrderDetail: OrderDetail;
@@ -5122,6 +5141,7 @@ interface AdministrationPageTypes {
5122
5141
  AdminPromotionsListing: PromotionsListing;
5123
5142
  AdminPromotionCreate: PromotionCreate;
5124
5143
  AdminPromotionDetail: PromotionDetail;
5144
+ AdminSalesChannelDetail: SalesChannelDetail;
5125
5145
  AdminShopwareServices: ShopwareServices;
5126
5146
  AdminMedia: Media;
5127
5147
  AdminYourProfile: YourProfile;
@@ -5169,6 +5189,7 @@ declare const AdminPageObjects: {
5169
5189
  SettingsListing: typeof SettingsListing;
5170
5190
  DocumentListing: typeof DocumentListing;
5171
5191
  DocumentDetail: typeof DocumentDetail;
5192
+ SalesChannelDetail: typeof SalesChannelDetail;
5172
5193
  ShopwareServices: typeof ShopwareServices;
5173
5194
  PromotionsListing: typeof PromotionsListing;
5174
5195
  PromotionCreate: typeof PromotionCreate;
@@ -5438,7 +5459,7 @@ declare class CheckoutFinish implements PageObject {
5438
5459
  constructor(page: Page);
5439
5460
  url(): string;
5440
5461
  getOrderNumber(): Promise<string | null>;
5441
- getOrderId(): string | null;
5462
+ getOrderId(): string;
5442
5463
  }
5443
5464
 
5444
5465
  declare class CheckoutRegister implements PageObject {
@@ -5900,6 +5921,8 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
5900
5921
  AddProductToWishlist: Task;
5901
5922
  } & {
5902
5923
  SelectProductFilterOption: Task;
5924
+ } & {
5925
+ CheckVisibilityInHome: Task;
5903
5926
  }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
5904
5927
 
5905
5928
  export { AdminPageObjects, BUNDLED_RESOURCES, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, compareFlowTemplateWithFlow, createRandomImage, encodeImage, extractIdFromUrl, getCountryId, getCurrency, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
package/dist/index.mjs CHANGED
@@ -217,6 +217,7 @@ class AdminApiContext {
217
217
  }
218
218
  });
219
219
  const authData = await authResponse.json();
220
+ expect(authResponse.ok(), "Should authenticate with client credentials").toBeTruthy();
220
221
  if (!authData["access_token"]) {
221
222
  throw new Error(`Failed to authenticate with client_id: ${options.client_id}`);
222
223
  }
@@ -233,6 +234,7 @@ class AdminApiContext {
233
234
  }
234
235
  });
235
236
  const authData = await authResponse.json();
237
+ expect(authResponse.ok(), "Should authenticate with user credentials").toBeTruthy();
236
238
  if (!authData["access_token"]) {
237
239
  throw new Error(`Failed to authenticate with user: ${options.admin_username}`);
238
240
  }
@@ -4294,11 +4296,14 @@ class TestDataService {
4294
4296
  * @param manufacturerId - The uuid of the manufacturer.
4295
4297
  */
4296
4298
  async assignProductManufacturer(productId, manufacturerId) {
4297
- await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
4299
+ const assignProductManufacturerResponse = await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
4298
4300
  data: {
4299
4301
  manufacturerId
4300
4302
  }
4301
4303
  });
4304
+ expect(assignProductManufacturerResponse.ok()).toBeTruthy();
4305
+ const { data: productManufacturer } = await assignProductManufacturerResponse.json();
4306
+ return productManufacturer;
4302
4307
  }
4303
4308
  /**
4304
4309
  * Assigns a country to a currency with default roundings of 2.
@@ -4344,7 +4349,7 @@ class TestDataService {
4344
4349
  * @param categoryId - The uuid of the category.
4345
4350
  */
4346
4351
  async assignProductCategory(productId, categoryId) {
4347
- return await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
4352
+ const assignProductCategoryResponse = await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
4348
4353
  data: {
4349
4354
  categories: [
4350
4355
  {
@@ -4353,6 +4358,9 @@ class TestDataService {
4353
4358
  ]
4354
4359
  }
4355
4360
  });
4361
+ expect(assignProductCategoryResponse.ok()).toBeTruthy();
4362
+ const { data: productCategory } = await assignProductCategoryResponse.json();
4363
+ return productCategory;
4356
4364
  }
4357
4365
  /**
4358
4366
  * Assigns a tag to a product.
@@ -4361,7 +4369,7 @@ class TestDataService {
4361
4369
  * @param tagId - The uuid of the tag.
4362
4370
  */
4363
4371
  async assignProductTag(productId, tagId) {
4364
- return await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
4372
+ const assignProductTagResponse = await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
4365
4373
  data: {
4366
4374
  tags: [
4367
4375
  {
@@ -4370,6 +4378,9 @@ class TestDataService {
4370
4378
  ]
4371
4379
  }
4372
4380
  });
4381
+ expect(assignProductTagResponse.ok()).toBeTruthy();
4382
+ const { data: productTag } = await assignProductTagResponse.json();
4383
+ return productTag;
4373
4384
  }
4374
4385
  /**
4375
4386
  * Assigns a media resource to a manufacturer as a logo.
@@ -5052,6 +5063,27 @@ class TestDataService {
5052
5063
  helper([], 0);
5053
5064
  return result;
5054
5065
  };
5066
+ /**
5067
+ * Generates a random alphanumeric string of a specified length.
5068
+ * Ensures at least one numeric character is included.
5069
+ *
5070
+ * @param length - The desired length of the random string (default: 3)
5071
+ * @returns A random alphanumeric string containing at least one digit
5072
+ */
5073
+ generateRandomId(length = 3) {
5074
+ const LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
5075
+ const DIGITS = "0123456789";
5076
+ const ALL_CHARS = LETTERS + DIGITS;
5077
+ const chars = Array.from(
5078
+ { length },
5079
+ () => ALL_CHARS.charAt(Math.floor(Math.random() * ALL_CHARS.length))
5080
+ );
5081
+ if (!chars.some((char) => DIGITS.includes(char))) {
5082
+ const randomIndex = Math.floor(Math.random() * length);
5083
+ chars[randomIndex] = DIGITS.charAt(Math.floor(Math.random() * DIGITS.length));
5084
+ }
5085
+ return chars.join("");
5086
+ }
5055
5087
  /**
5056
5088
  * @deprecated Use `getCountry` instead.
5057
5089
  * Retrieves a country Id based on its iso2 code.
@@ -5087,8 +5119,8 @@ class TestDataService {
5087
5119
  const basicCountry = {
5088
5120
  id: countryUuid,
5089
5121
  name: "Country-" + countryId,
5090
- iso: "" + countryId.substring(0, 2),
5091
- iso3: "" + countryId.substring(0, 3),
5122
+ iso: this.generateRandomId(2),
5123
+ iso3: this.generateRandomId(3),
5092
5124
  active: true,
5093
5125
  shippingAvailable: true
5094
5126
  };
@@ -5100,7 +5132,7 @@ class TestDataService {
5100
5132
  id: currencyUuid,
5101
5133
  name: "Currency-" + currencyId,
5102
5134
  shortName: "CUR" + currencyId,
5103
- isoCode: "" + currencyId.substring(0, 3),
5135
+ isoCode: this.generateRandomId(3),
5104
5136
  symbol: "C$",
5105
5137
  factor: 2.4,
5106
5138
  itemRounding: {
@@ -6525,7 +6557,7 @@ class CheckoutFinish {
6525
6557
  const url = this.page.url();
6526
6558
  const [, searchString] = url.split("?");
6527
6559
  const params = new URLSearchParams(searchString);
6528
- return params.get("orderId");
6560
+ return params.get("orderId") ?? "";
6529
6561
  }
6530
6562
  }
6531
6563
 
@@ -9646,6 +9678,25 @@ class ListingPageLayoutDetail {
9646
9678
  }
9647
9679
  }
9648
9680
 
9681
+ class SalesChannelDetail {
9682
+ constructor(page) {
9683
+ this.page = page;
9684
+ this.generalTabLink = page.getByRole("tab", { name: "General" });
9685
+ this.productsTabLink = page.getByRole("tab", { name: "Products" });
9686
+ this.themeTabLink = page.getByRole("tab", { name: "Theme" });
9687
+ this.analyticsTabLink = page.getByRole("tab", { name: "Analytics" });
9688
+ this.addDomainButton = page.getByRole("button", { name: "Add domain" });
9689
+ }
9690
+ generalTabLink;
9691
+ productsTabLink;
9692
+ themeTabLink;
9693
+ analyticsTabLink;
9694
+ addDomainButton;
9695
+ url(salesChannelId) {
9696
+ return `#/sw/sales/channel/detail/${salesChannelId}`;
9697
+ }
9698
+ }
9699
+
9649
9700
  const AdminPageObjects = {
9650
9701
  ProductDetail,
9651
9702
  OrderDetail,
@@ -9683,6 +9734,7 @@ const AdminPageObjects = {
9683
9734
  SettingsListing,
9684
9735
  DocumentListing,
9685
9736
  DocumentDetail,
9737
+ SalesChannelDetail,
9686
9738
  ShopwareServices,
9687
9739
  PromotionsListing,
9688
9740
  PromotionCreate,
@@ -9840,6 +9892,9 @@ const test$6 = test$e.extend({
9840
9892
  },
9841
9893
  AdminLayoutCreate: async ({ AdminPage }, use) => {
9842
9894
  await use(new LayoutCreate(AdminPage));
9895
+ },
9896
+ AdminSalesChannelDetail: async ({ AdminPage }, use) => {
9897
+ await use(new SalesChannelDetail(AdminPage));
9843
9898
  }
9844
9899
  });
9845
9900
 
@@ -11278,6 +11333,25 @@ const SelectProductFilterOption = test$e.extend({
11278
11333
  }
11279
11334
  });
11280
11335
 
11336
+ const CheckVisibilityInHome = test$e.extend({
11337
+ CheckVisibilityInHome: async ({ ShopCustomer, StorefrontHome, TestDataService }, use) => {
11338
+ const task = (productName) => {
11339
+ return async function CheckVisibilityInHome2() {
11340
+ await TestDataService.clearCaches();
11341
+ const productLocators = await StorefrontHome.getListingItemByProductName(productName);
11342
+ await ShopCustomer.expects(async () => {
11343
+ await ShopCustomer.goesTo(`${StorefrontHome.url()}?a=${Date.now()}`);
11344
+ await ShopCustomer.expects(productLocators.productName).toBeVisible();
11345
+ }).toPass({
11346
+ intervals: [1e3, 2500]
11347
+ // retry after 1 seconds, then every 2.5 seconds
11348
+ });
11349
+ };
11350
+ };
11351
+ await use(task);
11352
+ }
11353
+ });
11354
+
11281
11355
  const test$3 = mergeTests(
11282
11356
  Login,
11283
11357
  Logout,
@@ -11303,7 +11377,8 @@ const test$3 = mergeTests(
11303
11377
  RemoveProductFromWishlist,
11304
11378
  AddProductToCartFromWishlist,
11305
11379
  AddProductToWishlist,
11306
- SelectProductFilterOption
11380
+ SelectProductFilterOption,
11381
+ CheckVisibilityInHome
11307
11382
  );
11308
11383
 
11309
11384
  class FeatureService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "11.33.1",
3
+ "version": "11.34.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",