@shopware-ag/acceptance-test-suite 11.3.3 → 11.4.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 CHANGED
@@ -32,12 +32,14 @@ declare class AdminApiContext {
32
32
  static authenticateWithClientCredentials(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
33
33
  static authenticateWithUserPassword(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
34
34
  isAuthenticated(): boolean;
35
+ refreshAccessToken(): Promise<void>;
35
36
  get<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
36
37
  post<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
37
38
  patch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
38
39
  delete<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
39
40
  fetch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
40
41
  head<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
42
+ private handleRequest;
41
43
  }
42
44
 
43
45
  interface RequestOptions<PAYLOAD> {
@@ -367,6 +369,9 @@ type CustomField = Omit<components['schemas']['CustomField'], 'config'> & {
367
369
  };
368
370
  };
369
371
  };
372
+ type Tax = components['schemas']['Tax'] & {
373
+ id: string;
374
+ };
370
375
  declare enum RuleType {
371
376
  shippingAvailability = "shippingMethodAvailabilityRule",
372
377
  taxAvailability = "taxProviderAvailabilityRule",
@@ -691,6 +696,12 @@ declare class TestDataService {
691
696
  * @param overrides - Specific data overrides that will be applied to the sales channel domain data struct.
692
697
  */
693
698
  createSalesChannelDomain(overrides?: Partial<SalesChannelDomain>): Promise<SalesChannelDomain>;
699
+ /**
700
+ * Creates a new tax rate (19%) with a random name.
701
+ *
702
+ * @param overrides - Specific data overrides that will be applied to the tax data struct.
703
+ */
704
+ createTaxRate(overrides?: Partial<Tax>): Promise<Tax>;
694
705
  /**
695
706
  * Assigns a media resource as the download of a digital product.
696
707
  *
@@ -1041,6 +1052,7 @@ declare class TestDataService {
1041
1052
  getBasicCustomFieldSetStruct(overrides?: Partial<CustomFieldSet>): Partial<CustomFieldSet>;
1042
1053
  getBasicCustomFieldStruct(overrides?: Partial<CustomField>): Partial<CustomField>;
1043
1054
  getSalesChannelDomainStruct(salesChannelId: string, currencyId: string, languageId: string, snippetSetId: string, overrides?: Partial<SalesChannelDomain>): Partial<SalesChannelDomain>;
1055
+ getTaxStruct(overrides: Partial<Tax>): Partial<Tax>;
1044
1056
  }
1045
1057
 
1046
1058
  interface TestDataFixtureTypes {
@@ -1375,8 +1387,10 @@ declare class SearchSuggest extends Home implements PageObject {
1375
1387
  readonly searchSuggestLineItemName: Locator;
1376
1388
  readonly searchSuggestLineItemPrice: Locator;
1377
1389
  readonly searchSuggestTotalLink: Locator;
1390
+ readonly searchResultTotal: Locator;
1378
1391
  readonly searchHeadline: Locator;
1379
1392
  constructor(page: Page);
1393
+ getTotalSearchResultCount(): Promise<number>;
1380
1394
  url(searchTerm?: string): string;
1381
1395
  }
1382
1396
 
@@ -2331,8 +2345,10 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
2331
2345
  OpenSearchResultPage: Task;
2332
2346
  } & {
2333
2347
  OpenSearchSuggestPage: Task;
2348
+ } & {
2349
+ SearchForTerm: Task;
2334
2350
  } & {
2335
2351
  ValidateAccessibility: (pageName: string, assertViolations?: number | boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<axe_core.Result[]>;
2336
2352
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
2337
2353
 
2338
- export { type AccountData, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Language$1 as Language, 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 RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, 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 };
2354
+ export { type AccountData, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Language$1 as Language, 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 RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, type Task, type Tax, 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
@@ -32,12 +32,14 @@ declare class AdminApiContext {
32
32
  static authenticateWithClientCredentials(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
33
33
  static authenticateWithUserPassword(context: APIRequestContext, options: AdminApiContextOptions): Promise<string>;
34
34
  isAuthenticated(): boolean;
35
+ refreshAccessToken(): Promise<void>;
35
36
  get<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
36
37
  post<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
37
38
  patch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
38
39
  delete<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
39
40
  fetch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
40
41
  head<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
42
+ private handleRequest;
41
43
  }
42
44
 
43
45
  interface RequestOptions<PAYLOAD> {
@@ -367,6 +369,9 @@ type CustomField = Omit<components['schemas']['CustomField'], 'config'> & {
367
369
  };
368
370
  };
369
371
  };
372
+ type Tax = components['schemas']['Tax'] & {
373
+ id: string;
374
+ };
370
375
  declare enum RuleType {
371
376
  shippingAvailability = "shippingMethodAvailabilityRule",
372
377
  taxAvailability = "taxProviderAvailabilityRule",
@@ -691,6 +696,12 @@ declare class TestDataService {
691
696
  * @param overrides - Specific data overrides that will be applied to the sales channel domain data struct.
692
697
  */
693
698
  createSalesChannelDomain(overrides?: Partial<SalesChannelDomain>): Promise<SalesChannelDomain>;
699
+ /**
700
+ * Creates a new tax rate (19%) with a random name.
701
+ *
702
+ * @param overrides - Specific data overrides that will be applied to the tax data struct.
703
+ */
704
+ createTaxRate(overrides?: Partial<Tax>): Promise<Tax>;
694
705
  /**
695
706
  * Assigns a media resource as the download of a digital product.
696
707
  *
@@ -1041,6 +1052,7 @@ declare class TestDataService {
1041
1052
  getBasicCustomFieldSetStruct(overrides?: Partial<CustomFieldSet>): Partial<CustomFieldSet>;
1042
1053
  getBasicCustomFieldStruct(overrides?: Partial<CustomField>): Partial<CustomField>;
1043
1054
  getSalesChannelDomainStruct(salesChannelId: string, currencyId: string, languageId: string, snippetSetId: string, overrides?: Partial<SalesChannelDomain>): Partial<SalesChannelDomain>;
1055
+ getTaxStruct(overrides: Partial<Tax>): Partial<Tax>;
1044
1056
  }
1045
1057
 
1046
1058
  interface TestDataFixtureTypes {
@@ -1375,8 +1387,10 @@ declare class SearchSuggest extends Home implements PageObject {
1375
1387
  readonly searchSuggestLineItemName: Locator;
1376
1388
  readonly searchSuggestLineItemPrice: Locator;
1377
1389
  readonly searchSuggestTotalLink: Locator;
1390
+ readonly searchResultTotal: Locator;
1378
1391
  readonly searchHeadline: Locator;
1379
1392
  constructor(page: Page);
1393
+ getTotalSearchResultCount(): Promise<number>;
1380
1394
  url(searchTerm?: string): string;
1381
1395
  }
1382
1396
 
@@ -2331,8 +2345,10 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
2331
2345
  OpenSearchResultPage: Task;
2332
2346
  } & {
2333
2347
  OpenSearchSuggestPage: Task;
2348
+ } & {
2349
+ SearchForTerm: Task;
2334
2350
  } & {
2335
2351
  ValidateAccessibility: (pageName: string, assertViolations?: number | boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<axe_core.Result[]>;
2336
2352
  }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
2337
2353
 
2338
- export { type AccountData, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Language$1 as Language, 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 RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, 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 };
2354
+ export { type AccountData, AdminPageObjects, type CalculatedTaxes, type Category$1 as Category, type CategoryCustomizableLinkData, type CategoryData, type CmsPage, type Country, type CreatedRecord, type Currency$1 as Currency, type CustomField, type CustomFieldData, type CustomFieldSet, type Customer, type CustomerAddress, type CustomerGroup, type DataServiceOptions, type DeliveryTime, type FixtureTypes, type Language$1 as Language, 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 RegistrationData, type Rule, type RuleAssignmentEntity, RuleType, type SalesChannel, type SalesChannelAnalytics, type SalesChannelDomain, type SalesChannelRecord, type Salutation, type ShippingMethod, type SimpleLineItem, type StateMachine, type StateMachineState, StorefrontPageObjects, type SyncApiOperation, type SystemConfig, type Tag, type TagData, type Task, type Tax, 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
@@ -440,7 +440,7 @@ const _AdminApiContext = class _AdminApiContext {
440
440
  grant_type: "client_credentials",
441
441
  client_id: options.client_id,
442
442
  client_secret: options.client_secret,
443
- scope: ["write"]
443
+ scope: "write"
444
444
  }
445
445
  });
446
446
  const authData = await authResponse.json();
@@ -456,7 +456,7 @@ const _AdminApiContext = class _AdminApiContext {
456
456
  grant_type: "password",
457
457
  username: options.admin_username,
458
458
  password: options.admin_password,
459
- scope: ["write"]
459
+ scope: "write"
460
460
  }
461
461
  });
462
462
  const authData = await authResponse.json();
@@ -468,23 +468,43 @@ const _AdminApiContext = class _AdminApiContext {
468
468
  isAuthenticated() {
469
469
  return !!this.options["access_token"];
470
470
  }
471
+ async refreshAccessToken() {
472
+ this.options["access_token"] = await _AdminApiContext.authenticateWithClientCredentials(this.context, this.options);
473
+ this.context = await _AdminApiContext.createApiRequestContext(this.options);
474
+ }
471
475
  async get(url, options) {
472
- return this.context.get(url, options);
476
+ return this.handleRequest("get", url, options);
473
477
  }
474
478
  async post(url, options) {
475
- return this.context.post(url, options);
479
+ return this.handleRequest("post", url, options);
476
480
  }
477
481
  async patch(url, options) {
478
- return this.context.patch(url, options);
482
+ return this.handleRequest("patch", url, options);
479
483
  }
480
484
  async delete(url, options) {
481
- return this.context.delete(url, options);
485
+ return this.handleRequest("delete", url, options);
482
486
  }
483
487
  async fetch(url, options) {
484
- return this.context.fetch(url, options);
488
+ return this.handleRequest("fetch", url, options);
485
489
  }
486
490
  async head(url, options) {
487
- return this.context.head(url, options);
491
+ return this.handleRequest("head", url, options);
492
+ }
493
+ async handleRequest(method, url, options) {
494
+ const methodMap = {
495
+ get: this.context.get.bind(this.context),
496
+ post: this.context.post.bind(this.context),
497
+ patch: this.context.patch.bind(this.context),
498
+ delete: this.context.delete.bind(this.context),
499
+ fetch: this.context.fetch.bind(this.context),
500
+ head: this.context.head.bind(this.context)
501
+ };
502
+ let response = await methodMap[method](url, options);
503
+ if (response.status() === 401) {
504
+ await this.refreshAccessToken();
505
+ response = await methodMap[method](url, options);
506
+ }
507
+ return response;
488
508
  }
489
509
  };
490
510
  __publicField$V(_AdminApiContext, "defaultOptions", {
@@ -1238,16 +1258,20 @@ class TestDataService {
1238
1258
  description: "Color",
1239
1259
  displayType: "color",
1240
1260
  sortingType: "name",
1241
- options: [{
1242
- name: "Blue",
1243
- colorHexCode: "#2148d6"
1244
- }, {
1245
- name: "Red",
1246
- colorHexCode: "#bf0f2a"
1247
- }, {
1248
- name: "Green",
1249
- colorHexCode: "#12bf0f"
1250
- }]
1261
+ options: [
1262
+ {
1263
+ name: "Blue",
1264
+ colorHexCode: "#2148d6"
1265
+ },
1266
+ {
1267
+ name: "Red",
1268
+ colorHexCode: "#bf0f2a"
1269
+ },
1270
+ {
1271
+ name: "Green",
1272
+ colorHexCode: "#12bf0f"
1273
+ }
1274
+ ]
1251
1275
  };
1252
1276
  const propertyGroupResponse = await this.AdminApiClient.post("property-group?_response=detail", {
1253
1277
  data: Object.assign({}, colorPropertyGroup, overrides)
@@ -1269,13 +1293,17 @@ class TestDataService {
1269
1293
  description: "Size",
1270
1294
  displayType: "text",
1271
1295
  sortingType: "name",
1272
- options: [{
1273
- name: "Small"
1274
- }, {
1275
- name: "Medium"
1276
- }, {
1277
- name: "Large"
1278
- }]
1296
+ options: [
1297
+ {
1298
+ name: "Small"
1299
+ },
1300
+ {
1301
+ name: "Medium"
1302
+ },
1303
+ {
1304
+ name: "Large"
1305
+ }
1306
+ ]
1279
1307
  };
1280
1308
  const propertyGroupResponse = await this.AdminApiClient.post("property-group?_response=detail", {
1281
1309
  data: Object.assign({}, textPropertyGroup, overrides)
@@ -1329,7 +1357,10 @@ class TestDataService {
1329
1357
  if (typeof basicCustomerStruct.password !== "string") {
1330
1358
  customer = { ...customerData.data };
1331
1359
  } else {
1332
- customer = { ...customerData.data, password: basicCustomerStruct.password };
1360
+ customer = {
1361
+ ...customerData.data,
1362
+ password: basicCustomerStruct.password
1363
+ };
1333
1364
  }
1334
1365
  this.addCreatedRecord("customer", customer.id);
1335
1366
  return customer;
@@ -1427,10 +1458,7 @@ class TestDataService {
1427
1458
  async createBasicShippingMethod(overrides = {}) {
1428
1459
  const deliveryTime = await this.getAllDeliveryTimeResources();
1429
1460
  overrides.availabilityRuleId ?? (overrides.availabilityRuleId = (await this.getRule("Always valid (Default)")).id);
1430
- const basicShippingMethod = this.getBasicShippingMethodStruct(
1431
- deliveryTime[0].id,
1432
- overrides
1433
- );
1461
+ const basicShippingMethod = this.getBasicShippingMethodStruct(deliveryTime[0].id, overrides);
1434
1462
  const shippingMethodResponse = await this.AdminApiClient.post("shipping-method?_response=detail", {
1435
1463
  data: basicShippingMethod
1436
1464
  });
@@ -1607,6 +1635,21 @@ class TestDataService {
1607
1635
  this.addCreatedRecord("sales_channel_domain", salesChannelDomain.id);
1608
1636
  return salesChannelDomain;
1609
1637
  }
1638
+ /**
1639
+ * Creates a new tax rate (19%) with a random name.
1640
+ *
1641
+ * @param overrides - Specific data overrides that will be applied to the tax data struct.
1642
+ */
1643
+ async createTaxRate(overrides = {}) {
1644
+ const taxStruct = this.getTaxStruct(overrides);
1645
+ const response = await this.AdminApiClient.post("tax?_response=detail", {
1646
+ data: taxStruct
1647
+ });
1648
+ expect(response.ok()).toBeTruthy();
1649
+ const { data: tax } = await response.json();
1650
+ this.addCreatedRecord("tax", tax.id);
1651
+ return tax;
1652
+ }
1610
1653
  /**
1611
1654
  * Assigns a media resource as the download of a digital product.
1612
1655
  *
@@ -1708,9 +1751,11 @@ class TestDataService {
1708
1751
  async assignProductCategory(productId, categoryId) {
1709
1752
  return await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
1710
1753
  data: {
1711
- categories: [{
1712
- id: categoryId
1713
- }]
1754
+ categories: [
1755
+ {
1756
+ id: categoryId
1757
+ }
1758
+ ]
1714
1759
  }
1715
1760
  });
1716
1761
  }
@@ -1723,9 +1768,11 @@ class TestDataService {
1723
1768
  async assignProductTag(productId, tagId) {
1724
1769
  return await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
1725
1770
  data: {
1726
- tags: [{
1727
- id: tagId
1728
- }]
1771
+ tags: [
1772
+ {
1773
+ id: tagId
1774
+ }
1775
+ ]
1729
1776
  }
1730
1777
  });
1731
1778
  }
@@ -1779,7 +1826,10 @@ class TestDataService {
1779
1826
  });
1780
1827
  expect(syncSalesChannelResponse.ok()).toBeTruthy();
1781
1828
  const { data: salesChannel } = await syncSalesChannelResponse.json();
1782
- this.addCreatedRecord("sales_channel_currency", { salesChannelId, currencyId });
1829
+ this.addCreatedRecord("sales_channel_currency", {
1830
+ salesChannelId,
1831
+ currencyId
1832
+ });
1783
1833
  return salesChannel;
1784
1834
  }
1785
1835
  /**
@@ -1831,7 +1881,10 @@ class TestDataService {
1831
1881
  });
1832
1882
  expect(syncSalesChannelResponse.ok()).toBeTruthy();
1833
1883
  const { data: salesChannel } = await syncSalesChannelResponse.json();
1834
- this.addCreatedRecord("sales_channel_country", { salesChannelId, countryId });
1884
+ this.addCreatedRecord("sales_channel_country", {
1885
+ salesChannelId,
1886
+ countryId
1887
+ });
1835
1888
  return salesChannel;
1836
1889
  }
1837
1890
  /**
@@ -1857,7 +1910,10 @@ class TestDataService {
1857
1910
  });
1858
1911
  expect(syncSalesChannelResponse.ok()).toBeTruthy();
1859
1912
  const { data: salesChannel } = await syncSalesChannelResponse.json();
1860
- this.addCreatedRecord("sales_channel_language", { salesChannelId, languageId });
1913
+ this.addCreatedRecord("sales_channel_language", {
1914
+ salesChannelId,
1915
+ languageId
1916
+ });
1861
1917
  return salesChannel;
1862
1918
  }
1863
1919
  /**
@@ -1908,11 +1964,13 @@ class TestDataService {
1908
1964
  const currencyResponse = await this.AdminApiClient.post("search/currency", {
1909
1965
  data: {
1910
1966
  limit: 1,
1911
- filter: [{
1912
- type: "equals",
1913
- field: "isoCode",
1914
- value: isoCode
1915
- }]
1967
+ filter: [
1968
+ {
1969
+ type: "equals",
1970
+ field: "isoCode",
1971
+ value: isoCode
1972
+ }
1973
+ ]
1916
1974
  }
1917
1975
  });
1918
1976
  expect(currencyResponse.ok()).toBeTruthy();
@@ -1928,11 +1986,13 @@ class TestDataService {
1928
1986
  const response = await this.AdminApiClient.post("search/rule", {
1929
1987
  data: {
1930
1988
  limit: 1,
1931
- filter: [{
1932
- type: "equals",
1933
- field: "name",
1934
- value: name
1935
- }]
1989
+ filter: [
1990
+ {
1991
+ type: "equals",
1992
+ field: "name",
1993
+ value: name
1994
+ }
1995
+ ]
1936
1996
  }
1937
1997
  });
1938
1998
  expect(response.ok()).toBeTruthy();
@@ -1948,11 +2008,13 @@ class TestDataService {
1948
2008
  const response = await this.AdminApiClient.post("search/shipping-method", {
1949
2009
  data: {
1950
2010
  limit: 1,
1951
- filter: [{
1952
- type: "equals",
1953
- field: "name",
1954
- value: name
1955
- }]
2011
+ filter: [
2012
+ {
2013
+ type: "equals",
2014
+ field: "name",
2015
+ value: name
2016
+ }
2017
+ ]
1956
2018
  }
1957
2019
  });
1958
2020
  expect(response.ok()).toBeTruthy();
@@ -1977,11 +2039,13 @@ class TestDataService {
1977
2039
  const response = await this.AdminApiClient.post("search/payment-method", {
1978
2040
  data: {
1979
2041
  limit: 1,
1980
- filter: [{
1981
- type: "equals",
1982
- field: "name",
1983
- value: name
1984
- }]
2042
+ filter: [
2043
+ {
2044
+ type: "equals",
2045
+ field: "name",
2046
+ value: name
2047
+ }
2048
+ ]
1985
2049
  }
1986
2050
  });
1987
2051
  expect(response.ok()).toBeTruthy();
@@ -2008,11 +2072,13 @@ class TestDataService {
2008
2072
  const response = await this.AdminApiClient.post("search/salutation", {
2009
2073
  data: {
2010
2074
  limit: 1,
2011
- filter: [{
2012
- type: "equals",
2013
- field: "salutationKey",
2014
- value: key
2015
- }]
2075
+ filter: [
2076
+ {
2077
+ type: "equals",
2078
+ field: "salutationKey",
2079
+ value: key
2080
+ }
2081
+ ]
2016
2082
  }
2017
2083
  });
2018
2084
  expect(response.ok()).toBeTruthy();
@@ -2046,11 +2112,13 @@ class TestDataService {
2046
2112
  const response = await this.AdminApiClient.post("search/state-machine", {
2047
2113
  data: {
2048
2114
  limit: 1,
2049
- filter: [{
2050
- type: "equals",
2051
- field: "technicalName",
2052
- value: name
2053
- }]
2115
+ filter: [
2116
+ {
2117
+ type: "equals",
2118
+ field: "technicalName",
2119
+ value: name
2120
+ }
2121
+ ]
2054
2122
  }
2055
2123
  });
2056
2124
  expect(response.ok()).toBeTruthy();
@@ -2067,15 +2135,18 @@ class TestDataService {
2067
2135
  const response = await this.AdminApiClient.post("search/state-machine-state", {
2068
2136
  data: {
2069
2137
  limit: 1,
2070
- filter: [{
2071
- type: "equals",
2072
- field: "stateMachineId",
2073
- value: stateMachineId
2074
- }, {
2075
- type: "equals",
2076
- field: "technicalName",
2077
- value: stateName
2078
- }]
2138
+ filter: [
2139
+ {
2140
+ type: "equals",
2141
+ field: "stateMachineId",
2142
+ value: stateMachineId
2143
+ },
2144
+ {
2145
+ type: "equals",
2146
+ field: "technicalName",
2147
+ value: stateName
2148
+ }
2149
+ ]
2079
2150
  }
2080
2151
  });
2081
2152
  expect(response.ok()).toBeTruthy();
@@ -2091,11 +2162,13 @@ class TestDataService {
2091
2162
  const response = await this.AdminApiClient.post("search/property-group-option", {
2092
2163
  data: {
2093
2164
  limit: 50,
2094
- filter: [{
2095
- type: "equals",
2096
- field: "groupId",
2097
- value: propertyGroupId
2098
- }]
2165
+ filter: [
2166
+ {
2167
+ type: "equals",
2168
+ field: "groupId",
2169
+ value: propertyGroupId
2170
+ }
2171
+ ]
2099
2172
  }
2100
2173
  });
2101
2174
  expect(response.ok()).toBeTruthy();
@@ -2159,7 +2232,10 @@ class TestDataService {
2159
2232
  * @param field - The database field which has to be overridden
2160
2233
  */
2161
2234
  addCreatedSalesChannelRecord(salesChannelId, field) {
2162
- this.createdSalesChannelRecords.push({ salesChannelId, field });
2235
+ this.createdSalesChannelRecords.push({
2236
+ salesChannelId,
2237
+ field
2238
+ });
2163
2239
  }
2164
2240
  /**
2165
2241
  * Set the configuration of automated data clean up.
@@ -2244,11 +2320,13 @@ class TestDataService {
2244
2320
  const countryResponse = await this.AdminApiClient.post("search/country", {
2245
2321
  data: {
2246
2322
  limit: 1,
2247
- filter: [{
2248
- type: "equals",
2249
- field: "iso",
2250
- value: iso2
2251
- }]
2323
+ filter: [
2324
+ {
2325
+ type: "equals",
2326
+ field: "iso",
2327
+ value: iso2
2328
+ }
2329
+ ]
2252
2330
  }
2253
2331
  });
2254
2332
  const { data: result } = await countryResponse.json();
@@ -2325,17 +2403,21 @@ class TestDataService {
2325
2403
  };
2326
2404
  if (this.defaultCategoryId) {
2327
2405
  basicProduct = Object.assign({}, basicProduct, {
2328
- categories: [{
2329
- id: this.defaultCategoryId
2330
- }]
2406
+ categories: [
2407
+ {
2408
+ id: this.defaultCategoryId
2409
+ }
2410
+ ]
2331
2411
  });
2332
2412
  }
2333
2413
  if (this.defaultSalesChannel) {
2334
2414
  basicProduct = Object.assign({}, basicProduct, {
2335
- visibilities: [{
2336
- salesChannelId: this.defaultSalesChannel.id,
2337
- visibility: 30
2338
- }]
2415
+ visibilities: [
2416
+ {
2417
+ salesChannelId: this.defaultSalesChannel.id,
2418
+ visibility: 30
2419
+ }
2420
+ ]
2339
2421
  });
2340
2422
  }
2341
2423
  return Object.assign({}, basicProduct, overrides);
@@ -2392,27 +2474,32 @@ class TestDataService {
2392
2474
  ];
2393
2475
  return {
2394
2476
  price: p(100, 84.03),
2395
- prices: [{
2396
- ruleId,
2397
- price: p(100, 84.03),
2398
- quantityStart: 1,
2399
- quantityEnd: 10
2400
- }, {
2401
- ruleId,
2402
- price: p(90, 75.63),
2403
- quantityStart: 11,
2404
- quantityEnd: 20
2405
- }, {
2406
- ruleId,
2407
- price: p(80, 67.23),
2408
- quantityStart: 21,
2409
- quantityEnd: 50
2410
- }, {
2411
- ruleId,
2412
- price: p(70, 58.82),
2413
- quantityStart: 51,
2414
- quantityEnd: null
2415
- }]
2477
+ prices: [
2478
+ {
2479
+ ruleId,
2480
+ price: p(100, 84.03),
2481
+ quantityStart: 1,
2482
+ quantityEnd: 10
2483
+ },
2484
+ {
2485
+ ruleId,
2486
+ price: p(90, 75.63),
2487
+ quantityStart: 11,
2488
+ quantityEnd: 20
2489
+ },
2490
+ {
2491
+ ruleId,
2492
+ price: p(80, 67.23),
2493
+ quantityStart: 21,
2494
+ quantityEnd: 50
2495
+ },
2496
+ {
2497
+ ruleId,
2498
+ price: p(70, 58.82),
2499
+ quantityStart: 51,
2500
+ quantityEnd: null
2501
+ }
2502
+ ]
2416
2503
  };
2417
2504
  }
2418
2505
  getBasicManufacturerStruct(overrides = {}) {
@@ -2600,15 +2687,19 @@ class TestDataService {
2600
2687
  rawTotal: totalPrice,
2601
2688
  netPrice: totalPrice,
2602
2689
  taxStatus: "gross",
2603
- calculatedTaxes: [{
2604
- tax: 0,
2605
- taxRate: 0,
2606
- price: totalPrice
2607
- }],
2608
- taxRules: [{
2609
- taxRate: 0,
2610
- percentage: 100
2611
- }]
2690
+ calculatedTaxes: [
2691
+ {
2692
+ tax: 0,
2693
+ taxRate: 0,
2694
+ price: totalPrice
2695
+ }
2696
+ ],
2697
+ taxRules: [
2698
+ {
2699
+ taxRate: 0,
2700
+ percentage: 100
2701
+ }
2702
+ ]
2612
2703
  },
2613
2704
  orderCustomer: {
2614
2705
  customerId: customer.id,
@@ -2621,15 +2712,19 @@ class TestDataService {
2621
2712
  unitPrice: shippingCosts,
2622
2713
  totalPrice: shippingCosts,
2623
2714
  quantity: 1,
2624
- calculatedTaxes: [{
2625
- tax: 0,
2626
- taxRate: 0,
2627
- price: shippingCosts
2628
- }],
2629
- taxRules: [{
2630
- taxRate: 0,
2631
- percentage: 100
2632
- }]
2715
+ calculatedTaxes: [
2716
+ {
2717
+ tax: 0,
2718
+ taxRate: 0,
2719
+ price: shippingCosts
2720
+ }
2721
+ ],
2722
+ taxRules: [
2723
+ {
2724
+ taxRate: 0,
2725
+ percentage: 100
2726
+ }
2727
+ ]
2633
2728
  },
2634
2729
  lineItems: orderLineItems,
2635
2730
  deliveries: [orderDelivery],
@@ -2682,24 +2777,30 @@ class TestDataService {
2682
2777
  unitPrice,
2683
2778
  totalPrice,
2684
2779
  quantity: lineItem.quantity,
2685
- calculatedTaxes: [{
2686
- tax: 0,
2687
- taxRate: 0,
2688
- price: totalPrice
2689
- }],
2690
- taxRules: [{
2691
- taxRate: 0,
2692
- percentage: 100
2693
- }]
2780
+ calculatedTaxes: [
2781
+ {
2782
+ tax: 0,
2783
+ taxRate: 0,
2784
+ price: totalPrice
2785
+ }
2786
+ ],
2787
+ taxRules: [
2788
+ {
2789
+ taxRate: 0,
2790
+ percentage: 100
2791
+ }
2792
+ ]
2694
2793
  },
2695
2794
  priceDefinition: {
2696
2795
  type: "quantity",
2697
2796
  price: totalPrice,
2698
2797
  quantity: lineItem.quantity || 1,
2699
- taxRules: [{
2700
- taxRate: 0,
2701
- percentage: 100
2702
- }],
2798
+ taxRules: [
2799
+ {
2800
+ taxRate: 0,
2801
+ percentage: 100
2802
+ }
2803
+ ],
2703
2804
  listPrice: 8,
2704
2805
  isCalculated: true,
2705
2806
  referencePriceDefinition: null
@@ -2733,15 +2834,19 @@ class TestDataService {
2733
2834
  unitPrice,
2734
2835
  totalPrice,
2735
2836
  quantity: lineItem.quantity,
2736
- calculatedTaxes: [{
2737
- tax: 0,
2738
- taxRate: 0,
2739
- price: totalPrice
2740
- }],
2741
- taxRules: [{
2742
- taxRate: 0,
2743
- percentage: 100
2744
- }]
2837
+ calculatedTaxes: [
2838
+ {
2839
+ tax: 0,
2840
+ taxRate: 0,
2841
+ price: totalPrice
2842
+ }
2843
+ ],
2844
+ taxRules: [
2845
+ {
2846
+ taxRate: 0,
2847
+ percentage: 100
2848
+ }
2849
+ ]
2745
2850
  },
2746
2851
  priceDefinition: {
2747
2852
  type: promotionDiscountType,
@@ -2767,16 +2872,20 @@ class TestDataService {
2767
2872
  preventCombination: true,
2768
2873
  customerRestriction: false,
2769
2874
  code: promotionCode,
2770
- discounts: [{
2771
- scope: "cart",
2772
- type: "percentage",
2773
- value: 10,
2774
- considerAdvancedRules: false
2775
- }],
2776
- salesChannels: [{
2777
- salesChannelId,
2778
- priority: 1
2779
- }]
2875
+ discounts: [
2876
+ {
2877
+ scope: "cart",
2878
+ type: "percentage",
2879
+ value: 10,
2880
+ considerAdvancedRules: false
2881
+ }
2882
+ ],
2883
+ salesChannels: [
2884
+ {
2885
+ salesChannelId,
2886
+ priority: 1
2887
+ }
2888
+ ]
2780
2889
  };
2781
2890
  return Object.assign({}, basicPromotion, overrides);
2782
2891
  }
@@ -2827,9 +2936,11 @@ class TestDataService {
2827
2936
  registrationSeoMetaDescription: `${customerGroupName}-SEO-Description`,
2828
2937
  registrationOnlyCompanyRegistration: false,
2829
2938
  customFields: {},
2830
- registrationSalesChannels: [{
2831
- id: this.defaultSalesChannel.id
2832
- }]
2939
+ registrationSalesChannels: [
2940
+ {
2941
+ id: this.defaultSalesChannel.id
2942
+ }
2943
+ ]
2833
2944
  };
2834
2945
  return Object.assign({}, basicCustomerGroup, overrides);
2835
2946
  }
@@ -2906,6 +3017,16 @@ class TestDataService {
2906
3017
  };
2907
3018
  return Object.assign({}, basicSalesChannelDomain, overrides);
2908
3019
  }
3020
+ getTaxStruct(overrides) {
3021
+ const taxUuid = this.IdProvider.getIdPair().uuid;
3022
+ const taxName = `${this.namePrefix}Tax-${taxUuid}${this.nameSuffix}`;
3023
+ const basicTaxStruct = {
3024
+ id: taxUuid,
3025
+ name: taxName,
3026
+ taxRate: 19
3027
+ };
3028
+ return Object.assign({}, basicTaxStruct, overrides);
3029
+ }
2909
3030
  }
2910
3031
 
2911
3032
  const test$8 = test$e.extend({
@@ -3054,7 +3175,7 @@ class Home {
3054
3175
  this.accountMenuButton = page.getByLabel("Your account");
3055
3176
  this.closeGuestSessionButton = page.locator(".account-aside-btn");
3056
3177
  this.productImages = page.locator(".product-image-wrapper");
3057
- this.productListItems = page.getByRole("listitem");
3178
+ this.productListItems = page.locator(".product-box");
3058
3179
  this.languagesDropdown = page.locator(".top-bar-language").filter({ has: page.getByRole("button") });
3059
3180
  this.languagesMenuOptions = page.locator(".top-bar-language").filter({ has: page.getByRole("list") });
3060
3181
  this.currenciesDropdown = page.locator(".top-bar-currency").filter({ has: page.getByRole("button") });
@@ -3776,6 +3897,7 @@ class SearchSuggest extends Home {
3776
3897
  __publicField$z(this, "searchSuggestLineItemName");
3777
3898
  __publicField$z(this, "searchSuggestLineItemPrice");
3778
3899
  __publicField$z(this, "searchSuggestTotalLink");
3900
+ __publicField$z(this, "searchResultTotal");
3779
3901
  __publicField$z(this, "searchHeadline");
3780
3902
  this.searchSuggestLineItemImages = page.locator(".search-suggest-product-image-container");
3781
3903
  this.searchInput = page.locator(".header-search-input");
@@ -3784,8 +3906,13 @@ class SearchSuggest extends Home {
3784
3906
  this.searchSuggestLineItemName = page.locator(".search-suggest-product-name");
3785
3907
  this.searchSuggestLineItemPrice = page.locator(".col-auto.search-suggest-product-price");
3786
3908
  this.searchSuggestTotalLink = page.locator(".search-suggest-total-link");
3909
+ this.searchResultTotal = page.locator(".search-suggest-total-count");
3787
3910
  this.searchHeadline = page.locator(".search-headline");
3788
3911
  }
3912
+ async getTotalSearchResultCount() {
3913
+ const totalCountText = await this.searchResultTotal.textContent();
3914
+ return parseInt(totalCountText?.trim().replace(/\D/g, "") || "0", 10);
3915
+ }
3789
3916
  url(searchTerm) {
3790
3917
  return `suggest?search=${searchTerm}`;
3791
3918
  }
@@ -6855,6 +6982,18 @@ const OpenSearchSuggestPage = test$e.extend({
6855
6982
  }
6856
6983
  });
6857
6984
 
6985
+ const SearchForTerm = test$e.extend({
6986
+ SearchForTerm: async ({ StorefrontSearchSuggest }, use) => {
6987
+ const task = (searchTerm) => {
6988
+ return async function SearchForTerm2() {
6989
+ await StorefrontSearchSuggest.searchInput.fill(searchTerm);
6990
+ await StorefrontSearchSuggest.page.waitForResponse((response) => response.url().includes(`suggest?search=${searchTerm}`) && response.ok());
6991
+ };
6992
+ };
6993
+ await use(task);
6994
+ }
6995
+ });
6996
+
6858
6997
  const ValidateAccessibility = test$e.extend({
6859
6998
  ValidateAccessibility: async ({ ShopCustomer }, use) => {
6860
6999
  const task = (pageName, assertViolations = true, createReport = true, ruleTags = ["wcag2a", "wcag2aa", "wcag2aaa", "wcag21a", "wcag21aa", "best-practice"], outputDir = "test-results/AccessibilityReports") => {
@@ -6903,6 +7042,7 @@ const test$2 = mergeTests(
6903
7042
  SubmitOrder,
6904
7043
  OpenSearchResultPage,
6905
7044
  OpenSearchSuggestPage,
7045
+ SearchForTerm,
6906
7046
  ValidateAccessibility
6907
7047
  );
6908
7048
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "11.3.3",
3
+ "version": "11.4.1",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",