@shopware-ag/acceptance-test-suite 10.2.2 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -373,8 +373,10 @@ declare enum RuleType {
373
373
  promotionCart = "promotionCartRule"
374
374
  }
375
375
  interface RuleAssignmentEntity {
376
- id: string;
377
- name: string;
376
+ entity: {
377
+ id: string;
378
+ name: string;
379
+ };
378
380
  ruleType: RuleType;
379
381
  }
380
382
  interface CategoryData {
@@ -467,6 +469,7 @@ declare class TestDataService {
467
469
  * @private
468
470
  */
469
471
  private createdRecords;
472
+ private restoreSystemConfig;
470
473
  /**
471
474
  * A registry of all created sales channel records.
472
475
  *
@@ -655,13 +658,11 @@ declare class TestDataService {
655
658
  */
656
659
  createCustomerGroup(overrides?: Partial<CustomerGroup>): Promise<CustomerGroup>;
657
660
  /**
658
- * Creates a system config entry
661
+ * Set system config for default sales channel
659
662
  *
660
- * @param configurationKey - Config key for shop configurations.
661
- * @param configurationValue - Config value as object for shop configurations (see {@link https://shopware.stoplight.io/docs/admin-api/9174d032146f8-create-a-new-system-config-resources|AdminApi Stoplight}).
662
- * @param salesChannelId - Unique identity of sales channel.
663
+ * @param configs - Key value pairs to set
663
664
  */
664
- createSystemConfigEntry(configurationKey: string, configurationValue?: {}, salesChannelId?: string): Promise<SystemConfig>;
665
+ setSystemConfig(configs: Record<string, unknown>): Promise<void>;
665
666
  /**
666
667
  * Creates a random sales channel analytics entity
667
668
  *
@@ -1243,6 +1244,8 @@ declare class AccountLogin implements PageObject {
1243
1244
  readonly loginButton: Locator;
1244
1245
  readonly logoutLink: Locator;
1245
1246
  readonly successAlert: Locator;
1247
+ readonly invalidCredentialsAlert: Locator;
1248
+ readonly passwordUpdatedAlert: Locator;
1246
1249
  readonly personalFormArea: Locator;
1247
1250
  readonly billingAddressFormArea: Locator;
1248
1251
  readonly accountTypeSelect: Locator;
@@ -1272,8 +1275,12 @@ declare class AccountRecover implements PageObject {
1272
1275
  readonly requestEmailButton: Locator;
1273
1276
  readonly backButton: Locator;
1274
1277
  readonly passwordResetEmailSentMessage: Locator;
1278
+ readonly newPasswordInput: Locator;
1279
+ readonly newPasswordConfirmInput: Locator;
1280
+ readonly changePasswordButton: Locator;
1281
+ readonly invalidLinkMessage: Locator;
1275
1282
  constructor(page: Page);
1276
- url(): string;
1283
+ url(recoverLink?: string): string;
1277
1284
  }
1278
1285
 
1279
1286
  declare class AccountProfile implements PageObject {
@@ -1295,6 +1302,9 @@ declare class AccountProfile implements PageObject {
1295
1302
  readonly loginDataEmailAddress: Locator;
1296
1303
  readonly emailUpdateMessage: Locator;
1297
1304
  readonly passwordUpdateMessage: Locator;
1305
+ readonly emailValidationAlert: Locator;
1306
+ readonly emailUpdateFailureAlert: Locator;
1307
+ readonly passwordUpdateFailureAlert: Locator;
1298
1308
  constructor(page: Page);
1299
1309
  url(): string;
1300
1310
  }
@@ -2221,8 +2231,6 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
2221
2231
  ExpectNotification: Task;
2222
2232
  } & {
2223
2233
  CreateLinkTypeCategory: Task;
2224
- } & {
2225
- SetSystemConfigValues: Task;
2226
2234
  } & {
2227
2235
  BulkEditProducts: Task;
2228
2236
  } & {
package/dist/index.d.ts CHANGED
@@ -373,8 +373,10 @@ declare enum RuleType {
373
373
  promotionCart = "promotionCartRule"
374
374
  }
375
375
  interface RuleAssignmentEntity {
376
- id: string;
377
- name: string;
376
+ entity: {
377
+ id: string;
378
+ name: string;
379
+ };
378
380
  ruleType: RuleType;
379
381
  }
380
382
  interface CategoryData {
@@ -467,6 +469,7 @@ declare class TestDataService {
467
469
  * @private
468
470
  */
469
471
  private createdRecords;
472
+ private restoreSystemConfig;
470
473
  /**
471
474
  * A registry of all created sales channel records.
472
475
  *
@@ -655,13 +658,11 @@ declare class TestDataService {
655
658
  */
656
659
  createCustomerGroup(overrides?: Partial<CustomerGroup>): Promise<CustomerGroup>;
657
660
  /**
658
- * Creates a system config entry
661
+ * Set system config for default sales channel
659
662
  *
660
- * @param configurationKey - Config key for shop configurations.
661
- * @param configurationValue - Config value as object for shop configurations (see {@link https://shopware.stoplight.io/docs/admin-api/9174d032146f8-create-a-new-system-config-resources|AdminApi Stoplight}).
662
- * @param salesChannelId - Unique identity of sales channel.
663
+ * @param configs - Key value pairs to set
663
664
  */
664
- createSystemConfigEntry(configurationKey: string, configurationValue?: {}, salesChannelId?: string): Promise<SystemConfig>;
665
+ setSystemConfig(configs: Record<string, unknown>): Promise<void>;
665
666
  /**
666
667
  * Creates a random sales channel analytics entity
667
668
  *
@@ -1243,6 +1244,8 @@ declare class AccountLogin implements PageObject {
1243
1244
  readonly loginButton: Locator;
1244
1245
  readonly logoutLink: Locator;
1245
1246
  readonly successAlert: Locator;
1247
+ readonly invalidCredentialsAlert: Locator;
1248
+ readonly passwordUpdatedAlert: Locator;
1246
1249
  readonly personalFormArea: Locator;
1247
1250
  readonly billingAddressFormArea: Locator;
1248
1251
  readonly accountTypeSelect: Locator;
@@ -1272,8 +1275,12 @@ declare class AccountRecover implements PageObject {
1272
1275
  readonly requestEmailButton: Locator;
1273
1276
  readonly backButton: Locator;
1274
1277
  readonly passwordResetEmailSentMessage: Locator;
1278
+ readonly newPasswordInput: Locator;
1279
+ readonly newPasswordConfirmInput: Locator;
1280
+ readonly changePasswordButton: Locator;
1281
+ readonly invalidLinkMessage: Locator;
1275
1282
  constructor(page: Page);
1276
- url(): string;
1283
+ url(recoverLink?: string): string;
1277
1284
  }
1278
1285
 
1279
1286
  declare class AccountProfile implements PageObject {
@@ -1295,6 +1302,9 @@ declare class AccountProfile implements PageObject {
1295
1302
  readonly loginDataEmailAddress: Locator;
1296
1303
  readonly emailUpdateMessage: Locator;
1297
1304
  readonly passwordUpdateMessage: Locator;
1305
+ readonly emailValidationAlert: Locator;
1306
+ readonly emailUpdateFailureAlert: Locator;
1307
+ readonly passwordUpdateFailureAlert: Locator;
1298
1308
  constructor(page: Page);
1299
1309
  url(): string;
1300
1310
  }
@@ -2221,8 +2231,6 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
2221
2231
  ExpectNotification: Task;
2222
2232
  } & {
2223
2233
  CreateLinkTypeCategory: Task;
2224
- } & {
2225
- SetSystemConfigValues: Task;
2226
2234
  } & {
2227
2235
  BulkEditProducts: Task;
2228
2236
  } & {
package/dist/index.mjs CHANGED
@@ -973,6 +973,7 @@ class TestDataService {
973
973
  * @private
974
974
  */
975
975
  __publicField$Q(this, "createdRecords", []);
976
+ __publicField$Q(this, "restoreSystemConfig", {});
976
977
  /**
977
978
  * A registry of all created sales channel records.
978
979
  *
@@ -1526,27 +1527,19 @@ class TestDataService {
1526
1527
  return customerGroup;
1527
1528
  }
1528
1529
  /**
1529
- * Creates a system config entry
1530
+ * Set system config for default sales channel
1530
1531
  *
1531
- * @param configurationKey - Config key for shop configurations.
1532
- * @param configurationValue - Config value as object for shop configurations (see {@link https://shopware.stoplight.io/docs/admin-api/9174d032146f8-create-a-new-system-config-resources|AdminApi Stoplight}).
1533
- * @param salesChannelId - Unique identity of sales channel.
1532
+ * @param configs - Key value pairs to set
1534
1533
  */
1535
- async createSystemConfigEntry(configurationKey, configurationValue = {}, salesChannelId = "") {
1536
- const systemConfigStruct = {
1537
- id: this.IdProvider.getIdPair().uuid,
1538
- configurationKey,
1539
- configurationValue,
1540
- salesChannelId: salesChannelId || null
1541
- };
1542
- const response = await this.AdminApiClient.post("system-config?_response=detail", {
1543
- data: systemConfigStruct
1534
+ async setSystemConfig(configs) {
1535
+ const response = await this.AdminApiClient.post(`_action/system-config?_response=detail&salesChannelId=${this.defaultSalesChannel.id}`, {
1536
+ data: configs
1544
1537
  });
1545
1538
  expect(response.ok()).toBeTruthy();
1546
- const { data: systemConfigEntry } = await response.json();
1547
- this.addCreatedRecord("system_config", systemConfigEntry.id);
1539
+ for (const key of Object.keys(configs)) {
1540
+ this.restoreSystemConfig[key] = null;
1541
+ }
1548
1542
  await this.clearCaches();
1549
- return systemConfigEntry;
1550
1543
  }
1551
1544
  /**
1552
1545
  * Creates a random sales channel analytics entity
@@ -2219,7 +2212,11 @@ class TestDataService {
2219
2212
  await this.AdminApiClient.post("_action/sync", {
2220
2213
  data: priorityDeleteOperations
2221
2214
  });
2222
- return await this.AdminApiClient.post("_action/sync", {
2215
+ await this.AdminApiClient.post(`_action/system-config?_response=detail&salesChannelId=${this.defaultSalesChannel.id}`, {
2216
+ data: this.restoreSystemConfig
2217
+ });
2218
+ await this.clearCaches();
2219
+ return this.AdminApiClient.post("_action/sync", {
2223
2220
  data: deleteOperations
2224
2221
  });
2225
2222
  }
@@ -3422,6 +3419,8 @@ class AccountLogin {
3422
3419
  __publicField$F(this, "loginButton");
3423
3420
  __publicField$F(this, "logoutLink");
3424
3421
  __publicField$F(this, "successAlert");
3422
+ __publicField$F(this, "invalidCredentialsAlert");
3423
+ __publicField$F(this, "passwordUpdatedAlert");
3425
3424
  // Inputs for registration
3426
3425
  __publicField$F(this, "personalFormArea");
3427
3426
  __publicField$F(this, "billingAddressFormArea");
@@ -3444,6 +3443,7 @@ class AccountLogin {
3444
3443
  this.loginButton = page.getByRole("button", { name: "Log in" });
3445
3444
  this.forgotPasswordLink = page.getByRole("link", { name: "I have forgotten my password." });
3446
3445
  this.logoutLink = page.getByRole("link", { name: "Log out" });
3446
+ this.invalidCredentialsAlert = page.getByText("Could not find an account that matches the given credentials.");
3447
3447
  this.personalFormArea = page.locator(".register-personal");
3448
3448
  this.billingAddressFormArea = page.locator(".register-billing");
3449
3449
  this.accountTypeSelect = this.personalFormArea.locator(".contact-select");
@@ -3462,6 +3462,7 @@ class AccountLogin {
3462
3462
  this.registerButton = page.getByRole("button", { name: "Continue" });
3463
3463
  this.logoutLink = page.getByRole("link", { name: "Log out" });
3464
3464
  this.successAlert = page.getByText("Successfully logged out.");
3465
+ this.passwordUpdatedAlert = page.getByText("Your password has been updated.");
3465
3466
  }
3466
3467
  url() {
3467
3468
  return "account/login";
@@ -3484,6 +3485,10 @@ class AccountRecover {
3484
3485
  __publicField$E(this, "requestEmailButton");
3485
3486
  __publicField$E(this, "backButton");
3486
3487
  __publicField$E(this, "passwordResetEmailSentMessage");
3488
+ __publicField$E(this, "newPasswordInput");
3489
+ __publicField$E(this, "newPasswordConfirmInput");
3490
+ __publicField$E(this, "changePasswordButton");
3491
+ __publicField$E(this, "invalidLinkMessage");
3487
3492
  this.passwordRecoveryForm = page.locator(".account-recover-password-form");
3488
3493
  const cardTitle = this.passwordRecoveryForm.locator(".card-title");
3489
3494
  this.title = cardTitle.getByText("Password recovery");
@@ -3492,8 +3497,15 @@ class AccountRecover {
3492
3497
  this.requestEmailButton = this.passwordRecoveryForm.getByRole("button", { name: "Request email" });
3493
3498
  this.backButton = this.passwordRecoveryForm.getByRole("link", { name: "Back" });
3494
3499
  this.passwordResetEmailSentMessage = page.getByText("If the provided email address is registered, a confirmation email including a password reset link has been sent.");
3500
+ this.newPasswordInput = page.getByLabel("New password");
3501
+ this.newPasswordConfirmInput = page.getByLabel("Password confirmation");
3502
+ this.changePasswordButton = page.getByRole("button", { name: "Change password" });
3503
+ this.invalidLinkMessage = page.getByText("The password reset link seems to be invalid.");
3495
3504
  }
3496
- url() {
3505
+ url(recoverLink) {
3506
+ if (recoverLink) {
3507
+ return recoverLink;
3508
+ }
3497
3509
  return "account/recover";
3498
3510
  }
3499
3511
  }
@@ -3524,23 +3536,29 @@ class AccountProfile {
3524
3536
  __publicField$D(this, "loginDataEmailAddress");
3525
3537
  __publicField$D(this, "emailUpdateMessage");
3526
3538
  __publicField$D(this, "passwordUpdateMessage");
3539
+ __publicField$D(this, "emailValidationAlert");
3540
+ __publicField$D(this, "emailUpdateFailureAlert");
3541
+ __publicField$D(this, "passwordUpdateFailureAlert");
3527
3542
  this.salutationSelect = page.getByLabel("Salutation");
3528
3543
  this.firstNameInput = page.getByLabel("First name");
3529
3544
  this.lastNameInput = page.getByLabel("Last name");
3530
3545
  this.saveProfileButton = page.locator("#profilePersonalForm").getByRole("button", { name: "Save changes" });
3531
3546
  this.changeEmailButton = page.getByRole("button", { name: "Change email address" });
3532
- this.emailAddressInput = page.getByLabel("Email address");
3547
+ this.emailAddressInput = page.locator('input[id="personalMail"]');
3533
3548
  this.emailAddressConfirmInput = page.getByLabel("Email address confirmation");
3534
3549
  this.emailConfirmPasswordInput = page.locator('input[id="personalMailPasswordCurrent"]');
3535
3550
  this.saveEmailAddressButton = page.locator("#profileMailForm").getByRole("button", { name: "Save changes" });
3536
3551
  this.changePasswordButton = page.getByRole("button", { name: "Change password" });
3537
3552
  this.newPasswordInput = page.locator('input[id="newPassword"]');
3538
- this.newPasswordConfirmInput = page.locator('input[id="newPasswordConfirmation"]');
3539
- this.currentPasswordInput = page.locator('input[id="passwordCurrent"]');
3553
+ this.newPasswordConfirmInput = page.locator('input[id="passwordConfirmation"]');
3554
+ this.currentPasswordInput = page.locator('input[id="password"]');
3540
3555
  this.saveNewPasswordButton = page.locator("#profilePasswordForm").getByRole("button", { name: "Save changes" });
3541
3556
  this.loginDataEmailAddress = page.locator(".account-profile-mail");
3542
3557
  this.emailUpdateMessage = page.getByText("Your email address has been updated.");
3543
3558
  this.passwordUpdateMessage = page.getByText("Your password has been updated.");
3559
+ this.emailValidationAlert = page.locator(".was-validated");
3560
+ this.emailUpdateFailureAlert = page.getByText("Email address could not be changed.");
3561
+ this.passwordUpdateFailureAlert = page.getByText("Password could not be changed.");
3544
3562
  }
3545
3563
  url() {
3546
3564
  return "account/profile";
@@ -6111,33 +6129,6 @@ const CreateLinkTypeCategory = test$e.extend({
6111
6129
  }
6112
6130
  });
6113
6131
 
6114
- const SetSystemConfigValues = test$e.extend({
6115
- SetSystemConfigValues: async ({ AdminApiContext, DefaultSalesChannel, TestDataService }, use) => {
6116
- let defaultSettings;
6117
- const task = (newValues, defaultValues) => {
6118
- return async function LoginRegistration() {
6119
- defaultSettings = defaultValues;
6120
- const newSettings = await AdminApiContext.post("./_action/system-config/batch", {
6121
- data: {
6122
- null: newValues,
6123
- [DefaultSalesChannel.salesChannel.id]: {}
6124
- }
6125
- });
6126
- expect(newSettings.ok()).toBeTruthy();
6127
- await TestDataService.clearCaches();
6128
- };
6129
- };
6130
- await use(task);
6131
- const revertSettings = await AdminApiContext.post(`./_action/system-config/batch`, {
6132
- data: {
6133
- null: defaultSettings,
6134
- [DefaultSalesChannel.salesChannel.id]: {}
6135
- }
6136
- });
6137
- expect(revertSettings.ok()).toBeTruthy();
6138
- }
6139
- });
6140
-
6141
6132
  const BulkEditProducts = test$e.extend({
6142
6133
  BulkEditProducts: async ({ AdminProductBulkEdit, AdminProductListing }, use) => {
6143
6134
  const task = (products, changes) => {
@@ -6326,28 +6317,28 @@ const AssignEntitiesToRule = test$e.extend({
6326
6317
  await AdminRuleDetail.page.locator(".sw-data-grid__row").filter({ hasText: entityName }).getByRole("checkbox").click();
6327
6318
  await AdminRuleDetail.page.locator(".sw-button--primary").getByText("Add").click();
6328
6319
  }
6329
- for (const entity of assignableEntities) {
6330
- switch (entity.ruleType) {
6320
+ for (const assignableEntity of assignableEntities) {
6321
+ switch (assignableEntity.ruleType) {
6331
6322
  case RuleType.shippingAvailability:
6332
- await entityAssignment(entity.name, AdminRuleDetail.shippingMethodAvailabilityRulesCard);
6323
+ await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.shippingMethodAvailabilityRulesCard);
6333
6324
  break;
6334
6325
  case RuleType.taxAvailability:
6335
- await entityAssignment(entity.name, AdminRuleDetail.taxProviderRulesCard);
6326
+ await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.taxProviderRulesCard);
6336
6327
  break;
6337
6328
  case RuleType.paymentAvailability:
6338
- await entityAssignment(entity.name, AdminRuleDetail.paymentMethodsAvailabilityRulesCard);
6329
+ await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.paymentMethodsAvailabilityRulesCard);
6339
6330
  break;
6340
6331
  case RuleType.promotionOrder:
6341
- await entityAssignment(entity.name, AdminRuleDetail.promotionOrderRulesCard);
6332
+ await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.promotionOrderRulesCard);
6342
6333
  break;
6343
6334
  case RuleType.promotionCustomer:
6344
- await entityAssignment(entity.name, AdminRuleDetail.promotionCustomerRulesCard);
6335
+ await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.promotionCustomerRulesCard);
6345
6336
  break;
6346
6337
  case RuleType.promotionCart:
6347
- await entityAssignment(entity.name, AdminRuleDetail.promotionCartRulesCard);
6338
+ await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.promotionCartRulesCard);
6348
6339
  break;
6349
6340
  default:
6350
- throw new Error(`Unknown rule type "${entity.ruleType}". Valid rule types: "${Object.values(RuleType).join('", "')}".`);
6341
+ throw new Error(`Unknown rule type "${assignableEntity.ruleType}". Valid rule types: "${Object.values(RuleType).join('", "')}".`);
6351
6342
  }
6352
6343
  }
6353
6344
  };
@@ -6360,7 +6351,6 @@ const test$3 = mergeTests(
6360
6351
  SaveProduct,
6361
6352
  ExpectNotification,
6362
6353
  CreateLinkTypeCategory,
6363
- SetSystemConfigValues,
6364
6354
  BulkEditProducts,
6365
6355
  BulkEditCustomers,
6366
6356
  AssignEntitiesToRule
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "10.2.2",
3
+ "version": "11.0.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",