@shopware-ag/acceptance-test-suite 11.12.5 → 11.13.1
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 +55 -4
- package/dist/index.d.ts +55 -4
- package/dist/index.mjs +110 -8
- package/package.json +1 -1
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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;
|
|
@@ -5069,13 +5116,26 @@ class FlowBuilderCreate {
|
|
|
5069
5116
|
this.page = page;
|
|
5070
5117
|
__publicField$o(this, "saveButton");
|
|
5071
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");
|
|
5072
5124
|
__publicField$o(this, "newFlowHeader");
|
|
5073
5125
|
this.saveButton = page.locator(".sw-flow-detail__save");
|
|
5074
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");
|
|
5075
5132
|
this.newFlowHeader = page.getByRole("heading", { name: "New flow" });
|
|
5076
5133
|
}
|
|
5077
|
-
url() {
|
|
5078
|
-
|
|
5134
|
+
url(flowId, tabName = "general") {
|
|
5135
|
+
if (!flowId || flowId === "") {
|
|
5136
|
+
return `#/sw/flow/create/${tabName}`;
|
|
5137
|
+
}
|
|
5138
|
+
return `#/sw/flow/create/${flowId}/${tabName}`;
|
|
5079
5139
|
}
|
|
5080
5140
|
}
|
|
5081
5141
|
|
|
@@ -5101,6 +5161,7 @@ class FlowBuilderListing {
|
|
|
5101
5161
|
__publicField$n(this, "flowDeleteButton");
|
|
5102
5162
|
__publicField$n(this, "successAlert");
|
|
5103
5163
|
__publicField$n(this, "successAlertMessage");
|
|
5164
|
+
__publicField$n(this, "searchBar");
|
|
5104
5165
|
this.createFlowButton = page.locator(".sw-flow-list__create");
|
|
5105
5166
|
this.firstFlowName = page.locator(".sw-data-grid__cell--name a").first();
|
|
5106
5167
|
this.firstFlowContextButton = page.locator(".sw-data-grid__actions-menu").first();
|
|
@@ -5114,6 +5175,7 @@ class FlowBuilderListing {
|
|
|
5114
5175
|
this.downloadFlowButton = page.getByRole("button", { name: "Download flow" });
|
|
5115
5176
|
this.successAlert = page.locator(".sw-alert__body");
|
|
5116
5177
|
this.successAlertMessage = page.locator(".sw-alert__message");
|
|
5178
|
+
this.searchBar = page.locator(".sw-search-bar__input");
|
|
5117
5179
|
}
|
|
5118
5180
|
url() {
|
|
5119
5181
|
return "#/sw/flow/index/";
|
|
@@ -5137,21 +5199,56 @@ class FlowBuilderListing {
|
|
|
5137
5199
|
}
|
|
5138
5200
|
}
|
|
5139
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
|
+
|
|
5140
5222
|
var __defProp$m = Object.defineProperty;
|
|
5141
5223
|
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5142
5224
|
var __publicField$m = (obj, key, value) => {
|
|
5143
5225
|
__defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5144
5226
|
return value;
|
|
5145
5227
|
};
|
|
5146
|
-
class FlowBuilderDetail {
|
|
5147
|
-
constructor(page) {
|
|
5228
|
+
class FlowBuilderDetail extends FlowBuilderCreate {
|
|
5229
|
+
constructor(page, instanceMeta) {
|
|
5230
|
+
super(page);
|
|
5148
5231
|
this.page = page;
|
|
5232
|
+
this.instanceMeta = instanceMeta;
|
|
5233
|
+
__publicField$m(this, "saveButtonLoader");
|
|
5149
5234
|
__publicField$m(this, "saveButton");
|
|
5150
5235
|
__publicField$m(this, "generalTab");
|
|
5151
5236
|
__publicField$m(this, "flowTab");
|
|
5152
|
-
this
|
|
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");
|
|
5153
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");
|
|
5154
5250
|
this.flowTab = page.locator(".sw-flow-detail__tab-flow");
|
|
5251
|
+
this.templateName = page.getByLabel("Name");
|
|
5155
5252
|
}
|
|
5156
5253
|
url(flowId, tabName = "general") {
|
|
5157
5254
|
return `#/sw/flow/detail/${flowId}/${tabName}`;
|
|
@@ -6200,6 +6297,7 @@ const AdminPageObjects = {
|
|
|
6200
6297
|
FirstRunWizard,
|
|
6201
6298
|
FlowBuilderCreate,
|
|
6202
6299
|
FlowBuilderListing,
|
|
6300
|
+
FlowBuilderTemplates,
|
|
6203
6301
|
FlowBuilderDetail,
|
|
6204
6302
|
Dashboard,
|
|
6205
6303
|
DataSharing,
|
|
@@ -6254,8 +6352,11 @@ const test$6 = test$f.extend({
|
|
|
6254
6352
|
AdminFlowBuilderListing: async ({ AdminPage }, use) => {
|
|
6255
6353
|
await use(new FlowBuilderListing(AdminPage));
|
|
6256
6354
|
},
|
|
6257
|
-
|
|
6258
|
-
await use(new
|
|
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));
|
|
6259
6360
|
},
|
|
6260
6361
|
AdminDataSharing: async ({ AdminPage, InstanceMeta }, use) => {
|
|
6261
6362
|
await use(new DataSharing(AdminPage, InstanceMeta));
|
|
@@ -7525,6 +7626,7 @@ const SearchForTerm = test$f.extend({
|
|
|
7525
7626
|
const task = (searchTerm) => {
|
|
7526
7627
|
return async function SearchForTerm2() {
|
|
7527
7628
|
await StorefrontSearchSuggest.searchInput.fill(searchTerm);
|
|
7629
|
+
searchTerm = searchTerm.replaceAll(" ", "%20");
|
|
7528
7630
|
await StorefrontSearchSuggest.page.waitForResponse((response) => response.url().includes(`suggest?search=${searchTerm}`) && response.ok());
|
|
7529
7631
|
};
|
|
7530
7632
|
};
|
|
@@ -7821,4 +7923,4 @@ const test = mergeTests(
|
|
|
7821
7923
|
test$3
|
|
7822
7924
|
);
|
|
7823
7925
|
|
|
7824
|
-
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 };
|
|
7926
|
+
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 };
|