@shopware-ag/acceptance-test-suite 5.4.0 → 5.5.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
@@ -256,6 +256,9 @@ type Currency$1 = components['schemas']['Currency'] & {
256
256
  type Country = components['schemas']['Country'] & {
257
257
  id: string;
258
258
  };
259
+ type SystemConfig = components['schemas']['SystemConfig'] & {
260
+ id: string;
261
+ };
259
262
  interface CalculatedTaxes {
260
263
  tax: number;
261
264
  taxRate: number;
@@ -565,6 +568,14 @@ declare class TestDataService {
565
568
  * @param overrides - Specific data overrides that will be applied to the customer group data struct.
566
569
  */
567
570
  createCustomerGroup(overrides?: Partial<CustomerGroup>): Promise<CustomerGroup>;
571
+ /**
572
+ * Creates a system config entry
573
+ *
574
+ * @param configurationKey - Config key for shop configurations.
575
+ * @param configurationValue - Config value as object for shop configurations (see {@link https://shopware.stoplight.io/docs/admin-api/9174d032146f8-create-a-new-system-config-resources|AdminApi Stoplight}).
576
+ * @param salesChannelId - Unique identity of sales channel.
577
+ */
578
+ createSystemConfigEntry(configurationKey: string, configurationValue?: {}, salesChannelId?: string): Promise<SystemConfig>;
568
579
  /**
569
580
  * Assigns a media resource as the download of a digital product.
570
581
  *
@@ -1100,7 +1111,12 @@ declare class AccountOrder implements PageObject {
1100
1111
  readonly cartLineItemImages: Locator;
1101
1112
  readonly orderExpandButton: Locator;
1102
1113
  readonly digitalProductDownloadButton: Locator;
1114
+ readonly dialogOrderCancel: Locator;
1115
+ readonly dialogOrderCancelButton: Locator;
1116
+ readonly dialogBackButton: Locator;
1103
1117
  constructor(page: Page);
1118
+ getOrderByOrderNumber(orderNumber: string): Promise<Record<string, Locator>>;
1119
+ getViewSubscriptionLink: (orderNumber: string) => Locator;
1104
1120
  url(): string;
1105
1121
  }
1106
1122
 
@@ -1500,6 +1516,7 @@ declare class Categories implements PageObject {
1500
1516
  readonly categoryMenuItemList: Locator;
1501
1517
  readonly createCategoryInput: Locator;
1502
1518
  readonly confirmCategoryCreationButton: Locator;
1519
+ readonly confirmCategoryCancelButton: Locator;
1503
1520
  readonly categoryItems: Locator;
1504
1521
  /**
1505
1522
  * General
@@ -1510,6 +1527,7 @@ declare class Categories implements PageObject {
1510
1527
  readonly filtersResultPopoverItemList: Locator;
1511
1528
  readonly saveButton: Locator;
1512
1529
  readonly loadingSpinner: Locator;
1530
+ readonly fadingBar: Locator;
1513
1531
  /**
1514
1532
  * Customisable link
1515
1533
  */
@@ -1782,6 +1800,8 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1782
1800
  SaveProduct: Task;
1783
1801
  } & {
1784
1802
  ExpectNotification: Task;
1803
+ } & {
1804
+ CreateLinkTypeCategory: Task;
1785
1805
  } & {
1786
1806
  Login: Task;
1787
1807
  } & {
@@ -1822,4 +1842,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1822
1842
  ValidateAccessibility: (pageName: string, assertViolations?: number | boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<axe_core.Result[]>;
1823
1843
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
1824
1844
 
1825
- export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type CustomerGroup, 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 };
1845
+ export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type CustomerGroup, 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 SystemConfig, 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
@@ -256,6 +256,9 @@ type Currency$1 = components['schemas']['Currency'] & {
256
256
  type Country = components['schemas']['Country'] & {
257
257
  id: string;
258
258
  };
259
+ type SystemConfig = components['schemas']['SystemConfig'] & {
260
+ id: string;
261
+ };
259
262
  interface CalculatedTaxes {
260
263
  tax: number;
261
264
  taxRate: number;
@@ -565,6 +568,14 @@ declare class TestDataService {
565
568
  * @param overrides - Specific data overrides that will be applied to the customer group data struct.
566
569
  */
567
570
  createCustomerGroup(overrides?: Partial<CustomerGroup>): Promise<CustomerGroup>;
571
+ /**
572
+ * Creates a system config entry
573
+ *
574
+ * @param configurationKey - Config key for shop configurations.
575
+ * @param configurationValue - Config value as object for shop configurations (see {@link https://shopware.stoplight.io/docs/admin-api/9174d032146f8-create-a-new-system-config-resources|AdminApi Stoplight}).
576
+ * @param salesChannelId - Unique identity of sales channel.
577
+ */
578
+ createSystemConfigEntry(configurationKey: string, configurationValue?: {}, salesChannelId?: string): Promise<SystemConfig>;
568
579
  /**
569
580
  * Assigns a media resource as the download of a digital product.
570
581
  *
@@ -1100,7 +1111,12 @@ declare class AccountOrder implements PageObject {
1100
1111
  readonly cartLineItemImages: Locator;
1101
1112
  readonly orderExpandButton: Locator;
1102
1113
  readonly digitalProductDownloadButton: Locator;
1114
+ readonly dialogOrderCancel: Locator;
1115
+ readonly dialogOrderCancelButton: Locator;
1116
+ readonly dialogBackButton: Locator;
1103
1117
  constructor(page: Page);
1118
+ getOrderByOrderNumber(orderNumber: string): Promise<Record<string, Locator>>;
1119
+ getViewSubscriptionLink: (orderNumber: string) => Locator;
1104
1120
  url(): string;
1105
1121
  }
1106
1122
 
@@ -1500,6 +1516,7 @@ declare class Categories implements PageObject {
1500
1516
  readonly categoryMenuItemList: Locator;
1501
1517
  readonly createCategoryInput: Locator;
1502
1518
  readonly confirmCategoryCreationButton: Locator;
1519
+ readonly confirmCategoryCancelButton: Locator;
1503
1520
  readonly categoryItems: Locator;
1504
1521
  /**
1505
1522
  * General
@@ -1510,6 +1527,7 @@ declare class Categories implements PageObject {
1510
1527
  readonly filtersResultPopoverItemList: Locator;
1511
1528
  readonly saveButton: Locator;
1512
1529
  readonly loadingSpinner: Locator;
1530
+ readonly fadingBar: Locator;
1513
1531
  /**
1514
1532
  * Customisable link
1515
1533
  */
@@ -1782,6 +1800,8 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1782
1800
  SaveProduct: Task;
1783
1801
  } & {
1784
1802
  ExpectNotification: Task;
1803
+ } & {
1804
+ CreateLinkTypeCategory: Task;
1785
1805
  } & {
1786
1806
  Login: Task;
1787
1807
  } & {
@@ -1822,4 +1842,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
1822
1842
  ValidateAccessibility: (pageName: string, assertViolations?: number | boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<axe_core.Result[]>;
1823
1843
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
1824
1844
 
1825
- export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type CustomerGroup, 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 };
1845
+ export { AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type Customer, type CustomerAddress, type CustomerGroup, 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 SystemConfig, 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
@@ -1519,6 +1519,28 @@ class TestDataService {
1519
1519
  this.addCreatedRecord("customer_group", customerGroup.id);
1520
1520
  return customerGroup;
1521
1521
  }
1522
+ /**
1523
+ * Creates a system config entry
1524
+ *
1525
+ * @param configurationKey - Config key for shop configurations.
1526
+ * @param configurationValue - Config value as object for shop configurations (see {@link https://shopware.stoplight.io/docs/admin-api/9174d032146f8-create-a-new-system-config-resources|AdminApi Stoplight}).
1527
+ * @param salesChannelId - Unique identity of sales channel.
1528
+ */
1529
+ async createSystemConfigEntry(configurationKey, configurationValue = {}, salesChannelId = "") {
1530
+ const systemConfigStruct = {
1531
+ id: this.IdProvider.getIdPair().uuid,
1532
+ configurationKey,
1533
+ configurationValue,
1534
+ salesChannelId: salesChannelId || null
1535
+ };
1536
+ const response = await this.AdminApiClient.post("system-config?_response=detail", {
1537
+ data: systemConfigStruct
1538
+ });
1539
+ expect(response.ok()).toBeTruthy();
1540
+ const { data: systemConfigEntry } = await response.json();
1541
+ this.addCreatedRecord("system_config", systemConfigEntry.id);
1542
+ return systemConfigEntry;
1543
+ }
1522
1544
  /**
1523
1545
  * Assigns a media resource as the download of a digital product.
1524
1546
  *
@@ -3208,9 +3230,48 @@ class AccountOrder {
3208
3230
  __publicField$v(this, "cartLineItemImages");
3209
3231
  __publicField$v(this, "orderExpandButton");
3210
3232
  __publicField$v(this, "digitalProductDownloadButton");
3233
+ __publicField$v(this, "dialogOrderCancel");
3234
+ __publicField$v(this, "dialogOrderCancelButton");
3235
+ __publicField$v(this, "dialogBackButton");
3236
+ __publicField$v(this, "getViewSubscriptionLink", (orderNumber) => {
3237
+ const orderContainer = this.page.locator(".order-item-header", { hasText: `Order Number: ${orderNumber}` });
3238
+ return orderContainer.getByText("View Subscription");
3239
+ });
3211
3240
  this.orderExpandButton = page.getByRole("button", { name: /Expand|Show details/ }).first();
3212
3241
  this.cartLineItemImages = page.locator(".line-item-img-link");
3213
3242
  this.digitalProductDownloadButton = page.getByRole("link", { name: "Download" }).first();
3243
+ this.dialogOrderCancel = page.getByRole("dialog", { name: "Cancel order" });
3244
+ this.dialogOrderCancelButton = this.dialogOrderCancel.getByRole("button", { name: "Cancel order" });
3245
+ this.dialogBackButton = this.dialogOrderCancel.getByRole("button", { name: "Back" });
3246
+ }
3247
+ async getOrderByOrderNumber(orderNumber) {
3248
+ const orderItem = this.page.getByRole("listitem").getByLabel(`Order number ${orderNumber}`);
3249
+ const orderStatus = orderItem.locator(".order-table-header-order-status");
3250
+ const orderHeading = orderItem.locator(".order-table-header-heading");
3251
+ const orderActionsButton = orderItem.getByLabel("Actions");
3252
+ const orderCancelButton = orderItem.getByRole("button", { name: "Cancel order" });
3253
+ const orderRepeatButton = orderItem.getByRole("button", { name: "Repeat order" });
3254
+ const orderChangePaymentMethodButton = orderItem.getByRole("link", { name: "Change payment method" });
3255
+ const orderShippingStatus = orderItem.locator(".order-table-body-value").nth(1);
3256
+ const orderPaymentStatus = orderItem.locator(".order-table-body-value").nth(2);
3257
+ const orderPaymentMethod = orderItem.locator(".order-table-body-value").nth(3);
3258
+ const orderShippingMethod = orderItem.locator(".order-table-body-value").nth(4);
3259
+ const orderDetailButton = orderItem.getByRole("button", { name: /Expand|Show details/ });
3260
+ const orderImage = orderItem.locator(".line-item-img-link");
3261
+ return {
3262
+ orderStatus,
3263
+ orderHeading,
3264
+ orderActionsButton,
3265
+ orderCancelButton,
3266
+ orderRepeatButton,
3267
+ orderChangePaymentMethodButton,
3268
+ orderShippingStatus,
3269
+ orderPaymentStatus,
3270
+ orderPaymentMethod,
3271
+ orderShippingMethod,
3272
+ orderDetailButton,
3273
+ orderImage
3274
+ };
3214
3275
  }
3215
3276
  url() {
3216
3277
  return "account/order";
@@ -3444,7 +3505,7 @@ class ProductDetail {
3444
3505
  this.generateVariantsButton = page.getByRole("button", { name: "Generate variants" });
3445
3506
  this.variantsModal = page.getByRole("dialog", { name: "Generate variants" });
3446
3507
  this.variantsModalHeadline = this.variantsModal.getByRole("heading", { name: "Generate variants" });
3447
- this.variantsNextButton = this.variantsModal.getByRole("button", { name: "Next" });
3508
+ this.variantsNextButton = this.variantsModal.getByRole("button", { name: "Next", exact: true });
3448
3509
  this.variantsSaveButton = this.variantsModal.getByRole("button", { name: "Save variants" });
3449
3510
  this.propertyGroupColor = this.variantsModal.getByText("Color").first();
3450
3511
  this.propertyGroupSize = this.variantsModal.getByText("Size").first();
@@ -4086,6 +4147,7 @@ class Categories {
4086
4147
  __publicField$a(this, "categoryMenuItemList");
4087
4148
  __publicField$a(this, "createCategoryInput");
4088
4149
  __publicField$a(this, "confirmCategoryCreationButton");
4150
+ __publicField$a(this, "confirmCategoryCancelButton");
4089
4151
  __publicField$a(this, "categoryItems");
4090
4152
  /**
4091
4153
  * General
@@ -4096,6 +4158,7 @@ class Categories {
4096
4158
  __publicField$a(this, "filtersResultPopoverItemList");
4097
4159
  __publicField$a(this, "saveButton");
4098
4160
  __publicField$a(this, "loadingSpinner");
4161
+ __publicField$a(this, "fadingBar");
4099
4162
  /**
4100
4163
  * Customisable link
4101
4164
  */
@@ -4117,7 +4180,8 @@ class Categories {
4117
4180
  this.categoryMenuItemList = page.locator(".sw-context-button__menu-popover").locator(".sw-context-menu-item");
4118
4181
  this.createCategoryInput = page.getByPlaceholder("Create category").getByRole("textbox");
4119
4182
  this.confirmCategoryCreationButton = page.locator(".sw-confirm-field").locator(".sw-button--primary");
4120
- this.categoryItems = this.categoryTree.locator(".sw-tree-item__label");
4183
+ this.categoryItems = this.categoryTree.locator(".tree-link");
4184
+ this.confirmCategoryCancelButton = page.locator(".sw-confirm-field").locator(".sw-confirm-field__button--cancel");
4121
4185
  this.nameInput = page.getByLabel("Name");
4122
4186
  this.activeCheckbox = page.getByRole("checkbox", { name: "Active" });
4123
4187
  this.saveButton = page.getByRole("button", { name: "Save" });
@@ -4132,6 +4196,7 @@ class Categories {
4132
4196
  this.filterResultPopoverTreeCheckboxItemList = this.popoverCategoryTree.locator(".sw-tree__content").locator(".sw-tree-item");
4133
4197
  this.openInNewTabCheckbox = page.getByRole("checkbox", { name: "Open in new tab" });
4134
4198
  this.loadingSpinner = page.locator(".sw-loader");
4199
+ this.fadingBar = page.locator(".fade-leave-active");
4135
4200
  }
4136
4201
  async getLandingPageByName(landingPageName) {
4137
4202
  return this.landingPageItems.locator(`text="${landingPageName}"`);
@@ -5155,9 +5220,59 @@ const ExpectNotification = test$e.extend({
5155
5220
  }
5156
5221
  });
5157
5222
 
5223
+ const CreateLinkTypeCategory = test$e.extend({
5224
+ CreateLinkTypeCategory: async ({ AdminCategories, AdminCategoryDetail, TestDataService }, use) => {
5225
+ const task = (categoryData, categoryCustomizableLinkData) => {
5226
+ return async function CreateLinkTypeCategory2() {
5227
+ await AdminCategories.homeCategoryContextButton.click();
5228
+ await AdminCategories.categoryMenuItemList.filter({ hasText: "New category after" }).click();
5229
+ await AdminCategories.createCategoryInput.fill(categoryData.name);
5230
+ await AdminCategories.confirmCategoryCreationButton.click();
5231
+ await AdminCategories.fadingBar.first().waitFor({ state: "hidden" });
5232
+ await AdminCategories.confirmCategoryCancelButton.click();
5233
+ await AdminCategories.categoryItems.filter({ hasText: categoryData.name }).click();
5234
+ await AdminCategories.nameInput.fill(categoryData.name);
5235
+ await AdminCategories.activeCheckbox.setChecked(categoryData.status);
5236
+ await AdminCategories.categoryTypeSelectionList.click();
5237
+ await AdminCategories.filtersResultPopoverItemList.filter({ hasText: categoryData.categoryType }).click();
5238
+ await AdminCategories.linkTypeSelectionList.click();
5239
+ await AdminCategories.filtersResultPopoverItemList.filter({ hasText: categoryCustomizableLinkData.linkType }).click();
5240
+ await AdminCategories.entitySelectionList.click();
5241
+ await AdminCategories.filtersResultPopoverItemList.filter({ hasText: categoryCustomizableLinkData.entity }).click();
5242
+ let locator;
5243
+ switch (categoryCustomizableLinkData.entity) {
5244
+ case "Category":
5245
+ await AdminCategories.categorySelectionList.click();
5246
+ locator = await AdminCategories.getPopOverCategoryByName(categoryCustomizableLinkData.category);
5247
+ await locator.getByRole("checkbox").click();
5248
+ break;
5249
+ case "Product":
5250
+ await AdminCategories.productSelectionList.click();
5251
+ await AdminCategories.filtersResultPopoverItemList.filter({ hasText: categoryCustomizableLinkData.product }).click();
5252
+ break;
5253
+ case "Landing page":
5254
+ await AdminCategories.landingPageSelectionList.click();
5255
+ await AdminCategories.filtersResultPopoverItemList.filter({ hasText: categoryCustomizableLinkData.landingPage }).click();
5256
+ break;
5257
+ default:
5258
+ throw new Error("Entity type not found");
5259
+ }
5260
+ await AdminCategories.openInNewTabCheckbox.setChecked(categoryCustomizableLinkData.openInNewTab);
5261
+ await AdminCategories.saveButton.click();
5262
+ await AdminCategories.loadingSpinner.waitFor({ state: "hidden" });
5263
+ const url = AdminCategoryDetail.page.url();
5264
+ const categoryId = url.split("/")[url.split("/").length - 2];
5265
+ TestDataService.addCreatedRecord("category", categoryId);
5266
+ };
5267
+ };
5268
+ await use(task);
5269
+ }
5270
+ });
5271
+
5158
5272
  const test$3 = mergeTests(
5159
5273
  SaveProduct,
5160
- ExpectNotification
5274
+ ExpectNotification,
5275
+ CreateLinkTypeCategory
5161
5276
  );
5162
5277
 
5163
5278
  const Login = test$e.extend({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",