@shopware-ag/acceptance-test-suite 11.1.6 → 11.2.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
@@ -338,6 +338,8 @@ type SalesChannelAnalytics = components['schemas']['SalesChannelAnalytics'] & {
338
338
  id: string;
339
339
  };
340
340
  interface RegistrationData {
341
+ isCommercial: boolean;
342
+ isGuest: boolean;
341
343
  salutation: string;
342
344
  firstName: string;
343
345
  lastName: string;
@@ -1093,6 +1095,8 @@ interface PageObject {
1093
1095
 
1094
1096
  declare class Home implements PageObject {
1095
1097
  readonly page: Page;
1098
+ readonly accountMenuButton: Locator;
1099
+ readonly closeGuestSessionButton: Locator;
1096
1100
  readonly productImages: Locator;
1097
1101
  readonly productListItems: Locator;
1098
1102
  readonly languagesDropdown: Locator;
package/dist/index.d.ts CHANGED
@@ -338,6 +338,8 @@ type SalesChannelAnalytics = components['schemas']['SalesChannelAnalytics'] & {
338
338
  id: string;
339
339
  };
340
340
  interface RegistrationData {
341
+ isCommercial: boolean;
342
+ isGuest: boolean;
341
343
  salutation: string;
342
344
  firstName: string;
343
345
  lastName: string;
@@ -1093,6 +1095,8 @@ interface PageObject {
1093
1095
 
1094
1096
  declare class Home implements PageObject {
1095
1097
  readonly page: Page;
1098
+ readonly accountMenuButton: Locator;
1099
+ readonly closeGuestSessionButton: Locator;
1096
1100
  readonly productImages: Locator;
1097
1101
  readonly productListItems: Locator;
1098
1102
  readonly languagesDropdown: Locator;
package/dist/index.mjs CHANGED
@@ -3026,6 +3026,8 @@ var __publicField$O = (obj, key, value) => {
3026
3026
  class Home {
3027
3027
  constructor(page) {
3028
3028
  this.page = page;
3029
+ __publicField$O(this, "accountMenuButton");
3030
+ __publicField$O(this, "closeGuestSessionButton");
3029
3031
  __publicField$O(this, "productImages");
3030
3032
  __publicField$O(this, "productListItems");
3031
3033
  __publicField$O(this, "languagesDropdown");
@@ -3045,6 +3047,8 @@ class Home {
3045
3047
  __publicField$O(this, "consentDialogSaveButton");
3046
3048
  __publicField$O(this, "consentCookieBannerContainer");
3047
3049
  __publicField$O(this, "offcanvasBackdrop");
3050
+ this.accountMenuButton = page.getByLabel("Your account");
3051
+ this.closeGuestSessionButton = page.locator(".account-aside-btn");
3048
3052
  this.productImages = page.locator(".product-image-wrapper");
3049
3053
  this.productListItems = page.getByRole("listitem");
3050
3054
  this.languagesDropdown = page.locator(".top-bar-language").filter({ has: page.getByRole("button") });
@@ -6463,10 +6467,12 @@ const Register = test$e.extend({
6463
6467
  Register: async ({ StorefrontAccountLogin, AdminApiContext: AdminApiContext2, IdProvider }, use) => {
6464
6468
  let registeredEmail = "";
6465
6469
  const defaultRegistrationData = {
6470
+ isCommercial: false,
6471
+ isGuest: false,
6466
6472
  salutation: "Mr.",
6467
6473
  firstName: "Jeff",
6468
6474
  lastName: "Goldblum",
6469
- email: IdProvider.getIdPair().uuid + "@test.com",
6475
+ email: `${IdProvider.getIdPair().uuid}@test.com`,
6470
6476
  password: "shopware",
6471
6477
  street: "Ebbinghof 10",
6472
6478
  city: "Sch\xF6ppingen",
@@ -6476,20 +6482,23 @@ const Register = test$e.extend({
6476
6482
  department: "Operations",
6477
6483
  vatRegNo: "DE1234567890"
6478
6484
  };
6479
- const registerTask = (overrides, isCommercial) => {
6480
- return async function() {
6485
+ const task = (overrides, isCommercial) => {
6486
+ return async function Register2() {
6481
6487
  const registrationData = { ...defaultRegistrationData, ...overrides };
6482
6488
  registeredEmail = registrationData.email;
6483
- await StorefrontAccountLogin.salutationSelect.selectOption(registrationData.salutation);
6484
- await StorefrontAccountLogin.firstNameInput.fill(registrationData.firstName);
6485
- await StorefrontAccountLogin.lastNameInput.fill(registrationData.lastName);
6486
- if (isCommercial) {
6489
+ if (registrationData.isCommercial || isCommercial) {
6490
+ await StorefrontAccountLogin.accountTypeSelect.selectOption("Commercial");
6487
6491
  await StorefrontAccountLogin.companyInput.fill(registrationData.company);
6488
6492
  await StorefrontAccountLogin.departmentInput.fill(registrationData.department);
6489
6493
  await StorefrontAccountLogin.vatRegNoInput.fill(registrationData.vatRegNo);
6490
6494
  }
6495
+ await StorefrontAccountLogin.salutationSelect.selectOption(registrationData.salutation);
6496
+ await StorefrontAccountLogin.firstNameInput.fill(registrationData.firstName);
6497
+ await StorefrontAccountLogin.lastNameInput.fill(registrationData.lastName);
6491
6498
  await StorefrontAccountLogin.registerEmailInput.fill(registrationData.email);
6492
- await StorefrontAccountLogin.registerPasswordInput.fill(registrationData.password);
6499
+ if (!registrationData.isGuest) {
6500
+ await StorefrontAccountLogin.registerPasswordInput.fill(registrationData.password);
6501
+ }
6493
6502
  await StorefrontAccountLogin.streetAddressInput.fill(registrationData.street);
6494
6503
  await StorefrontAccountLogin.postalCodeInput.fill(registrationData.postalCode);
6495
6504
  await StorefrontAccountLogin.cityInput.fill(registrationData.city);
@@ -6497,28 +6506,32 @@ const Register = test$e.extend({
6497
6506
  await StorefrontAccountLogin.registerButton.click();
6498
6507
  };
6499
6508
  };
6500
- await use(registerTask);
6509
+ await use(task);
6501
6510
  await deleteRegisteredUser(AdminApiContext2, registeredEmail);
6502
6511
  }
6503
6512
  });
6504
6513
  async function deleteRegisteredUser(adminApiContext, email) {
6505
6514
  if (!email)
6506
6515
  return;
6507
- const response = await adminApiContext.post("search/customer", {
6508
- data: {
6509
- limit: 1,
6510
- filter: [
6511
- {
6512
- type: "equals",
6513
- field: "email",
6514
- value: email
6515
- }
6516
- ]
6516
+ try {
6517
+ const response = await adminApiContext.post("search/customer", {
6518
+ data: {
6519
+ limit: 1,
6520
+ filter: [
6521
+ {
6522
+ type: "equals",
6523
+ field: "email",
6524
+ value: email
6525
+ }
6526
+ ]
6527
+ }
6528
+ });
6529
+ const { data: customers } = await response.json();
6530
+ for (const customer of customers) {
6531
+ await adminApiContext.delete(`customer/${customer.id}`);
6517
6532
  }
6518
- });
6519
- const { data: customers } = await response.json();
6520
- for (const customer of customers) {
6521
- await adminApiContext.delete(`customer/${customer.id}`);
6533
+ } catch (error) {
6534
+ console.error(`Error deleting user with email ${email}:`, error);
6522
6535
  }
6523
6536
  }
6524
6537
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/acceptance-test-suite",
3
- "version": "11.1.6",
3
+ "version": "11.2.0",
4
4
  "description": "Shopware Acceptance Test Suite",
5
5
  "author": "shopware AG",
6
6
  "license": "MIT",