@shopware-ag/acceptance-test-suite 12.16.0 → 12.18.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
@@ -741,6 +741,14 @@ declare class TestDataService {
741
741
  * @param salesChannel - The sales channel in which the order should be created.
742
742
  */
743
743
  createOrder(lineItems: SimpleLineItem[], customer: Customer, overrides?: Partial<Order>, salesChannel?: SalesChannel): Promise<Order>;
744
+ /**
745
+ * Sets the primary order references.
746
+ *
747
+ * @param order - The order you want to set the references for.
748
+ */
749
+ setPrimaryOrderReferences(order: {
750
+ id: string;
751
+ }): Promise<void>;
744
752
  /**
745
753
  * Creates a new promotion with a promotion code and only single discount option.
746
754
  *
@@ -5548,6 +5556,7 @@ declare class Dashboard implements PageObject {
5548
5556
  readonly adminMenuContent: Locator;
5549
5557
  readonly adminMenuMarketing: Locator;
5550
5558
  readonly adminMenuExtension: Locator;
5559
+ readonly adminMenuAutomation: Locator;
5551
5560
  readonly adminMenuSettings: Locator;
5552
5561
  readonly adminMenuUserChevron: Locator;
5553
5562
  readonly adminMenuUserIcon: Locator;
@@ -6689,6 +6698,13 @@ interface Options {
6689
6698
  headerElement?: string;
6690
6699
  }
6691
6700
  declare function setViewport(page: Page, options?: Options): Promise<void>;
6701
+ /**
6702
+ * Forces the admin navigation sidebar back into its expanded state for the given page.
6703
+ * Reloads the page afterwards, since the app only picks up the flag on boot.
6704
+ *
6705
+ * @param page - Playwright page object
6706
+ */
6707
+ declare function expandAdminMenu(page: Page): Promise<void>;
6692
6708
  /**
6693
6709
  * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
6694
6710
  *
@@ -6859,5 +6875,5 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6859
6875
  SalesChannelBaseConfig: StoreBaseConfig;
6860
6876
  }>;
6861
6877
 
6862
- 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, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
6878
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, expandAdminMenu, 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, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
6863
6879
  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, UploadMediaTarget, User, VariantListingConfig };
package/dist/index.d.ts CHANGED
@@ -741,6 +741,14 @@ declare class TestDataService {
741
741
  * @param salesChannel - The sales channel in which the order should be created.
742
742
  */
743
743
  createOrder(lineItems: SimpleLineItem[], customer: Customer, overrides?: Partial<Order>, salesChannel?: SalesChannel): Promise<Order>;
744
+ /**
745
+ * Sets the primary order references.
746
+ *
747
+ * @param order - The order you want to set the references for.
748
+ */
749
+ setPrimaryOrderReferences(order: {
750
+ id: string;
751
+ }): Promise<void>;
744
752
  /**
745
753
  * Creates a new promotion with a promotion code and only single discount option.
746
754
  *
@@ -5548,6 +5556,7 @@ declare class Dashboard implements PageObject {
5548
5556
  readonly adminMenuContent: Locator;
5549
5557
  readonly adminMenuMarketing: Locator;
5550
5558
  readonly adminMenuExtension: Locator;
5559
+ readonly adminMenuAutomation: Locator;
5551
5560
  readonly adminMenuSettings: Locator;
5552
5561
  readonly adminMenuUserChevron: Locator;
5553
5562
  readonly adminMenuUserIcon: Locator;
@@ -6689,6 +6698,13 @@ interface Options {
6689
6698
  headerElement?: string;
6690
6699
  }
6691
6700
  declare function setViewport(page: Page, options?: Options): Promise<void>;
6701
+ /**
6702
+ * Forces the admin navigation sidebar back into its expanded state for the given page.
6703
+ * Reloads the page afterwards, since the app only picks up the flag on boot.
6704
+ *
6705
+ * @param page - Playwright page object
6706
+ */
6707
+ declare function expandAdminMenu(page: Page): Promise<void>;
6692
6708
  /**
6693
6709
  * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
6694
6710
  *
@@ -6859,5 +6875,5 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6859
6875
  SalesChannelBaseConfig: StoreBaseConfig;
6860
6876
  }>;
6861
6877
 
6862
- 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, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
6878
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, expandAdminMenu, 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, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
6863
6879
  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, UploadMediaTarget, User, VariantListingConfig };
package/dist/index.mjs CHANGED
@@ -4726,8 +4726,55 @@ class TestDataService {
4726
4726
  expect(orderResponse.ok()).toBeTruthy();
4727
4727
  const { data: order } = await orderResponse.json();
4728
4728
  this.addCreatedRecord("order", order.id);
4729
+ await this.setPrimaryOrderReferences(order);
4729
4730
  return order;
4730
4731
  }
4732
+ /**
4733
+ * Sets the primary order references.
4734
+ *
4735
+ * @param order - The order you want to set the references for.
4736
+ */
4737
+ async setPrimaryOrderReferences(order) {
4738
+ const transactionResponse = await this.AdminApiClient.post("search/order-transaction", {
4739
+ data: {
4740
+ limit: 1,
4741
+ filter: [{ type: "equals", field: "orderId", value: order.id }]
4742
+ }
4743
+ });
4744
+ const deliveryResponse = await this.AdminApiClient.post("search/order-delivery", {
4745
+ data: {
4746
+ limit: 1,
4747
+ filter: [{ type: "equals", field: "orderId", value: order.id }]
4748
+ }
4749
+ });
4750
+ let transaction;
4751
+ let delivery;
4752
+ if (transactionResponse.ok()) {
4753
+ const transactionData = await transactionResponse.json();
4754
+ transaction = transactionData.data?.[0];
4755
+ }
4756
+ if (deliveryResponse.ok()) {
4757
+ const deliveryData = await deliveryResponse.json();
4758
+ delivery = deliveryData.data?.[0];
4759
+ }
4760
+ if (!transaction) {
4761
+ throw new Error(`Order ${order.id} does not contain a transaction`);
4762
+ }
4763
+ if (!delivery) {
4764
+ throw new Error(`Order ${order.id} does not contain a delivery`);
4765
+ }
4766
+ const response = await this.AdminApiClient.patch(`order/${order.id}`, {
4767
+ data: {
4768
+ primaryOrderTransactionId: transaction.id,
4769
+ primaryOrderDeliveryId: delivery.id,
4770
+ ...transaction.versionId ? { primaryOrderTransactionVersionId: transaction.versionId } : {},
4771
+ ...delivery.versionId ? { primaryOrderDeliveryVersionId: delivery.versionId } : {}
4772
+ }
4773
+ });
4774
+ if (!response.ok()) {
4775
+ throw new Error(`Failed to set the primary order references for order ${order.id}: ${response.statusText()}`);
4776
+ }
4777
+ }
4731
4778
  /**
4732
4779
  * Creates a new promotion with a promotion code and only single discount option.
4733
4780
  *
@@ -9282,6 +9329,7 @@ class Dashboard {
9282
9329
  adminMenuContent;
9283
9330
  adminMenuMarketing;
9284
9331
  adminMenuExtension;
9332
+ adminMenuAutomation;
9285
9333
  adminMenuSettings;
9286
9334
  adminMenuUserChevron;
9287
9335
  adminMenuUserIcon;
@@ -9314,6 +9362,7 @@ class Dashboard {
9314
9362
  this.adminMenuContent = page.locator(".sw-content");
9315
9363
  this.adminMenuMarketing = page.locator(".sw-marketing");
9316
9364
  this.adminMenuExtension = page.locator(".sw-extension");
9365
+ this.adminMenuAutomation = page.locator(".sw-automation");
9317
9366
  this.adminMenuUserChevron = page.locator(".sw-admin-menu__user-actions-indicator");
9318
9367
  this.adminMenuUserIcon = page.locator(".sw-avatar");
9319
9368
  this.adminMenuUserName = page.locator(".sw-admin-menu__user-name");
@@ -12146,6 +12195,7 @@ const CreateFlow = test$e.extend({
12146
12195
  CreateFlow: async ({ AdminFlowBuilderCreate, AdminFlowBuilderDetail, AdminFlowBuilderListing, ShopAdmin, TestDataService }, use) => {
12147
12196
  const task = (flowConfig) => {
12148
12197
  return async function createFlow() {
12198
+ const flowActionsLoaded = AdminFlowBuilderCreate.page.waitForResponse((response) => response.url().includes("/_info/flow-actions.json") && response.ok());
12149
12199
  await AdminFlowBuilderListing.createFlowButton.click();
12150
12200
  await ShopAdmin.expects(AdminFlowBuilderCreate.smartBarHeader).toHaveText(translate("administration:flowBuilder:create.newFlow"));
12151
12201
  await AdminFlowBuilderCreate.nameField.fill(`${flowConfig.name}`);
@@ -12161,6 +12211,7 @@ const CreateFlow = test$e.extend({
12161
12211
  await AdminFlowBuilderCreate.conditionSelectField.click();
12162
12212
  await ShopAdmin.expects(AdminFlowBuilderCreate.resultList).toBeVisible();
12163
12213
  await AdminFlowBuilderCreate.resultListItem.getByRole("listitem").filter({ hasText: `${flowConfig.condition}` }).click();
12214
+ await flowActionsLoaded;
12164
12215
  await AdminFlowBuilderCreate.trueBlockAddActionButton.click();
12165
12216
  await AdminFlowBuilderCreate.trueBlockActionSelectField.click();
12166
12217
  await ShopAdmin.expects(AdminFlowBuilderCreate.resultList).toBeVisible();
@@ -13278,6 +13329,13 @@ async function setViewport(page, options = {}) {
13278
13329
  console.warn(`[Success] Viewport size: width=${contentWidth}, height=${totalHeight}`);
13279
13330
  return;
13280
13331
  }
13332
+ const ADMIN_MENU_EXPANDED_STORAGE_KEY = "sw-admin-menu-expanded";
13333
+ async function expandAdminMenu(page) {
13334
+ await page.evaluate((key) => {
13335
+ localStorage.setItem(key, "true");
13336
+ }, ADMIN_MENU_EXPANDED_STORAGE_KEY);
13337
+ await page.reload();
13338
+ }
13281
13339
  async function assertScreenshot(page, filename, locator) {
13282
13340
  if (locator) {
13283
13341
  await expect(locator).toHaveScreenshot(filename);
@@ -13319,4 +13377,4 @@ const test = mergeTests(
13319
13377
  test$3
13320
13378
  );
13321
13379
 
13322
- 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, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
13380
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, expandAdminMenu, 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, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "12.16.0",
3
+ "version": "12.18.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "keywords": [
6
6
  "fixtures",