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

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
  }
@@ -1387,6 +1424,7 @@ class TestDataService {
1387
1424
  */
1388
1425
  async createBasicShippingMethod(overrides = {}) {
1389
1426
  const deliveryTime = await this.getAllDeliveryTimeResources();
1427
+ overrides.availabilityRuleId ?? (overrides.availabilityRuleId = (await this.getRule("Always valid (Default)")).id);
1390
1428
  const basicShippingMethod = this.getBasicShippingMethodStruct(
1391
1429
  deliveryTime[0].id,
1392
1430
  overrides
@@ -1394,6 +1432,7 @@ class TestDataService {
1394
1432
  const shippingMethodResponse = await this.AdminApiClient.post("shipping-method?_response=detail", {
1395
1433
  data: basicShippingMethod
1396
1434
  });
1435
+ expect(shippingMethodResponse.ok()).toBeTruthy();
1397
1436
  const { data: shippingMethod } = await shippingMethodResponse.json();
1398
1437
  this.addCreatedRecord("shipping_method", shippingMethod.id);
1399
1438
  return shippingMethod;
@@ -1410,6 +1449,7 @@ class TestDataService {
1410
1449
  mediaId
1411
1450
  }
1412
1451
  });
1452
+ expect(paymentMethodResponse.ok()).toBeTruthy();
1413
1453
  const { data: paymentMethodMedia } = await paymentMethodResponse.json();
1414
1454
  return paymentMethodMedia;
1415
1455
  }
@@ -1426,6 +1466,7 @@ class TestDataService {
1426
1466
  mediaId
1427
1467
  }
1428
1468
  });
1469
+ expect(downloadResponse.ok()).toBeTruthy();
1429
1470
  const { data: productDownload } = await downloadResponse.json();
1430
1471
  return productDownload;
1431
1472
  }
@@ -1450,6 +1491,7 @@ class TestDataService {
1450
1491
  ]
1451
1492
  }
1452
1493
  });
1494
+ expect(mediaResponse.ok()).toBeTruthy();
1453
1495
  const { data: productMedia } = await mediaResponse.json();
1454
1496
  return productMedia;
1455
1497
  }
@@ -1465,6 +1507,7 @@ class TestDataService {
1465
1507
  mediaId
1466
1508
  }
1467
1509
  });
1510
+ expect(mediaResponse.ok()).toBeTruthy();
1468
1511
  const { data: manufacturerMedia } = await mediaResponse.json();
1469
1512
  return manufacturerMedia;
1470
1513
  }
@@ -1475,7 +1518,7 @@ class TestDataService {
1475
1518
  * @param productId - The uuid of the product.
1476
1519
  */
1477
1520
  async assignManufacturerProduct(manufacturerId, productId) {
1478
- return await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
1521
+ await this.AdminApiClient.patch(`product/${productId}?_response=basic`, {
1479
1522
  data: {
1480
1523
  manufacturerId
1481
1524
  }
@@ -1527,6 +1570,7 @@ class TestDataService {
1527
1570
  }]
1528
1571
  }
1529
1572
  });
1573
+ expect(currencyResponse.ok()).toBeTruthy();
1530
1574
  const { data: result } = await currencyResponse.json();
1531
1575
  return result[0];
1532
1576
  }
@@ -1546,6 +1590,7 @@ class TestDataService {
1546
1590
  }]
1547
1591
  }
1548
1592
  });
1593
+ expect(response.ok()).toBeTruthy();
1549
1594
  const { data: result } = await response.json();
1550
1595
  return result[0];
1551
1596
  }
@@ -1565,6 +1610,7 @@ class TestDataService {
1565
1610
  }]
1566
1611
  }
1567
1612
  });
1613
+ expect(response.ok()).toBeTruthy();
1568
1614
  const { data: result } = await response.json();
1569
1615
  return result[0];
1570
1616
  }
@@ -1580,6 +1626,7 @@ class TestDataService {
1580
1626
  mediaId
1581
1627
  }
1582
1628
  });
1629
+ expect(shippingMethodResponse.ok()).toBeTruthy();
1583
1630
  const { data: shippingMethodMedia } = await shippingMethodResponse.json();
1584
1631
  return shippingMethodMedia;
1585
1632
  }
@@ -1588,6 +1635,7 @@ class TestDataService {
1588
1635
  */
1589
1636
  async getAllDeliveryTimeResources() {
1590
1637
  const response = await this.AdminApiClient.get("delivery-time");
1638
+ expect(response.ok()).toBeTruthy();
1591
1639
  const { data: deliveryTimeResources } = await response.json();
1592
1640
  return deliveryTimeResources;
1593
1641
  }
@@ -1607,6 +1655,7 @@ class TestDataService {
1607
1655
  }]
1608
1656
  }
1609
1657
  });
1658
+ expect(response.ok()).toBeTruthy();
1610
1659
  const { data: result } = await response.json();
1611
1660
  return result[0];
1612
1661
  }
@@ -1617,6 +1666,7 @@ class TestDataService {
1617
1666
  */
1618
1667
  async getCustomerAddress(addressId) {
1619
1668
  const response = await this.AdminApiClient.get(`customer-address/${addressId}`);
1669
+ expect(response.ok()).toBeTruthy();
1620
1670
  const { data: address } = await response.json();
1621
1671
  return address;
1622
1672
  }
@@ -1636,6 +1686,7 @@ class TestDataService {
1636
1686
  }]
1637
1687
  }
1638
1688
  });
1689
+ expect(response.ok()).toBeTruthy();
1639
1690
  const { data: result } = await response.json();
1640
1691
  return result[0];
1641
1692
  }
@@ -1673,6 +1724,7 @@ class TestDataService {
1673
1724
  }]
1674
1725
  }
1675
1726
  });
1727
+ expect(response.ok()).toBeTruthy();
1676
1728
  const { data: result } = await response.json();
1677
1729
  return result[0];
1678
1730
  }
@@ -1697,6 +1749,7 @@ class TestDataService {
1697
1749
  }]
1698
1750
  }
1699
1751
  });
1752
+ expect(response.ok()).toBeTruthy();
1700
1753
  const { data: result } = await response.json();
1701
1754
  return result[0];
1702
1755
  }
@@ -1716,6 +1769,7 @@ class TestDataService {
1716
1769
  }]
1717
1770
  }
1718
1771
  });
1772
+ expect(response.ok()).toBeTruthy();
1719
1773
  const { data: result } = await response.json();
1720
1774
  return result;
1721
1775
  }
@@ -2374,6 +2428,18 @@ const test$7 = test$e.extend({
2374
2428
  await use(SetupInstance);
2375
2429
  },
2376
2430
  { scope: "worker" }
2431
+ ],
2432
+ InstanceMeta: [
2433
+ async ({ AdminApiContext: context }, use) => {
2434
+ const response = await context.get("./_info/config");
2435
+ expect(response.ok(), "/_info/config request failed").toBeTruthy();
2436
+ const config = await response.json();
2437
+ use({
2438
+ version: config.version,
2439
+ isSaaS: await isSaaSInstance(context)
2440
+ });
2441
+ },
2442
+ { scope: "worker" }
2377
2443
  ]
2378
2444
  });
2379
2445
 
@@ -2454,7 +2520,7 @@ class Category {
2454
2520
  this.noProductsFoundAlert = page.getByText("No products found.");
2455
2521
  }
2456
2522
  url(categoryName) {
2457
- return `${categoryName}`;
2523
+ return `${categoryName}/`;
2458
2524
  }
2459
2525
  }
2460
2526
 
@@ -2836,7 +2902,7 @@ class AccountAddresses {
2836
2902
  __publicField$d(this, "editShippingAddressButton");
2837
2903
  __publicField$d(this, "useDefaultBillingAddressButton");
2838
2904
  __publicField$d(this, "useDefaultShippingAddressButton");
2839
- this.addNewAddressButton = page.getByRole("link", { name: "Add new address" });
2905
+ this.addNewAddressButton = page.getByRole("link", { name: /Add (new )?address/ });
2840
2906
  this.editBillingAddressButton = page.getByRole("link", { name: "Edit address" }).first();
2841
2907
  this.editShippingAddressButton = page.getByRole("link", { name: "Edit address" }).nth(1);
2842
2908
  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.2",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",