@shopware-ag/acceptance-test-suite 11.12.4 → 11.13.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/README.md CHANGED
@@ -17,6 +17,7 @@ This test suite is an extension to [Playwright](https://playwright.dev/) to easi
17
17
  * [Test Data Service](#test-data-service)
18
18
  * [Code Contribution](#code-contribution)
19
19
  * [Best practices](#best-practices)
20
+ * [Running Tests in the Test Suite](#running-tests-in-the-test-suite)
20
21
 
21
22
  ## Installation
22
23
  Start by creating your own [Playwright](https://playwright.dev/docs/intro) project.
package/dist/index.d.mts CHANGED
@@ -440,6 +440,30 @@ interface CustomFieldData {
440
440
  customFieldSetName: string;
441
441
  customFieldValue: string;
442
442
  }
443
+ interface FlowTemplate {
444
+ id: string;
445
+ name: string;
446
+ config: {
447
+ eventName: string;
448
+ sequences: [
449
+ {
450
+ actionName: string;
451
+ config: string;
452
+ }
453
+ ];
454
+ };
455
+ }
456
+ interface Flow {
457
+ id: string;
458
+ name: string;
459
+ eventName: string;
460
+ sequences: [
461
+ {
462
+ actionName: string;
463
+ config: string;
464
+ }
465
+ ];
466
+ }
443
467
 
444
468
  interface SalesChannelRecord {
445
469
  salesChannelId: string;
@@ -1920,9 +1944,14 @@ declare class FlowBuilderCreate implements PageObject {
1920
1944
  readonly page: Page;
1921
1945
  readonly saveButton: Locator;
1922
1946
  readonly header: Locator;
1947
+ readonly nameField: Locator;
1948
+ readonly flowTab: Locator;
1949
+ readonly triggerSelectField: Locator;
1950
+ readonly addActionField: Locator;
1951
+ readonly smartBarHeader: Locator;
1923
1952
  readonly newFlowHeader: Locator;
1924
1953
  constructor(page: Page);
1925
- url(): string;
1954
+ url(flowId?: string, tabName?: string): string;
1926
1955
  }
1927
1956
 
1928
1957
  declare class FlowBuilderListing implements PageObject {
@@ -1940,17 +1969,34 @@ declare class FlowBuilderListing implements PageObject {
1940
1969
  readonly flowDeleteButton: Locator;
1941
1970
  readonly successAlert: Locator;
1942
1971
  readonly successAlertMessage: Locator;
1972
+ readonly searchBar: Locator;
1943
1973
  constructor(page: Page);
1944
1974
  url(): string;
1945
1975
  getLineItemByFlowName(flowName: string): Promise<Record<string, Locator>>;
1946
1976
  }
1947
1977
 
1948
- declare class FlowBuilderDetail implements PageObject {
1978
+ declare class FlowBuilderTemplates extends FlowBuilderListing implements PageObject {
1949
1979
  readonly page: Page;
1980
+ constructor(page: Page);
1981
+ url(): string;
1982
+ getLineItemByFlowName(flowName: string): Promise<{
1983
+ createFlowLink: playwright_core.Locator;
1984
+ lineItem: playwright_core.Locator;
1985
+ templateDetailLink: playwright_core.Locator;
1986
+ }>;
1987
+ }
1988
+
1989
+ declare class FlowBuilderDetail extends FlowBuilderCreate implements PageObject {
1990
+ readonly page: Page;
1991
+ readonly instanceMeta: HelperFixtureTypes['InstanceMeta'];
1992
+ readonly saveButtonLoader: Locator;
1950
1993
  readonly saveButton: Locator;
1951
1994
  readonly generalTab: Locator;
1952
1995
  readonly flowTab: Locator;
1953
- constructor(page: Page);
1996
+ readonly alertWarning: Locator;
1997
+ readonly templateName: Locator;
1998
+ readonly alertMessage: Locator;
1999
+ constructor(page: Page, instanceMeta: HelperFixtureTypes['InstanceMeta']);
1954
2000
  url(flowId: string, tabName?: string): string;
1955
2001
  }
1956
2002
 
@@ -2392,6 +2438,7 @@ interface AdministrationPageTypes {
2392
2438
  AdminFirstRunWizard: FirstRunWizard;
2393
2439
  AdminFlowBuilderCreate: FlowBuilderCreate;
2394
2440
  AdminFlowBuilderListing: FlowBuilderListing;
2441
+ AdminFlowBuilderTemplates: FlowBuilderTemplates;
2395
2442
  AdminFlowBuilderDetail: FlowBuilderDetail;
2396
2443
  AdminDataSharing: DataSharing;
2397
2444
  AdminDashboard: Dashboard;
@@ -2426,6 +2473,7 @@ declare const AdminPageObjects: {
2426
2473
  FirstRunWizard: typeof FirstRunWizard;
2427
2474
  FlowBuilderCreate: typeof FlowBuilderCreate;
2428
2475
  FlowBuilderListing: typeof FlowBuilderListing;
2476
+ FlowBuilderTemplates: typeof FlowBuilderTemplates;
2429
2477
  FlowBuilderDetail: typeof FlowBuilderDetail;
2430
2478
  Dashboard: typeof Dashboard;
2431
2479
  DataSharing: typeof DataSharing;
@@ -2522,6 +2570,9 @@ declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApi
2522
2570
  id: string;
2523
2571
  }>;
2524
2572
  declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>;
2573
+ declare const getFlowTemplate: (flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<FlowTemplate>;
2574
+ declare const getFlow: (flowId: string, adminApiContext: AdminApiContext) => Promise<Flow>;
2575
+ declare const compareFlowTemplateWithFlow: (flowId: string, flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<boolean>;
2525
2576
  declare function extractIdFromUrl(url: string): string | null;
2526
2577
  type OrderStatus = 'cancel' | 'complete' | 'reopen' | 'process';
2527
2578
  declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
@@ -2597,4 +2648,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
2597
2648
  AddProductToWishlist: Task;
2598
2649
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
2599
2650
 
2600
- export { type AccountData, type Address, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country$1 as Country, type CreatedRecord, type Currency$2 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Language$2 as Language, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod$1 as PaymentMethod, type Price, type Product, type ProductCrossSelling, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod$1 as ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, type Task, type Tax$1 as Tax, type TaxRules, TestDataService, type VariantListingConfig, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
2651
+ export { type AccountData, type Address, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country$1 as Country, type CreatedRecord, type Currency$2 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Flow, type FlowTemplate, type Language$2 as Language, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod$1 as PaymentMethod, type Price, type Product, type ProductCrossSelling, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod$1 as ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, type Task, type Tax$1 as Tax, type TaxRules, TestDataService, type VariantListingConfig, compareFlowTemplateWithFlow, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
package/dist/index.d.ts CHANGED
@@ -440,6 +440,30 @@ interface CustomFieldData {
440
440
  customFieldSetName: string;
441
441
  customFieldValue: string;
442
442
  }
443
+ interface FlowTemplate {
444
+ id: string;
445
+ name: string;
446
+ config: {
447
+ eventName: string;
448
+ sequences: [
449
+ {
450
+ actionName: string;
451
+ config: string;
452
+ }
453
+ ];
454
+ };
455
+ }
456
+ interface Flow {
457
+ id: string;
458
+ name: string;
459
+ eventName: string;
460
+ sequences: [
461
+ {
462
+ actionName: string;
463
+ config: string;
464
+ }
465
+ ];
466
+ }
443
467
 
444
468
  interface SalesChannelRecord {
445
469
  salesChannelId: string;
@@ -1920,9 +1944,14 @@ declare class FlowBuilderCreate implements PageObject {
1920
1944
  readonly page: Page;
1921
1945
  readonly saveButton: Locator;
1922
1946
  readonly header: Locator;
1947
+ readonly nameField: Locator;
1948
+ readonly flowTab: Locator;
1949
+ readonly triggerSelectField: Locator;
1950
+ readonly addActionField: Locator;
1951
+ readonly smartBarHeader: Locator;
1923
1952
  readonly newFlowHeader: Locator;
1924
1953
  constructor(page: Page);
1925
- url(): string;
1954
+ url(flowId?: string, tabName?: string): string;
1926
1955
  }
1927
1956
 
1928
1957
  declare class FlowBuilderListing implements PageObject {
@@ -1940,17 +1969,34 @@ declare class FlowBuilderListing implements PageObject {
1940
1969
  readonly flowDeleteButton: Locator;
1941
1970
  readonly successAlert: Locator;
1942
1971
  readonly successAlertMessage: Locator;
1972
+ readonly searchBar: Locator;
1943
1973
  constructor(page: Page);
1944
1974
  url(): string;
1945
1975
  getLineItemByFlowName(flowName: string): Promise<Record<string, Locator>>;
1946
1976
  }
1947
1977
 
1948
- declare class FlowBuilderDetail implements PageObject {
1978
+ declare class FlowBuilderTemplates extends FlowBuilderListing implements PageObject {
1949
1979
  readonly page: Page;
1980
+ constructor(page: Page);
1981
+ url(): string;
1982
+ getLineItemByFlowName(flowName: string): Promise<{
1983
+ createFlowLink: playwright_core.Locator;
1984
+ lineItem: playwright_core.Locator;
1985
+ templateDetailLink: playwright_core.Locator;
1986
+ }>;
1987
+ }
1988
+
1989
+ declare class FlowBuilderDetail extends FlowBuilderCreate implements PageObject {
1990
+ readonly page: Page;
1991
+ readonly instanceMeta: HelperFixtureTypes['InstanceMeta'];
1992
+ readonly saveButtonLoader: Locator;
1950
1993
  readonly saveButton: Locator;
1951
1994
  readonly generalTab: Locator;
1952
1995
  readonly flowTab: Locator;
1953
- constructor(page: Page);
1996
+ readonly alertWarning: Locator;
1997
+ readonly templateName: Locator;
1998
+ readonly alertMessage: Locator;
1999
+ constructor(page: Page, instanceMeta: HelperFixtureTypes['InstanceMeta']);
1954
2000
  url(flowId: string, tabName?: string): string;
1955
2001
  }
1956
2002
 
@@ -2392,6 +2438,7 @@ interface AdministrationPageTypes {
2392
2438
  AdminFirstRunWizard: FirstRunWizard;
2393
2439
  AdminFlowBuilderCreate: FlowBuilderCreate;
2394
2440
  AdminFlowBuilderListing: FlowBuilderListing;
2441
+ AdminFlowBuilderTemplates: FlowBuilderTemplates;
2395
2442
  AdminFlowBuilderDetail: FlowBuilderDetail;
2396
2443
  AdminDataSharing: DataSharing;
2397
2444
  AdminDashboard: Dashboard;
@@ -2426,6 +2473,7 @@ declare const AdminPageObjects: {
2426
2473
  FirstRunWizard: typeof FirstRunWizard;
2427
2474
  FlowBuilderCreate: typeof FlowBuilderCreate;
2428
2475
  FlowBuilderListing: typeof FlowBuilderListing;
2476
+ FlowBuilderTemplates: typeof FlowBuilderTemplates;
2429
2477
  FlowBuilderDetail: typeof FlowBuilderDetail;
2430
2478
  Dashboard: typeof Dashboard;
2431
2479
  DataSharing: typeof DataSharing;
@@ -2522,6 +2570,9 @@ declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApi
2522
2570
  id: string;
2523
2571
  }>;
2524
2572
  declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>;
2573
+ declare const getFlowTemplate: (flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<FlowTemplate>;
2574
+ declare const getFlow: (flowId: string, adminApiContext: AdminApiContext) => Promise<Flow>;
2575
+ declare const compareFlowTemplateWithFlow: (flowId: string, flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<boolean>;
2525
2576
  declare function extractIdFromUrl(url: string): string | null;
2526
2577
  type OrderStatus = 'cancel' | 'complete' | 'reopen' | 'process';
2527
2578
  declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
@@ -2597,4 +2648,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
2597
2648
  AddProductToWishlist: Task;
2598
2649
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
2599
2650
 
2600
- export { type AccountData, type Address, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country$1 as Country, type CreatedRecord, type Currency$2 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Language$2 as Language, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod$1 as PaymentMethod, type Price, type Product, type ProductCrossSelling, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod$1 as ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, type Task, type Tax$1 as Tax, type TaxRules, TestDataService, type VariantListingConfig, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
2651
+ export { type AccountData, type Address, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country$1 as Country, type CreatedRecord, type Currency$2 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Flow, type FlowTemplate, type Language$2 as Language, type Manufacturer, type Media, type Order, type OrderDelivery, type OrderLineItem, type OrderStatus, type PageObject, type PaymentMethod$1 as PaymentMethod, type Price, type Product, type ProductCrossSelling, type ProductPrice, type Promotion, type PromotionDiscount, type PropertyGroup, type PropertyGroupOption, type RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod$1 as ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, type Task, type Tax$1 as Tax, type TaxRules, TestDataService, type VariantListingConfig, compareFlowTemplateWithFlow, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
package/dist/index.mjs CHANGED
@@ -958,6 +958,53 @@ const getMediaId = async (fileName, adminApiContext) => {
958
958
  const result = await resp.json();
959
959
  return result.data[0].id;
960
960
  };
961
+ const getFlowTemplate = async (flowTemplateId, adminApiContext) => {
962
+ const flowTemplateResponse = await adminApiContext.post(`search/flow-template`, {
963
+ data: {
964
+ limit: 1,
965
+ filter: [{
966
+ type: "equals",
967
+ field: "id",
968
+ value: flowTemplateId
969
+ }]
970
+ }
971
+ });
972
+ const result = await flowTemplateResponse.json();
973
+ return result.data[0];
974
+ };
975
+ const getFlow = async (flowId, adminApiContext) => {
976
+ const flowResponse = await adminApiContext.post(`search/flow`, {
977
+ data: {
978
+ limit: 1,
979
+ filter: [{
980
+ type: "equals",
981
+ field: "id",
982
+ value: flowId
983
+ }],
984
+ associations: { sequences: {} }
985
+ }
986
+ });
987
+ const result = await flowResponse.json();
988
+ return result.data[0];
989
+ };
990
+ const compareFlowTemplateWithFlow = async (flowId, flowTemplateId, adminApiContext) => {
991
+ const flowTemplateData = await getFlowTemplate(flowTemplateId, adminApiContext);
992
+ const flowData = await getFlow(flowId, adminApiContext);
993
+ if (flowTemplateData.config.eventName != flowData.eventName) {
994
+ return false;
995
+ }
996
+ let i = 0;
997
+ for (const sequenceTemplate of flowTemplateData.config.sequences) {
998
+ if (sequenceTemplate.actionName != flowData.sequences[i].actionName) {
999
+ return false;
1000
+ }
1001
+ if (JSON.stringify(sequenceTemplate.config) != JSON.stringify(flowData.sequences[i].config)) {
1002
+ return false;
1003
+ }
1004
+ i++;
1005
+ }
1006
+ return true;
1007
+ };
961
1008
  function extractIdFromUrl(url) {
962
1009
  const segments = url.split("/");
963
1010
  return segments.length > 0 ? segments[segments.length - 1] : null;
@@ -3351,6 +3398,7 @@ class Home {
3351
3398
  const flyoutCategoryLink = this.page.locator(".nav-main").locator(".navigation-flyout-category-link").getByText(categoryName);
3352
3399
  return {
3353
3400
  menuNavigationItem,
3401
+ /** @deprecated - Remove, because it is obsolete. */
3354
3402
  offcanvasNavigationItem,
3355
3403
  breadcrumbNavigationItem,
3356
3404
  breadcrumbNavigationLinkItem,
@@ -5068,13 +5116,26 @@ class FlowBuilderCreate {
5068
5116
  this.page = page;
5069
5117
  __publicField$o(this, "saveButton");
5070
5118
  __publicField$o(this, "header");
5119
+ __publicField$o(this, "nameField");
5120
+ __publicField$o(this, "flowTab");
5121
+ __publicField$o(this, "triggerSelectField");
5122
+ __publicField$o(this, "addActionField");
5123
+ __publicField$o(this, "smartBarHeader");
5071
5124
  __publicField$o(this, "newFlowHeader");
5072
5125
  this.saveButton = page.locator(".sw-flow-detail__save");
5073
5126
  this.header = page.locator("h2");
5127
+ this.nameField = page.locator(".sw-flow-detail-general__general-name").getByLabel("Name");
5128
+ this.flowTab = page.locator(".sw-tabs__content").locator(".sw-flow-detail__tab-flow");
5129
+ this.triggerSelectField = page.locator(".sw-flow-detail-flow__trigger-card").getByRole("textbox");
5130
+ this.addActionField = page.locator(".sw-flow-sequence-action__content").locator(".sw-single-select__selection");
5131
+ this.smartBarHeader = page.locator(".smart-bar__header");
5074
5132
  this.newFlowHeader = page.getByRole("heading", { name: "New flow" });
5075
5133
  }
5076
- url() {
5077
- return "#/sw/flow/create/general";
5134
+ url(flowId, tabName = "general") {
5135
+ if (!flowId || flowId === "") {
5136
+ return `#/sw/flow/create/${tabName}`;
5137
+ }
5138
+ return `#/sw/flow/create/${flowId}/${tabName}`;
5078
5139
  }
5079
5140
  }
5080
5141
 
@@ -5100,6 +5161,7 @@ class FlowBuilderListing {
5100
5161
  __publicField$n(this, "flowDeleteButton");
5101
5162
  __publicField$n(this, "successAlert");
5102
5163
  __publicField$n(this, "successAlertMessage");
5164
+ __publicField$n(this, "searchBar");
5103
5165
  this.createFlowButton = page.locator(".sw-flow-list__create");
5104
5166
  this.firstFlowName = page.locator(".sw-data-grid__cell--name a").first();
5105
5167
  this.firstFlowContextButton = page.locator(".sw-data-grid__actions-menu").first();
@@ -5113,6 +5175,7 @@ class FlowBuilderListing {
5113
5175
  this.downloadFlowButton = page.getByRole("button", { name: "Download flow" });
5114
5176
  this.successAlert = page.locator(".sw-alert__body");
5115
5177
  this.successAlertMessage = page.locator(".sw-alert__message");
5178
+ this.searchBar = page.locator(".sw-search-bar__input");
5116
5179
  }
5117
5180
  url() {
5118
5181
  return "#/sw/flow/index/";
@@ -5136,21 +5199,56 @@ class FlowBuilderListing {
5136
5199
  }
5137
5200
  }
5138
5201
 
5202
+ class FlowBuilderTemplates extends FlowBuilderListing {
5203
+ constructor(page) {
5204
+ super(page);
5205
+ this.page = page;
5206
+ }
5207
+ url() {
5208
+ return `#/sw/flow/index/templates`;
5209
+ }
5210
+ async getLineItemByFlowName(flowName) {
5211
+ const lineItem = this.page.locator(".sw-data-grid__row").filter({ has: this.page.getByText(flowName, { exact: true }) });
5212
+ const createFlowLink = lineItem.getByRole("link").getByText("Create new flow from template");
5213
+ const templateDetailLink = lineItem.getByRole("link").getByText(flowName);
5214
+ return {
5215
+ createFlowLink,
5216
+ lineItem,
5217
+ templateDetailLink
5218
+ };
5219
+ }
5220
+ }
5221
+
5139
5222
  var __defProp$m = Object.defineProperty;
5140
5223
  var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5141
5224
  var __publicField$m = (obj, key, value) => {
5142
5225
  __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
5143
5226
  return value;
5144
5227
  };
5145
- class FlowBuilderDetail {
5146
- constructor(page) {
5228
+ class FlowBuilderDetail extends FlowBuilderCreate {
5229
+ constructor(page, instanceMeta) {
5230
+ super(page);
5147
5231
  this.page = page;
5232
+ this.instanceMeta = instanceMeta;
5233
+ __publicField$m(this, "saveButtonLoader");
5148
5234
  __publicField$m(this, "saveButton");
5149
5235
  __publicField$m(this, "generalTab");
5150
5236
  __publicField$m(this, "flowTab");
5151
- this.saveButton = page.locator(".sw-flow-detail__save");
5237
+ __publicField$m(this, "alertWarning");
5238
+ __publicField$m(this, "templateName");
5239
+ __publicField$m(this, "alertMessage");
5240
+ this.saveButtonLoader = page.locator(".mt-button--primary").locator(".mt-button__loader");
5152
5241
  this.generalTab = page.locator(".sw-flow-detail__tab-general");
5242
+ if (satisfies(instanceMeta.version, "<6.7")) {
5243
+ this.alertWarning = page.getByRole("alert").first();
5244
+ this.alertMessage = page.locator(".sw-alert__title");
5245
+ } else {
5246
+ this.alertWarning = page.getByRole("banner").first();
5247
+ this.alertMessage = page.locator(".mt-banner__title");
5248
+ }
5249
+ this.saveButton = page.locator(".sw-flow-detail__save");
5153
5250
  this.flowTab = page.locator(".sw-flow-detail__tab-flow");
5251
+ this.templateName = page.getByLabel("Name");
5154
5252
  }
5155
5253
  url(flowId, tabName = "general") {
5156
5254
  return `#/sw/flow/detail/${flowId}/${tabName}`;
@@ -6199,6 +6297,7 @@ const AdminPageObjects = {
6199
6297
  FirstRunWizard,
6200
6298
  FlowBuilderCreate,
6201
6299
  FlowBuilderListing,
6300
+ FlowBuilderTemplates,
6202
6301
  FlowBuilderDetail,
6203
6302
  Dashboard,
6204
6303
  DataSharing,
@@ -6253,8 +6352,11 @@ const test$6 = test$f.extend({
6253
6352
  AdminFlowBuilderListing: async ({ AdminPage }, use) => {
6254
6353
  await use(new FlowBuilderListing(AdminPage));
6255
6354
  },
6256
- AdminFlowBuilderDetail: async ({ AdminPage }, use) => {
6257
- await use(new FlowBuilderDetail(AdminPage));
6355
+ AdminFlowBuilderTemplates: async ({ AdminPage }, use) => {
6356
+ await use(new FlowBuilderTemplates(AdminPage));
6357
+ },
6358
+ AdminFlowBuilderDetail: async ({ AdminPage, InstanceMeta }, use) => {
6359
+ await use(new FlowBuilderDetail(AdminPage, InstanceMeta));
6258
6360
  },
6259
6361
  AdminDataSharing: async ({ AdminPage, InstanceMeta }, use) => {
6260
6362
  await use(new DataSharing(AdminPage, InstanceMeta));
@@ -6884,14 +6986,23 @@ const SaveProduct = test$f.extend({
6884
6986
  });
6885
6987
 
6886
6988
  const ExpectNotification = test$f.extend({
6887
- ExpectNotification: async ({ ShopAdmin }, use) => {
6989
+ ExpectNotification: async ({ ShopAdmin, InstanceMeta }, use) => {
6888
6990
  const task = (message, close = true) => {
6889
6991
  return async function ExpectNotification2() {
6890
- const notification = ShopAdmin.page.locator(".sw-alert", { hasText: message });
6992
+ let notification;
6993
+ if (satisfies(InstanceMeta.version, "<6.7")) {
6994
+ notification = ShopAdmin.page.locator(".sw-alert", { hasText: message });
6995
+ } else {
6996
+ notification = ShopAdmin.page.locator(".sw-notification__alert", { hasText: message });
6997
+ }
6891
6998
  await ShopAdmin.expects(notification).toBeVisible();
6892
6999
  await ShopAdmin.expects(notification).toContainText(message);
6893
7000
  if (close) {
6894
- await notification.locator(".sw-alert__close").click();
7001
+ if (satisfies(InstanceMeta.version, "<6.7")) {
7002
+ await notification.locator(".sw-alert__close").click();
7003
+ } else {
7004
+ await notification.locator(".mt-banner__close").click();
7005
+ }
6895
7006
  }
6896
7007
  };
6897
7008
  };
@@ -7811,4 +7922,4 @@ const test = mergeTests(
7811
7922
  test$3
7812
7923
  );
7813
7924
 
7814
- export { AdminPageObjects, RuleType, StorefrontPageObjects, TestDataService, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
7925
+ export { AdminPageObjects, RuleType, StorefrontPageObjects, TestDataService, compareFlowTemplateWithFlow, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, isThemeCompiled, setOrderStatus, test };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "11.12.4",
3
+ "version": "11.13.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",