@shopware-ag/acceptance-test-suite 12.17.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
  *
@@ -6690,6 +6698,13 @@ interface Options {
6690
6698
  headerElement?: string;
6691
6699
  }
6692
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>;
6693
6708
  /**
6694
6709
  * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
6695
6710
  *
@@ -6860,5 +6875,5 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6860
6875
  SalesChannelBaseConfig: StoreBaseConfig;
6861
6876
  }>;
6862
6877
 
6863
- 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 };
6864
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
  *
@@ -6690,6 +6698,13 @@ interface Options {
6690
6698
  headerElement?: string;
6691
6699
  }
6692
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>;
6693
6708
  /**
6694
6709
  * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
6695
6710
  *
@@ -6860,5 +6875,5 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6860
6875
  SalesChannelBaseConfig: StoreBaseConfig;
6861
6876
  }>;
6862
6877
 
6863
- 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 };
6864
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
  *
@@ -12148,6 +12195,7 @@ const CreateFlow = test$e.extend({
12148
12195
  CreateFlow: async ({ AdminFlowBuilderCreate, AdminFlowBuilderDetail, AdminFlowBuilderListing, ShopAdmin, TestDataService }, use) => {
12149
12196
  const task = (flowConfig) => {
12150
12197
  return async function createFlow() {
12198
+ const flowActionsLoaded = AdminFlowBuilderCreate.page.waitForResponse((response) => response.url().includes("/_info/flow-actions.json") && response.ok());
12151
12199
  await AdminFlowBuilderListing.createFlowButton.click();
12152
12200
  await ShopAdmin.expects(AdminFlowBuilderCreate.smartBarHeader).toHaveText(translate("administration:flowBuilder:create.newFlow"));
12153
12201
  await AdminFlowBuilderCreate.nameField.fill(`${flowConfig.name}`);
@@ -12163,6 +12211,7 @@ const CreateFlow = test$e.extend({
12163
12211
  await AdminFlowBuilderCreate.conditionSelectField.click();
12164
12212
  await ShopAdmin.expects(AdminFlowBuilderCreate.resultList).toBeVisible();
12165
12213
  await AdminFlowBuilderCreate.resultListItem.getByRole("listitem").filter({ hasText: `${flowConfig.condition}` }).click();
12214
+ await flowActionsLoaded;
12166
12215
  await AdminFlowBuilderCreate.trueBlockAddActionButton.click();
12167
12216
  await AdminFlowBuilderCreate.trueBlockActionSelectField.click();
12168
12217
  await ShopAdmin.expects(AdminFlowBuilderCreate.resultList).toBeVisible();
@@ -13280,6 +13329,13 @@ async function setViewport(page, options = {}) {
13280
13329
  console.warn(`[Success] Viewport size: width=${contentWidth}, height=${totalHeight}`);
13281
13330
  return;
13282
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
+ }
13283
13339
  async function assertScreenshot(page, filename, locator) {
13284
13340
  if (locator) {
13285
13341
  await expect(locator).toHaveScreenshot(filename);
@@ -13321,4 +13377,4 @@ const test = mergeTests(
13321
13377
  test$3
13322
13378
  );
13323
13379
 
13324
- 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.17.0",
3
+ "version": "12.18.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "keywords": [
6
6
  "fixtures",