@shopware-ag/acceptance-test-suite 10.2.3 → 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 +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.mjs +37 -55
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -373,8 +373,10 @@ declare enum RuleType {
|
|
|
373
373
|
promotionCart = "promotionCartRule"
|
|
374
374
|
}
|
|
375
375
|
interface RuleAssignmentEntity {
|
|
376
|
-
|
|
377
|
-
|
|
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
|
-
*
|
|
661
|
+
* Set system config for default sales channel
|
|
659
662
|
*
|
|
660
|
-
* @param
|
|
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
|
-
|
|
665
|
+
setSystemConfig(configs: Record<string, unknown>): Promise<void>;
|
|
665
666
|
/**
|
|
666
667
|
* Creates a random sales channel analytics entity
|
|
667
668
|
*
|
|
@@ -1244,6 +1245,7 @@ declare class AccountLogin implements PageObject {
|
|
|
1244
1245
|
readonly logoutLink: Locator;
|
|
1245
1246
|
readonly successAlert: Locator;
|
|
1246
1247
|
readonly invalidCredentialsAlert: Locator;
|
|
1248
|
+
readonly passwordUpdatedAlert: Locator;
|
|
1247
1249
|
readonly personalFormArea: Locator;
|
|
1248
1250
|
readonly billingAddressFormArea: Locator;
|
|
1249
1251
|
readonly accountTypeSelect: Locator;
|
|
@@ -1273,8 +1275,12 @@ declare class AccountRecover implements PageObject {
|
|
|
1273
1275
|
readonly requestEmailButton: Locator;
|
|
1274
1276
|
readonly backButton: Locator;
|
|
1275
1277
|
readonly passwordResetEmailSentMessage: Locator;
|
|
1278
|
+
readonly newPasswordInput: Locator;
|
|
1279
|
+
readonly newPasswordConfirmInput: Locator;
|
|
1280
|
+
readonly changePasswordButton: Locator;
|
|
1281
|
+
readonly invalidLinkMessage: Locator;
|
|
1276
1282
|
constructor(page: Page);
|
|
1277
|
-
url(): string;
|
|
1283
|
+
url(recoverLink?: string): string;
|
|
1278
1284
|
}
|
|
1279
1285
|
|
|
1280
1286
|
declare class AccountProfile implements PageObject {
|
|
@@ -2225,8 +2231,6 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
2225
2231
|
ExpectNotification: Task;
|
|
2226
2232
|
} & {
|
|
2227
2233
|
CreateLinkTypeCategory: Task;
|
|
2228
|
-
} & {
|
|
2229
|
-
SetSystemConfigValues: Task;
|
|
2230
2234
|
} & {
|
|
2231
2235
|
BulkEditProducts: Task;
|
|
2232
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
|
-
|
|
377
|
-
|
|
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
|
-
*
|
|
661
|
+
* Set system config for default sales channel
|
|
659
662
|
*
|
|
660
|
-
* @param
|
|
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
|
-
|
|
665
|
+
setSystemConfig(configs: Record<string, unknown>): Promise<void>;
|
|
665
666
|
/**
|
|
666
667
|
* Creates a random sales channel analytics entity
|
|
667
668
|
*
|
|
@@ -1244,6 +1245,7 @@ declare class AccountLogin implements PageObject {
|
|
|
1244
1245
|
readonly logoutLink: Locator;
|
|
1245
1246
|
readonly successAlert: Locator;
|
|
1246
1247
|
readonly invalidCredentialsAlert: Locator;
|
|
1248
|
+
readonly passwordUpdatedAlert: Locator;
|
|
1247
1249
|
readonly personalFormArea: Locator;
|
|
1248
1250
|
readonly billingAddressFormArea: Locator;
|
|
1249
1251
|
readonly accountTypeSelect: Locator;
|
|
@@ -1273,8 +1275,12 @@ declare class AccountRecover implements PageObject {
|
|
|
1273
1275
|
readonly requestEmailButton: Locator;
|
|
1274
1276
|
readonly backButton: Locator;
|
|
1275
1277
|
readonly passwordResetEmailSentMessage: Locator;
|
|
1278
|
+
readonly newPasswordInput: Locator;
|
|
1279
|
+
readonly newPasswordConfirmInput: Locator;
|
|
1280
|
+
readonly changePasswordButton: Locator;
|
|
1281
|
+
readonly invalidLinkMessage: Locator;
|
|
1276
1282
|
constructor(page: Page);
|
|
1277
|
-
url(): string;
|
|
1283
|
+
url(recoverLink?: string): string;
|
|
1278
1284
|
}
|
|
1279
1285
|
|
|
1280
1286
|
declare class AccountProfile implements PageObject {
|
|
@@ -2225,8 +2231,6 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
2225
2231
|
ExpectNotification: Task;
|
|
2226
2232
|
} & {
|
|
2227
2233
|
CreateLinkTypeCategory: Task;
|
|
2228
|
-
} & {
|
|
2229
|
-
SetSystemConfigValues: Task;
|
|
2230
2234
|
} & {
|
|
2231
2235
|
BulkEditProducts: Task;
|
|
2232
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
|
-
*
|
|
1530
|
+
* Set system config for default sales channel
|
|
1530
1531
|
*
|
|
1531
|
-
* @param
|
|
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
|
|
1536
|
-
const
|
|
1537
|
-
|
|
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
|
|
1547
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -3423,6 +3420,7 @@ class AccountLogin {
|
|
|
3423
3420
|
__publicField$F(this, "logoutLink");
|
|
3424
3421
|
__publicField$F(this, "successAlert");
|
|
3425
3422
|
__publicField$F(this, "invalidCredentialsAlert");
|
|
3423
|
+
__publicField$F(this, "passwordUpdatedAlert");
|
|
3426
3424
|
// Inputs for registration
|
|
3427
3425
|
__publicField$F(this, "personalFormArea");
|
|
3428
3426
|
__publicField$F(this, "billingAddressFormArea");
|
|
@@ -3464,6 +3462,7 @@ class AccountLogin {
|
|
|
3464
3462
|
this.registerButton = page.getByRole("button", { name: "Continue" });
|
|
3465
3463
|
this.logoutLink = page.getByRole("link", { name: "Log out" });
|
|
3466
3464
|
this.successAlert = page.getByText("Successfully logged out.");
|
|
3465
|
+
this.passwordUpdatedAlert = page.getByText("Your password has been updated.");
|
|
3467
3466
|
}
|
|
3468
3467
|
url() {
|
|
3469
3468
|
return "account/login";
|
|
@@ -3486,6 +3485,10 @@ class AccountRecover {
|
|
|
3486
3485
|
__publicField$E(this, "requestEmailButton");
|
|
3487
3486
|
__publicField$E(this, "backButton");
|
|
3488
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");
|
|
3489
3492
|
this.passwordRecoveryForm = page.locator(".account-recover-password-form");
|
|
3490
3493
|
const cardTitle = this.passwordRecoveryForm.locator(".card-title");
|
|
3491
3494
|
this.title = cardTitle.getByText("Password recovery");
|
|
@@ -3494,8 +3497,15 @@ class AccountRecover {
|
|
|
3494
3497
|
this.requestEmailButton = this.passwordRecoveryForm.getByRole("button", { name: "Request email" });
|
|
3495
3498
|
this.backButton = this.passwordRecoveryForm.getByRole("link", { name: "Back" });
|
|
3496
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.");
|
|
3497
3504
|
}
|
|
3498
|
-
url() {
|
|
3505
|
+
url(recoverLink) {
|
|
3506
|
+
if (recoverLink) {
|
|
3507
|
+
return recoverLink;
|
|
3508
|
+
}
|
|
3499
3509
|
return "account/recover";
|
|
3500
3510
|
}
|
|
3501
3511
|
}
|
|
@@ -6119,33 +6129,6 @@ const CreateLinkTypeCategory = test$e.extend({
|
|
|
6119
6129
|
}
|
|
6120
6130
|
});
|
|
6121
6131
|
|
|
6122
|
-
const SetSystemConfigValues = test$e.extend({
|
|
6123
|
-
SetSystemConfigValues: async ({ AdminApiContext, DefaultSalesChannel, TestDataService }, use) => {
|
|
6124
|
-
let defaultSettings;
|
|
6125
|
-
const task = (newValues, defaultValues) => {
|
|
6126
|
-
return async function LoginRegistration() {
|
|
6127
|
-
defaultSettings = defaultValues;
|
|
6128
|
-
const newSettings = await AdminApiContext.post("./_action/system-config/batch", {
|
|
6129
|
-
data: {
|
|
6130
|
-
null: newValues,
|
|
6131
|
-
[DefaultSalesChannel.salesChannel.id]: {}
|
|
6132
|
-
}
|
|
6133
|
-
});
|
|
6134
|
-
expect(newSettings.ok()).toBeTruthy();
|
|
6135
|
-
await TestDataService.clearCaches();
|
|
6136
|
-
};
|
|
6137
|
-
};
|
|
6138
|
-
await use(task);
|
|
6139
|
-
const revertSettings = await AdminApiContext.post(`./_action/system-config/batch`, {
|
|
6140
|
-
data: {
|
|
6141
|
-
null: defaultSettings,
|
|
6142
|
-
[DefaultSalesChannel.salesChannel.id]: {}
|
|
6143
|
-
}
|
|
6144
|
-
});
|
|
6145
|
-
expect(revertSettings.ok()).toBeTruthy();
|
|
6146
|
-
}
|
|
6147
|
-
});
|
|
6148
|
-
|
|
6149
6132
|
const BulkEditProducts = test$e.extend({
|
|
6150
6133
|
BulkEditProducts: async ({ AdminProductBulkEdit, AdminProductListing }, use) => {
|
|
6151
6134
|
const task = (products, changes) => {
|
|
@@ -6334,28 +6317,28 @@ const AssignEntitiesToRule = test$e.extend({
|
|
|
6334
6317
|
await AdminRuleDetail.page.locator(".sw-data-grid__row").filter({ hasText: entityName }).getByRole("checkbox").click();
|
|
6335
6318
|
await AdminRuleDetail.page.locator(".sw-button--primary").getByText("Add").click();
|
|
6336
6319
|
}
|
|
6337
|
-
for (const
|
|
6338
|
-
switch (
|
|
6320
|
+
for (const assignableEntity of assignableEntities) {
|
|
6321
|
+
switch (assignableEntity.ruleType) {
|
|
6339
6322
|
case RuleType.shippingAvailability:
|
|
6340
|
-
await entityAssignment(entity.name, AdminRuleDetail.shippingMethodAvailabilityRulesCard);
|
|
6323
|
+
await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.shippingMethodAvailabilityRulesCard);
|
|
6341
6324
|
break;
|
|
6342
6325
|
case RuleType.taxAvailability:
|
|
6343
|
-
await entityAssignment(entity.name, AdminRuleDetail.taxProviderRulesCard);
|
|
6326
|
+
await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.taxProviderRulesCard);
|
|
6344
6327
|
break;
|
|
6345
6328
|
case RuleType.paymentAvailability:
|
|
6346
|
-
await entityAssignment(entity.name, AdminRuleDetail.paymentMethodsAvailabilityRulesCard);
|
|
6329
|
+
await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.paymentMethodsAvailabilityRulesCard);
|
|
6347
6330
|
break;
|
|
6348
6331
|
case RuleType.promotionOrder:
|
|
6349
|
-
await entityAssignment(entity.name, AdminRuleDetail.promotionOrderRulesCard);
|
|
6332
|
+
await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.promotionOrderRulesCard);
|
|
6350
6333
|
break;
|
|
6351
6334
|
case RuleType.promotionCustomer:
|
|
6352
|
-
await entityAssignment(entity.name, AdminRuleDetail.promotionCustomerRulesCard);
|
|
6335
|
+
await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.promotionCustomerRulesCard);
|
|
6353
6336
|
break;
|
|
6354
6337
|
case RuleType.promotionCart:
|
|
6355
|
-
await entityAssignment(entity.name, AdminRuleDetail.promotionCartRulesCard);
|
|
6338
|
+
await entityAssignment(assignableEntity.entity.name, AdminRuleDetail.promotionCartRulesCard);
|
|
6356
6339
|
break;
|
|
6357
6340
|
default:
|
|
6358
|
-
throw new Error(`Unknown rule type "${
|
|
6341
|
+
throw new Error(`Unknown rule type "${assignableEntity.ruleType}". Valid rule types: "${Object.values(RuleType).join('", "')}".`);
|
|
6359
6342
|
}
|
|
6360
6343
|
}
|
|
6361
6344
|
};
|
|
@@ -6368,7 +6351,6 @@ const test$3 = mergeTests(
|
|
|
6368
6351
|
SaveProduct,
|
|
6369
6352
|
ExpectNotification,
|
|
6370
6353
|
CreateLinkTypeCategory,
|
|
6371
|
-
SetSystemConfigValues,
|
|
6372
6354
|
BulkEditProducts,
|
|
6373
6355
|
BulkEditCustomers,
|
|
6374
6356
|
AssignEntitiesToRule
|