@shopware-ag/acceptance-test-suite 3.8.1 → 3.8.3

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
@@ -549,7 +549,7 @@ declare class TestDataService {
549
549
  * @param manufacturerId - The uuid of the manufacturer.
550
550
  * @param productId - The uuid of the product.
551
551
  */
552
- assignManufacturerProduct(manufacturerId: string, productId: string): Promise<playwright_core.APIResponse>;
552
+ assignManufacturerProduct(manufacturerId: string, productId: string): Promise<void>;
553
553
  /**
554
554
  * Assigns a product to a category.
555
555
  *
@@ -779,6 +779,10 @@ interface TestDataFixtureTypes {
779
779
  interface HelperFixtureTypes {
780
780
  IdProvider: IdProvider;
781
781
  SaaSInstanceSetup: () => Promise<void>;
782
+ InstanceMeta: {
783
+ version: string;
784
+ isSaaS: boolean;
785
+ };
782
786
  }
783
787
 
784
788
  interface StoreBaseConfig {
package/dist/index.d.ts CHANGED
@@ -549,7 +549,7 @@ declare class TestDataService {
549
549
  * @param manufacturerId - The uuid of the manufacturer.
550
550
  * @param productId - The uuid of the product.
551
551
  */
552
- assignManufacturerProduct(manufacturerId: string, productId: string): Promise<playwright_core.APIResponse>;
552
+ assignManufacturerProduct(manufacturerId: string, productId: string): Promise<void>;
553
553
  /**
554
554
  * Assigns a product to a category.
555
555
  *
@@ -779,6 +779,10 @@ interface TestDataFixtureTypes {
779
779
  interface HelperFixtureTypes {
780
780
  IdProvider: IdProvider;
781
781
  SaaSInstanceSetup: () => Promise<void>;
782
+ InstanceMeta: {
783
+ version: string;
784
+ isSaaS: boolean;
785
+ };
782
786
  }
783
787
 
784
788
  interface StoreBaseConfig {
package/dist/index.mjs CHANGED
@@ -269,6 +269,21 @@ const test$c = test$e.extend({
269
269
  const { uuid: customerUuid } = IdProvider.getWorkerDerivedStableId("customer");
270
270
  const baseUrl = `${SalesChannelBaseConfig.appUrl}test-${uuid}/`;
271
271
  await AdminApiContext.delete(`./customer/${customerUuid}`);
272
+ const wantedLanguages = /* @__PURE__ */ new Set([SalesChannelBaseConfig.enGBLanguageId, SalesChannelBaseConfig.defaultLanguageId]);
273
+ const languages = [];
274
+ const result = await AdminApiContext.get(`./sales-channel/${uuid}/languages`);
275
+ if (result.ok()) {
276
+ const salesChannelLanguages = await result.json();
277
+ wantedLanguages.forEach((l) => {
278
+ if (!salesChannelLanguages.data.find((i) => i.id === l)) {
279
+ languages.push({ id: l });
280
+ }
281
+ });
282
+ } else {
283
+ wantedLanguages.forEach((l) => {
284
+ languages.push({ id: l });
285
+ });
286
+ }
272
287
  const syncResp = await AdminApiContext.post("./_action/sync", {
273
288
  data: {
274
289
  "write-sales-channel": {
@@ -304,7 +319,7 @@ const test$c = test$e.extend({
304
319
  id: customerGroupUuid,
305
320
  name: `${id} Acceptance test`
306
321
  },
307
- languages: [{ id: SalesChannelBaseConfig.enGBLanguageId }, { id: SalesChannelBaseConfig.defaultLanguageId }],
322
+ languages,
308
323
  countries: [{ id: SalesChannelBaseConfig.deCountryId }],
309
324
  shippingMethods: [{ id: SalesChannelBaseConfig.defaultShippingMethod }],
310
325
  paymentMethods: [{ id: SalesChannelBaseConfig.invoicePaymentMethodId }],
@@ -999,6 +1014,7 @@ class TestDataService {
999
1014
  const productResponse = await this.AdminApiClient.post("./product?_response=detail", {
1000
1015
  data: basicProduct
1001
1016
  });
1017
+ expect(productResponse.ok()).toBeTruthy();
1002
1018
  const { data: product } = await productResponse.json();
1003
1019
  this.addCreatedRecord("product", product.id);
1004
1020
  return product;
@@ -1059,6 +1075,7 @@ class TestDataService {
1059
1075
  const manufacturerResponse = await this.AdminApiClient.post("./product-manufacturer?_response=detail", {
1060
1076
  data: basicManufacturer
1061
1077
  });
1078
+ expect(manufacturerResponse.ok()).toBeTruthy();
1062
1079
  const { data: manufacturer } = await manufacturerResponse.json();
1063
1080
  this.addCreatedRecord("product_manufacturer", manufacturer.id);
1064
1081
  return manufacturer;
@@ -1085,6 +1102,7 @@ class TestDataService {
1085
1102
  const response = await this.AdminApiClient.post("category?_response=detail", {
1086
1103
  data: basicCategory
1087
1104
  });
1105
+ expect(response.ok()).toBeTruthy();
1088
1106
  const { data: category } = await response.json();
1089
1107
  this.addCreatedRecord("category", category.id);
1090
1108
  return category;
@@ -1099,10 +1117,11 @@ class TestDataService {
1099
1117
  const image = createRandomImage(width, height);
1100
1118
  const media = await this.createMediaResource();
1101
1119
  const filename = `${this.namePrefix}Media-${media.id}${this.nameSuffix}`;
1102
- await this.AdminApiClient.post(`_action/media/${media.id}/upload?extension=png&fileName=${filename}`, {
1120
+ const response = await this.AdminApiClient.post(`_action/media/${media.id}/upload?extension=png&fileName=${filename}`, {
1103
1121
  data: Buffer.from(image.toBuffer()),
1104
1122
  headers: { "content-type": "image/png" }
1105
1123
  });
1124
+ expect(response.ok()).toBeTruthy();
1106
1125
  this.addCreatedRecord("media", media.id);
1107
1126
  return media;
1108
1127
  }
@@ -1114,10 +1133,11 @@ class TestDataService {
1114
1133
  async createMediaTXT(content = "Lorem ipsum dolor") {
1115
1134
  const media = await this.createMediaResource();
1116
1135
  const filename = `${this.namePrefix}Media-${media.id}${this.nameSuffix}`;
1117
- await this.AdminApiClient.post(`_action/media/${media.id}/upload?extension=txt&fileName=${filename}`, {
1136
+ const response = await this.AdminApiClient.post(`_action/media/${media.id}/upload?extension=txt&fileName=${filename}`, {
1118
1137
  data: content,
1119
1138
  headers: { "content-type": "application/octet-stream" }
1120
1139
  });
1140
+ expect(response.ok()).toBeTruthy();
1121
1141
  this.addCreatedRecord("media", media.id);
1122
1142
  return media;
1123
1143
  }
@@ -1134,6 +1154,7 @@ class TestDataService {
1134
1154
  title: `Title-${id}`
1135
1155
  }
1136
1156
  });
1157
+ expect(mediaResponse.ok()).toBeTruthy();
1137
1158
  const { data: media } = await mediaResponse.json();
1138
1159
  return media;
1139
1160
  }
@@ -1163,6 +1184,7 @@ class TestDataService {
1163
1184
  const propertyGroupResponse = await this.AdminApiClient.post("property-group?_response=detail", {
1164
1185
  data: Object.assign({}, colorPropertyGroup, overrides)
1165
1186
  });
1187
+ expect(propertyGroupResponse.ok()).toBeTruthy();
1166
1188
  const { data: propertyGroup } = await propertyGroupResponse.json();
1167
1189
  this.addCreatedRecord("property_group", propertyGroup.id);
1168
1190
  return propertyGroup;
@@ -1190,6 +1212,7 @@ class TestDataService {
1190
1212
  const propertyGroupResponse = await this.AdminApiClient.post("property-group?_response=detail", {
1191
1213
  data: Object.assign({}, textPropertyGroup, overrides)
1192
1214
  });
1215
+ expect(propertyGroupResponse.ok()).toBeTruthy();
1193
1216
  const { data: propertyGroup } = await propertyGroupResponse.json();
1194
1217
  this.addCreatedRecord("property_group", propertyGroup.id);
1195
1218
  return propertyGroup;
@@ -1206,6 +1229,7 @@ class TestDataService {
1206
1229
  name: tagName
1207
1230
  }
1208
1231
  });
1232
+ expect(response.ok()).toBeTruthy();
1209
1233
  const { data: tag } = await response.json();
1210
1234
  this.addCreatedRecord("tag", tag.id);
1211
1235
  return tag;
@@ -1231,6 +1255,7 @@ class TestDataService {
1231
1255
  const response = await this.AdminApiClient.post("customer?_response=detail", {
1232
1256
  data: basicCustomerStruct
1233
1257
  });
1258
+ expect(response.ok()).toBeTruthy();
1234
1259
  const customerData = await response.json();
1235
1260
  let customer;
1236
1261
  if (typeof basicCustomerStruct.password !== "string") {
@@ -1278,6 +1303,7 @@ class TestDataService {
1278
1303
  const orderResponse = await this.AdminApiClient.post("order?_response=detail", {
1279
1304
  data: basicOrder
1280
1305
  });
1306
+ expect(orderResponse.ok()).toBeTruthy();
1281
1307
  const { data: order } = await orderResponse.json();
1282
1308
  this.addCreatedRecord("order", order.id);
1283
1309
  return order;
@@ -1293,6 +1319,7 @@ class TestDataService {
1293
1319
  const promotionResponse = await this.AdminApiClient.post("promotion?_response=detail", {
1294
1320
  data: basicPromotion
1295
1321
  });
1322
+ expect(promotionResponse.ok()).toBeTruthy();
1296
1323
  const { data: promotion } = await promotionResponse.json();
1297
1324
  const promotionWithDiscount = await getPromotionWithDiscount(promotion.id, this.AdminApiClient);
1298
1325
  this.addCreatedRecord("promotion", promotion.id);
@@ -1308,6 +1335,7 @@ class TestDataService {
1308
1335
  const paymentMethodResponse = await this.AdminApiClient.post("payment-method?_response=detail", {
1309
1336
  data: basicPaymentMethod
1310
1337
  });
1338
+ expect(paymentMethodResponse.ok()).toBeTruthy();
1311
1339
  const { data: paymentMethod } = await paymentMethodResponse.json();
1312
1340
  this.addCreatedRecord("payment_method", paymentMethod.id);
1313
1341
  return paymentMethod;
@@ -1322,6 +1350,7 @@ class TestDataService {
1322
1350
  const ruleResponse = await this.AdminApiClient.post("rule?_response=detail", {
1323
1351
  data: basicRule
1324
1352
  });
1353
+ expect(ruleResponse.ok()).toBeTruthy();
1325
1354
  const { data: rule } = await ruleResponse.json();
1326
1355
  this.addCreatedRecord("rule", rule.id);
1327
1356
  return rule;
@@ -1351,6 +1380,14 @@ class TestDataService {
1351
1380
  const propertyGroupOptionsCollection = [];
1352
1381
  for (const propertyGroupOption of propertyGroupOptions) {
1353
1382
  propertyGroupOptionsCollection.push({ id: propertyGroupOption.id });
1383
+ const productConfiguratorResponse = await this.AdminApiClient.post("product-configurator-setting?_response=detail", {
1384
+ data: {
1385
+ id: this.IdProvider.getIdPair().uuid,
1386
+ productId: parentProduct.id,
1387
+ optionId: propertyGroupOption.id
1388
+ }
1389
+ });
1390
+ expect(productConfiguratorResponse.ok()).toBeTruthy();
1354
1391
  }
1355
1392
  productVariantCandidates.push(propertyGroupOptionsCollection);
1356
1393
  }
@@ -1367,6 +1404,11 @@ class TestDataService {
1367
1404
  variantProducts.push(await this.createBasicProduct(overrideCollection));
1368
1405
  index++;
1369
1406
  }
1407
+ await this.AdminApiClient.post("_action/indexing/product.indexer?_response=detail", {
1408
+ data: {
1409
+ offset: 0
1410
+ }
1411
+ });
1370
1412
  return variantProducts;
1371
1413
  }
1372
1414
  /**
@@ -1387,6 +1429,7 @@ class TestDataService {
1387
1429
  */
1388
1430
  async createBasicShippingMethod(overrides = {}) {
1389
1431
  const deliveryTime = await this.getAllDeliveryTimeResources();
1432
+ overrides.availabilityRuleId ?? (overrides.availabilityRuleId = (await this.getRule("Always valid (Default)")).id);
1390
1433
  const basicShippingMethod = this.getBasicShippingMethodStruct(
1391
1434
  deliveryTime[0].id,
1392
1435
  overrides
@@ -1394,6 +1437,7 @@ class TestDataService {
1394
1437
  const shippingMethodResponse = await this.AdminApiClient.post("shipping-method?_response=detail", {
1395
1438
  data: basicShippingMethod
1396
1439
  });
1440
+ expect(shippingMethodResponse.ok()).toBeTruthy();
1397
1441
  const { data: shippingMethod } = await shippingMethodResponse.json();
1398
1442
  this.addCreatedRecord("shipping_method", shippingMethod.id);
1399
1443
  return shippingMethod;
@@ -1410,6 +1454,7 @@ class TestDataService {
1410
1454
  mediaId
1411
1455
  }
1412
1456
  });
1457
+ expect(paymentMethodResponse.ok()).toBeTruthy();
1413
1458
  const { data: paymentMethodMedia } = await paymentMethodResponse.json();
1414
1459
  return paymentMethodMedia;
1415
1460
  }
@@ -1426,6 +1471,7 @@ class TestDataService {
1426
1471
  mediaId
1427
1472
  }
1428
1473
  });
1474
+ expect(downloadResponse.ok()).toBeTruthy();
1429
1475
  const { data: productDownload } = await downloadResponse.json();
1430
1476
  return productDownload;
1431
1477
  }
@@ -1450,6 +1496,7 @@ class TestDataService {
1450
1496
  ]
1451
1497
  }
1452
1498
  });
1499
+ expect(mediaResponse.ok()).toBeTruthy();
1453
1500
  const { data: productMedia } = await mediaResponse.json();
1454
1501
  return productMedia;
1455
1502
  }
@@ -1465,6 +1512,7 @@ class TestDataService {
1465
1512
  mediaId
1466
1513
  }
1467
1514
  });
1515
+ expect(mediaResponse.ok()).toBeTruthy();
1468
1516
  const { data: manufacturerMedia } = await mediaResponse.json();
1469
1517
  return manufacturerMedia;
1470
1518
  }
@@ -1475,7 +1523,7 @@ class TestDataService {
1475
1523
  * @param productId - The uuid of the product.
1476
1524
  */
1477
1525
  async assignManufacturerProduct(manufacturerId, productId) {
1478
- return await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
1526
+ await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
1479
1527
  data: {
1480
1528
  manufacturerId
1481
1529
  }
@@ -1527,6 +1575,7 @@ class TestDataService {
1527
1575
  }]
1528
1576
  }
1529
1577
  });
1578
+ expect(currencyResponse.ok()).toBeTruthy();
1530
1579
  const { data: result } = await currencyResponse.json();
1531
1580
  return result[0];
1532
1581
  }
@@ -1546,6 +1595,7 @@ class TestDataService {
1546
1595
  }]
1547
1596
  }
1548
1597
  });
1598
+ expect(response.ok()).toBeTruthy();
1549
1599
  const { data: result } = await response.json();
1550
1600
  return result[0];
1551
1601
  }
@@ -1565,6 +1615,7 @@ class TestDataService {
1565
1615
  }]
1566
1616
  }
1567
1617
  });
1618
+ expect(response.ok()).toBeTruthy();
1568
1619
  const { data: result } = await response.json();
1569
1620
  return result[0];
1570
1621
  }
@@ -1580,6 +1631,7 @@ class TestDataService {
1580
1631
  mediaId
1581
1632
  }
1582
1633
  });
1634
+ expect(shippingMethodResponse.ok()).toBeTruthy();
1583
1635
  const { data: shippingMethodMedia } = await shippingMethodResponse.json();
1584
1636
  return shippingMethodMedia;
1585
1637
  }
@@ -1588,6 +1640,7 @@ class TestDataService {
1588
1640
  */
1589
1641
  async getAllDeliveryTimeResources() {
1590
1642
  const response = await this.AdminApiClient.get("delivery-time");
1643
+ expect(response.ok()).toBeTruthy();
1591
1644
  const { data: deliveryTimeResources } = await response.json();
1592
1645
  return deliveryTimeResources;
1593
1646
  }
@@ -1607,6 +1660,7 @@ class TestDataService {
1607
1660
  }]
1608
1661
  }
1609
1662
  });
1663
+ expect(response.ok()).toBeTruthy();
1610
1664
  const { data: result } = await response.json();
1611
1665
  return result[0];
1612
1666
  }
@@ -1617,6 +1671,7 @@ class TestDataService {
1617
1671
  */
1618
1672
  async getCustomerAddress(addressId) {
1619
1673
  const response = await this.AdminApiClient.get(`customer-address/${addressId}`);
1674
+ expect(response.ok()).toBeTruthy();
1620
1675
  const { data: address } = await response.json();
1621
1676
  return address;
1622
1677
  }
@@ -1636,6 +1691,7 @@ class TestDataService {
1636
1691
  }]
1637
1692
  }
1638
1693
  });
1694
+ expect(response.ok()).toBeTruthy();
1639
1695
  const { data: result } = await response.json();
1640
1696
  return result[0];
1641
1697
  }
@@ -1673,6 +1729,7 @@ class TestDataService {
1673
1729
  }]
1674
1730
  }
1675
1731
  });
1732
+ expect(response.ok()).toBeTruthy();
1676
1733
  const { data: result } = await response.json();
1677
1734
  return result[0];
1678
1735
  }
@@ -1697,6 +1754,7 @@ class TestDataService {
1697
1754
  }]
1698
1755
  }
1699
1756
  });
1757
+ expect(response.ok()).toBeTruthy();
1700
1758
  const { data: result } = await response.json();
1701
1759
  return result[0];
1702
1760
  }
@@ -1716,6 +1774,7 @@ class TestDataService {
1716
1774
  }]
1717
1775
  }
1718
1776
  });
1777
+ expect(response.ok()).toBeTruthy();
1719
1778
  const { data: result } = await response.json();
1720
1779
  return result;
1721
1780
  }
@@ -2374,6 +2433,18 @@ const test$7 = test$e.extend({
2374
2433
  await use(SetupInstance);
2375
2434
  },
2376
2435
  { scope: "worker" }
2436
+ ],
2437
+ InstanceMeta: [
2438
+ async ({ AdminApiContext: context }, use) => {
2439
+ const response = await context.get("./_info/config");
2440
+ expect(response.ok(), "/_info/config request failed").toBeTruthy();
2441
+ const config = await response.json();
2442
+ use({
2443
+ version: config.version,
2444
+ isSaaS: await isSaaSInstance(context)
2445
+ });
2446
+ },
2447
+ { scope: "worker" }
2377
2448
  ]
2378
2449
  });
2379
2450
 
@@ -2454,7 +2525,7 @@ class Category {
2454
2525
  this.noProductsFoundAlert = page.getByText("No products found.");
2455
2526
  }
2456
2527
  url(categoryName) {
2457
- return `${categoryName}`;
2528
+ return `${categoryName}/`;
2458
2529
  }
2459
2530
  }
2460
2531
 
@@ -2836,7 +2907,7 @@ class AccountAddresses {
2836
2907
  __publicField$d(this, "editShippingAddressButton");
2837
2908
  __publicField$d(this, "useDefaultBillingAddressButton");
2838
2909
  __publicField$d(this, "useDefaultShippingAddressButton");
2839
- this.addNewAddressButton = page.getByRole("link", { name: "Add new address" });
2910
+ this.addNewAddressButton = page.getByRole("link", { name: /Add (new )?address/ });
2840
2911
  this.editBillingAddressButton = page.getByRole("link", { name: "Edit address" }).first();
2841
2912
  this.editShippingAddressButton = page.getByRole("link", { name: "Edit address" }).nth(1);
2842
2913
  this.useDefaultBillingAddressButton = page.getByRole("button", { name: "Use as default billing address" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "3.8.1",
3
+ "version": "3.8.3",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",