@shopware-ag/acceptance-test-suite 12.4.3 → 12.5.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/README.md +1 -1
- package/dist/index.d.mts +1805 -1776
- package/dist/index.d.ts +1805 -1776
- package/dist/index.mjs +174 -143
- package/package.json +65 -58
package/dist/index.mjs
CHANGED
|
@@ -203,7 +203,7 @@ class AdminApiContext {
|
|
|
203
203
|
}
|
|
204
204
|
static async createApiRequestContext(options) {
|
|
205
205
|
const extraHTTPHeaders = {
|
|
206
|
-
|
|
206
|
+
Accept: "application/json",
|
|
207
207
|
"Content-Type": "application/json"
|
|
208
208
|
};
|
|
209
209
|
if (options.access_token && options.access_token.length) {
|
|
@@ -318,7 +318,7 @@ class AdminApiContext {
|
|
|
318
318
|
...options,
|
|
319
319
|
data: options?.data ?? void 0,
|
|
320
320
|
headers: {
|
|
321
|
-
...options?.headers
|
|
321
|
+
...options?.headers,
|
|
322
322
|
Authorization: `Bearer ${this.options.access_token}`
|
|
323
323
|
}
|
|
324
324
|
};
|
|
@@ -329,7 +329,7 @@ class AdminApiContext {
|
|
|
329
329
|
...options,
|
|
330
330
|
data: options?.data ?? void 0,
|
|
331
331
|
headers: {
|
|
332
|
-
...options?.headers
|
|
332
|
+
...options?.headers,
|
|
333
333
|
Authorization: `Bearer ${this.options["access_token"]}`
|
|
334
334
|
}
|
|
335
335
|
};
|
|
@@ -356,7 +356,7 @@ class StoreApiContext {
|
|
|
356
356
|
}
|
|
357
357
|
static async createContext(options) {
|
|
358
358
|
const extraHTTPHeaders = {
|
|
359
|
-
|
|
359
|
+
Accept: "application/json",
|
|
360
360
|
"Content-Type": "application/json"
|
|
361
361
|
};
|
|
362
362
|
if (options["sw-access-key"]) {
|
|
@@ -502,7 +502,7 @@ class MailpitApiContext {
|
|
|
502
502
|
*/
|
|
503
503
|
static async create(baseURL) {
|
|
504
504
|
const extraHTTPHeaders = {
|
|
505
|
-
|
|
505
|
+
Accept: "application/json",
|
|
506
506
|
"Content-Type": "application/json"
|
|
507
507
|
};
|
|
508
508
|
const context = await request.newContext({
|
|
@@ -516,7 +516,6 @@ class MailpitApiContext {
|
|
|
516
516
|
|
|
517
517
|
const test$c = test$e.extend({
|
|
518
518
|
AdminApiContext: [
|
|
519
|
-
// eslint-disable-next-line no-empty-pattern
|
|
520
519
|
async ({}, use) => {
|
|
521
520
|
const adminApiContext = await AdminApiContext.create();
|
|
522
521
|
await use(adminApiContext);
|
|
@@ -536,7 +535,6 @@ const test$c = test$e.extend({
|
|
|
536
535
|
{ scope: "worker" }
|
|
537
536
|
],
|
|
538
537
|
MailpitApiContext: [
|
|
539
|
-
// eslint-disable-next-line no-empty-pattern
|
|
540
538
|
async ({}, use) => {
|
|
541
539
|
const mailpitApiContext = await MailpitApiContext.create(process.env["MAILPIT_BASE_URL"]);
|
|
542
540
|
await use(mailpitApiContext);
|
|
@@ -566,41 +564,62 @@ const clearDelayedCache = async (adminApiContext) => {
|
|
|
566
564
|
};
|
|
567
565
|
|
|
568
566
|
async function mockApiCalls(page) {
|
|
569
|
-
await page.route(
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
567
|
+
await page.route(
|
|
568
|
+
"**/api/notification/message*",
|
|
569
|
+
(route) => route.fulfill({
|
|
570
|
+
status: 200,
|
|
571
|
+
contentType: "application/json",
|
|
572
|
+
body: JSON.stringify({ notifications: [], timestamp: "2024-06-19 06:23:25.040" })
|
|
573
|
+
})
|
|
574
|
+
);
|
|
575
|
+
await page.route(
|
|
576
|
+
"**/api/_action/store/plugin/search*",
|
|
577
|
+
(route) => route.fulfill({
|
|
578
|
+
status: 200,
|
|
579
|
+
contentType: "application/json",
|
|
580
|
+
body: JSON.stringify({ items: [], total: 0 })
|
|
581
|
+
})
|
|
582
|
+
);
|
|
583
|
+
await page.route(
|
|
584
|
+
"**/api/_action/store/updates*",
|
|
585
|
+
(route) => route.fulfill({
|
|
586
|
+
status: 200,
|
|
587
|
+
contentType: "application/json",
|
|
588
|
+
body: JSON.stringify({ items: [], total: 0 })
|
|
589
|
+
})
|
|
590
|
+
);
|
|
591
|
+
await page.route(
|
|
592
|
+
"**/api/sbp/shop-info*",
|
|
593
|
+
(route) => route.fulfill({
|
|
594
|
+
status: 200,
|
|
595
|
+
contentType: "application/json",
|
|
596
|
+
body: JSON.stringify({ items: [], total: 0 })
|
|
597
|
+
})
|
|
598
|
+
);
|
|
599
|
+
await page.route(
|
|
600
|
+
"**/api/sbp/shop-info*",
|
|
601
|
+
(route) => route.fulfill({
|
|
602
|
+
status: 200,
|
|
603
|
+
contentType: "application/json",
|
|
604
|
+
body: process.env.SBP_SHOP_INFO_JSON ?? "{}"
|
|
605
|
+
})
|
|
606
|
+
);
|
|
607
|
+
await page.route(
|
|
608
|
+
"**/api/sbp/bookableplans*",
|
|
609
|
+
(route) => route.fulfill({
|
|
610
|
+
status: 200,
|
|
611
|
+
contentType: "application/json",
|
|
612
|
+
body: process.env.SBP_BOOKABLE_PLANS_JSON ?? "{}"
|
|
613
|
+
})
|
|
614
|
+
);
|
|
615
|
+
await page.route(
|
|
616
|
+
"**/api/sbp/nps/active-trigger",
|
|
617
|
+
(route) => route.fulfill({
|
|
618
|
+
status: 200,
|
|
619
|
+
contentType: "application/json",
|
|
620
|
+
body: '{"prompt":false,"trigger":["gone-live"]}'
|
|
621
|
+
})
|
|
622
|
+
);
|
|
604
623
|
}
|
|
605
624
|
|
|
606
625
|
const general$a = {
|
|
@@ -766,6 +785,7 @@ const types$1 = {
|
|
|
766
785
|
};
|
|
767
786
|
const detail$m = {
|
|
768
787
|
displayDocumentInMyAccount: "Display document in \"My account\"",
|
|
788
|
+
displayDocumentInMyAccountSwitch: "Document in \"My account\"",
|
|
769
789
|
save: "Save"
|
|
770
790
|
};
|
|
771
791
|
const administrationDocument = {
|
|
@@ -1949,6 +1969,7 @@ const types = {
|
|
|
1949
1969
|
};
|
|
1950
1970
|
const detail$a = {
|
|
1951
1971
|
displayDocumentInMyAccount: "Dokument in \"Mein Konto\" Bereich anzeigen",
|
|
1972
|
+
displayDocumentInMyAccountSwitch: "Dokument in \"Mein Konto\" Bereich",
|
|
1952
1973
|
save: "Speichern"
|
|
1953
1974
|
};
|
|
1954
1975
|
const deAdministrationDocument = {
|
|
@@ -3673,7 +3694,7 @@ const LanguageHelper$1 = {
|
|
|
3673
3694
|
translate: translate
|
|
3674
3695
|
};
|
|
3675
3696
|
|
|
3676
|
-
async function createNewAdminPageContext(
|
|
3697
|
+
async function createNewAdminPageContext(browser, SalesChannelBaseConfig) {
|
|
3677
3698
|
const context = await browser.newContext({
|
|
3678
3699
|
baseURL: SalesChannelBaseConfig.adminUrl,
|
|
3679
3700
|
serviceWorkers: "block"
|
|
@@ -3681,25 +3702,28 @@ async function createNewAdminPageContext(merchant, browser, SalesChannelBaseConf
|
|
|
3681
3702
|
const adminPage = await context.newPage();
|
|
3682
3703
|
await adminPage.goto("#/login");
|
|
3683
3704
|
await mockApiCalls(adminPage);
|
|
3705
|
+
return adminPage;
|
|
3706
|
+
}
|
|
3707
|
+
async function loginToAdministration(adminLoginPage, merchant, AdminApiContext) {
|
|
3684
3708
|
const usernamePattern = new RegExp(`${translate("administration:login:username")}|${translate("administration:login:emailAddress")}`);
|
|
3685
3709
|
const passwordLabel = translate("administration:login:password");
|
|
3686
|
-
await
|
|
3687
|
-
await
|
|
3710
|
+
await adminLoginPage.getByLabel(usernamePattern).fill(merchant.username);
|
|
3711
|
+
await adminLoginPage.getByLabel(passwordLabel, { exact: true }).fill(merchant.password);
|
|
3688
3712
|
const config = await (await AdminApiContext.get("./_info/config")).json();
|
|
3689
3713
|
const jsLoadingPromises = [];
|
|
3690
3714
|
for (const i in config.bundles) {
|
|
3691
3715
|
if (config.bundles[i]?.js && config.bundles[i]?.js?.length) {
|
|
3692
3716
|
const js = config?.bundles[i]?.js ?? [];
|
|
3693
|
-
jsLoadingPromises.push(...js.map((url) =>
|
|
3717
|
+
jsLoadingPromises.push(...js.map((url) => adminLoginPage.waitForResponse(url)));
|
|
3694
3718
|
}
|
|
3695
3719
|
}
|
|
3696
3720
|
const loginButtonLabel = translate("administration:login:loginButton");
|
|
3697
|
-
await
|
|
3721
|
+
await adminLoginPage.getByRole("button", { name: loginButtonLabel, exact: true }).click();
|
|
3698
3722
|
await Promise.all(jsLoadingPromises);
|
|
3699
|
-
const originalReload =
|
|
3700
|
-
|
|
3723
|
+
const originalReload = adminLoginPage.reload.bind(adminLoginPage);
|
|
3724
|
+
adminLoginPage.reload = async () => {
|
|
3701
3725
|
const res = await originalReload();
|
|
3702
|
-
await
|
|
3726
|
+
await adminLoginPage.addStyleTag({
|
|
3703
3727
|
content: `
|
|
3704
3728
|
.sf-toolbar {
|
|
3705
3729
|
width: 0 !important;
|
|
@@ -3712,12 +3736,12 @@ async function createNewAdminPageContext(merchant, browser, SalesChannelBaseConf
|
|
|
3712
3736
|
return res;
|
|
3713
3737
|
};
|
|
3714
3738
|
await clearDelayedCache(AdminApiContext);
|
|
3715
|
-
await expect(
|
|
3716
|
-
await
|
|
3739
|
+
await expect(adminLoginPage.locator(".sw-skeleton")).toHaveCount(0);
|
|
3740
|
+
await adminLoginPage.waitForURL((url) => {
|
|
3717
3741
|
return url.hash !== "#login";
|
|
3718
3742
|
});
|
|
3719
|
-
await expect(
|
|
3720
|
-
return
|
|
3743
|
+
await expect(adminLoginPage.getByText(merchant.firstName + " " + merchant.lastName).first()).toBeVisible({ timeout: 6e4 });
|
|
3744
|
+
return adminLoginPage;
|
|
3721
3745
|
}
|
|
3722
3746
|
|
|
3723
3747
|
const test$b = test$e.extend({
|
|
@@ -3740,7 +3764,11 @@ const test$b = test$e.extend({
|
|
|
3740
3764
|
data: adminUser
|
|
3741
3765
|
});
|
|
3742
3766
|
expect(response.ok()).toBeTruthy();
|
|
3743
|
-
const page = await
|
|
3767
|
+
const page = await loginToAdministration(
|
|
3768
|
+
await createNewAdminPageContext(browser, SalesChannelBaseConfig),
|
|
3769
|
+
adminUser,
|
|
3770
|
+
AdminApiContext
|
|
3771
|
+
);
|
|
3744
3772
|
LanguageHelper.setForContext(page.context(), languageHelper);
|
|
3745
3773
|
setCurrentContext(page.context());
|
|
3746
3774
|
await use(page);
|
|
@@ -6383,7 +6411,6 @@ class IdProvider {
|
|
|
6383
6411
|
|
|
6384
6412
|
const test$8 = test$e.extend({
|
|
6385
6413
|
IdProvider: [
|
|
6386
|
-
// eslint-disable-next-line no-empty-pattern
|
|
6387
6414
|
async ({}, use, workerInfo) => {
|
|
6388
6415
|
const seed = process.env.SHOPWARE_ACCESS_KEY_ID || process.env.SHOPWARE_ADMIN_PASSWORD || "test-suite";
|
|
6389
6416
|
const idProvider = new IdProvider(workerInfo.parallelIndex, seed);
|
|
@@ -6433,7 +6460,6 @@ const test$8 = test$e.extend({
|
|
|
6433
6460
|
{ scope: "worker" }
|
|
6434
6461
|
],
|
|
6435
6462
|
CustomTranslationResources: [
|
|
6436
|
-
// eslint-disable-next-line no-empty-pattern
|
|
6437
6463
|
async ({}, use) => {
|
|
6438
6464
|
await use(void 0);
|
|
6439
6465
|
},
|
|
@@ -9816,13 +9842,16 @@ class DocumentListing {
|
|
|
9816
9842
|
}
|
|
9817
9843
|
|
|
9818
9844
|
class DocumentDetail {
|
|
9845
|
+
/** @deprecated - Use 'displayDocumentInMyAccountSwitch' instead. */
|
|
9819
9846
|
showInAccountSwitch;
|
|
9847
|
+
displayDocumentInMyAccountSwitch;
|
|
9820
9848
|
saveButton;
|
|
9821
9849
|
documentTypeSelect;
|
|
9822
9850
|
page;
|
|
9823
9851
|
constructor(page) {
|
|
9824
9852
|
this.page = page;
|
|
9825
9853
|
this.showInAccountSwitch = page.getByRole("checkbox", { name: translate("administration:document:detail.displayDocumentInMyAccount") });
|
|
9854
|
+
this.displayDocumentInMyAccountSwitch = page.getByRole("checkbox", { name: translate("administration:document:detail.displayDocumentInMyAccountSwitch") });
|
|
9826
9855
|
this.saveButton = page.getByRole("button", { name: translate("administration:document:detail.save") });
|
|
9827
9856
|
this.documentTypeSelect = page.locator(".sw-settings-document-detail__select-type");
|
|
9828
9857
|
}
|
|
@@ -10606,9 +10635,11 @@ const CategoryData = test$e.extend({
|
|
|
10606
10635
|
productAssignmentType: "product",
|
|
10607
10636
|
visible: true,
|
|
10608
10637
|
active: true,
|
|
10609
|
-
products: [
|
|
10610
|
-
|
|
10611
|
-
|
|
10638
|
+
products: [
|
|
10639
|
+
{
|
|
10640
|
+
id: ProductData.id
|
|
10641
|
+
}
|
|
10642
|
+
]
|
|
10612
10643
|
}
|
|
10613
10644
|
});
|
|
10614
10645
|
expect(categoryResponse.ok()).toBeTruthy();
|
|
@@ -10654,11 +10685,13 @@ const DigitalProductData = test$e.extend({
|
|
|
10654
10685
|
const orderSearchResponse = await AdminApiContext.post("./search/order", {
|
|
10655
10686
|
data: {
|
|
10656
10687
|
limit: 10,
|
|
10657
|
-
filter: [
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10688
|
+
filter: [
|
|
10689
|
+
{
|
|
10690
|
+
type: "equals",
|
|
10691
|
+
field: "lineItems.productId",
|
|
10692
|
+
value: ProductData.id
|
|
10693
|
+
}
|
|
10694
|
+
]
|
|
10662
10695
|
}
|
|
10663
10696
|
});
|
|
10664
10697
|
expect(orderSearchResponse.ok()).toBeTruthy();
|
|
@@ -10682,16 +10715,20 @@ const PropertiesData = test$e.extend({
|
|
|
10682
10715
|
description: "Color",
|
|
10683
10716
|
displayType: "color",
|
|
10684
10717
|
sortingType: "name",
|
|
10685
|
-
options: [
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10718
|
+
options: [
|
|
10719
|
+
{
|
|
10720
|
+
name: "Blue",
|
|
10721
|
+
colorHexCode: "#2148d6"
|
|
10722
|
+
},
|
|
10723
|
+
{
|
|
10724
|
+
name: "Red",
|
|
10725
|
+
colorHexCode: "#bf0f2a"
|
|
10726
|
+
},
|
|
10727
|
+
{
|
|
10728
|
+
name: "Green",
|
|
10729
|
+
colorHexCode: "#12bf0f"
|
|
10730
|
+
}
|
|
10731
|
+
]
|
|
10695
10732
|
}
|
|
10696
10733
|
});
|
|
10697
10734
|
const propertyGroupSizeResponse = await AdminApiContext.post("property-group?_response=1", {
|
|
@@ -10700,13 +10737,17 @@ const PropertiesData = test$e.extend({
|
|
|
10700
10737
|
description: "Size",
|
|
10701
10738
|
displayType: "text",
|
|
10702
10739
|
sortingType: "name",
|
|
10703
|
-
options: [
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10740
|
+
options: [
|
|
10741
|
+
{
|
|
10742
|
+
name: "Small"
|
|
10743
|
+
},
|
|
10744
|
+
{
|
|
10745
|
+
name: "Medium"
|
|
10746
|
+
},
|
|
10747
|
+
{
|
|
10748
|
+
name: "Large"
|
|
10749
|
+
}
|
|
10750
|
+
]
|
|
10710
10751
|
}
|
|
10711
10752
|
});
|
|
10712
10753
|
expect(propertyGroupColorResponse.ok()).toBeTruthy();
|
|
@@ -11076,17 +11117,7 @@ const TagData = test$e.extend({
|
|
|
11076
11117
|
}
|
|
11077
11118
|
});
|
|
11078
11119
|
|
|
11079
|
-
const test$5 = mergeTests(
|
|
11080
|
-
ProductData,
|
|
11081
|
-
CategoryData,
|
|
11082
|
-
DigitalProductData,
|
|
11083
|
-
CartWithProductData,
|
|
11084
|
-
PromotionWithCodeData,
|
|
11085
|
-
PropertiesData,
|
|
11086
|
-
MediaData,
|
|
11087
|
-
OrderData,
|
|
11088
|
-
TagData
|
|
11089
|
-
);
|
|
11120
|
+
const test$5 = mergeTests(ProductData, CategoryData, DigitalProductData, CartWithProductData, PromotionWithCodeData, PropertiesData, MediaData, OrderData, TagData);
|
|
11090
11121
|
|
|
11091
11122
|
const SaveProduct = test$e.extend({
|
|
11092
11123
|
SaveProduct: async ({ ShopAdmin, AdminProductDetail }, use) => {
|
|
@@ -11501,7 +11532,11 @@ const CheckVisibilityOfServicesBanner = test$e.extend({
|
|
|
11501
11532
|
const task = (customUser) => {
|
|
11502
11533
|
return async function CheckVisibilityOfServicesBanner2() {
|
|
11503
11534
|
const user = customUser ? customUser : await TestDataService.createUser();
|
|
11504
|
-
const adminPage = await
|
|
11535
|
+
const adminPage = await loginToAdministration(
|
|
11536
|
+
await createNewAdminPageContext(browser, SalesChannelBaseConfig),
|
|
11537
|
+
user,
|
|
11538
|
+
TestDataService.AdminApiClient
|
|
11539
|
+
);
|
|
11505
11540
|
const shopwareServicesAdvertisementBanner = adminPage.locator(".sw-settings-services-dashboard-banner__content").first();
|
|
11506
11541
|
await expect(shopwareServicesAdvertisementBanner).toBeVisible();
|
|
11507
11542
|
};
|
|
@@ -11521,7 +11556,11 @@ const CheckAccessToShopwareServices = test$e.extend({
|
|
|
11521
11556
|
user = await TestDataService.getUserById(customUser.id);
|
|
11522
11557
|
user.password = customUser.password;
|
|
11523
11558
|
}
|
|
11524
|
-
const adminPage = await
|
|
11559
|
+
const adminPage = await loginToAdministration(
|
|
11560
|
+
await createNewAdminPageContext(browser, SalesChannelBaseConfig),
|
|
11561
|
+
user,
|
|
11562
|
+
TestDataService.AdminApiClient
|
|
11563
|
+
);
|
|
11525
11564
|
const shopwareServicesAdvertisementBanner = adminPage.locator(".sw-settings-services-dashboard-banner__content").first();
|
|
11526
11565
|
const shopwareServicesExploreNowButton = shopwareServicesAdvertisementBanner.getByRole("button", {
|
|
11527
11566
|
name: translate("administration:shopwareServices:buttons.exploreNow")
|
|
@@ -11670,11 +11709,13 @@ const RegisterGuest = test$e.extend({
|
|
|
11670
11709
|
const customerResponse = await AdminApiContext.post("search/customer", {
|
|
11671
11710
|
data: {
|
|
11672
11711
|
limit: 1,
|
|
11673
|
-
filter: [
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11712
|
+
filter: [
|
|
11713
|
+
{
|
|
11714
|
+
type: "equals",
|
|
11715
|
+
field: "email",
|
|
11716
|
+
value: registrationData.email
|
|
11717
|
+
}
|
|
11718
|
+
]
|
|
11678
11719
|
}
|
|
11679
11720
|
});
|
|
11680
11721
|
expect(customerResponse.ok()).toBeTruthy();
|
|
@@ -11750,10 +11791,7 @@ const ProceedFromProductToCheckout = test$e.extend({
|
|
|
11750
11791
|
});
|
|
11751
11792
|
|
|
11752
11793
|
const CloseTheOffCanvasCart = test$e.extend({
|
|
11753
|
-
CloseTheOffCanvasCart: async ({
|
|
11754
|
-
ShopCustomer,
|
|
11755
|
-
StorefrontOffCanvasCart
|
|
11756
|
-
}, use) => {
|
|
11794
|
+
CloseTheOffCanvasCart: async ({ ShopCustomer, StorefrontOffCanvasCart }, use) => {
|
|
11757
11795
|
const task = () => {
|
|
11758
11796
|
return async function CloseTheOffCanvasCart2() {
|
|
11759
11797
|
await ShopCustomer.presses(StorefrontOffCanvasCart.continueShoppingButton);
|
|
@@ -11765,11 +11803,7 @@ const CloseTheOffCanvasCart = test$e.extend({
|
|
|
11765
11803
|
});
|
|
11766
11804
|
|
|
11767
11805
|
const ProceedFromCartToCheckout = test$e.extend({
|
|
11768
|
-
ProceedFromCartToCheckout: async ({
|
|
11769
|
-
ShopCustomer,
|
|
11770
|
-
StorefrontCheckoutCart,
|
|
11771
|
-
StorefrontCheckoutConfirm
|
|
11772
|
-
}, use) => {
|
|
11806
|
+
ProceedFromCartToCheckout: async ({ ShopCustomer, StorefrontCheckoutCart, StorefrontCheckoutConfirm }, use) => {
|
|
11773
11807
|
const task = () => {
|
|
11774
11808
|
return async function ProceedFromCartToCheckout2() {
|
|
11775
11809
|
await ShopCustomer.presses(StorefrontCheckoutCart.goToCheckoutButton);
|
|
@@ -11782,10 +11816,7 @@ const ProceedFromCartToCheckout = test$e.extend({
|
|
|
11782
11816
|
});
|
|
11783
11817
|
|
|
11784
11818
|
const ChangeProductQuantity = test$e.extend({
|
|
11785
|
-
ChangeProductQuantity: async ({
|
|
11786
|
-
ShopCustomer,
|
|
11787
|
-
StorefrontCheckoutCart
|
|
11788
|
-
}, use) => {
|
|
11819
|
+
ChangeProductQuantity: async ({ ShopCustomer, StorefrontCheckoutCart }, use) => {
|
|
11789
11820
|
const task = (quantity) => {
|
|
11790
11821
|
return async function ChangeProductQuantityOnCart() {
|
|
11791
11822
|
await StorefrontCheckoutCart.cartQuantityNumber.clear();
|
|
@@ -12340,35 +12371,38 @@ async function replaceElements(page, selectors, replaceWith = "***") {
|
|
|
12340
12371
|
selectors,
|
|
12341
12372
|
// String handler → replace text/value via querySelectorAll
|
|
12342
12373
|
async (page2, selectors2) => {
|
|
12343
|
-
await page2.evaluate(
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
12353
|
-
};
|
|
12354
|
-
const maskGeneric = (el) => {
|
|
12355
|
-
el.textContent = replaceWith2;
|
|
12356
|
-
if (el.isContentEditable) {
|
|
12374
|
+
await page2.evaluate(
|
|
12375
|
+
({ selectors: selectors3, replaceWith: replaceWith2 }) => {
|
|
12376
|
+
const maskInputLike = (el) => {
|
|
12377
|
+
el.value = replaceWith2;
|
|
12378
|
+
el.defaultValue = replaceWith2;
|
|
12379
|
+
el.setAttribute("value", replaceWith2);
|
|
12380
|
+
if ("placeholder" in el) {
|
|
12381
|
+
el.setAttribute("placeholder", replaceWith2);
|
|
12382
|
+
}
|
|
12357
12383
|
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
12358
12384
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
12359
|
-
}
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
maskInputLike(el);
|
|
12366
|
-
} else {
|
|
12367
|
-
maskGeneric(el);
|
|
12385
|
+
};
|
|
12386
|
+
const maskGeneric = (el) => {
|
|
12387
|
+
el.textContent = replaceWith2;
|
|
12388
|
+
if (el.isContentEditable) {
|
|
12389
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
12390
|
+
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
12368
12391
|
}
|
|
12392
|
+
};
|
|
12393
|
+
selectors3.forEach((sel) => {
|
|
12394
|
+
const elements = document.querySelectorAll(sel);
|
|
12395
|
+
elements.forEach((el) => {
|
|
12396
|
+
if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
|
|
12397
|
+
maskInputLike(el);
|
|
12398
|
+
} else {
|
|
12399
|
+
maskGeneric(el);
|
|
12400
|
+
}
|
|
12401
|
+
});
|
|
12369
12402
|
});
|
|
12370
|
-
}
|
|
12371
|
-
|
|
12403
|
+
},
|
|
12404
|
+
{ selectors: selectors2, replaceWith }
|
|
12405
|
+
);
|
|
12372
12406
|
},
|
|
12373
12407
|
// Locator handler → replace text/value directly
|
|
12374
12408
|
async (el) => {
|
|
@@ -12472,10 +12506,7 @@ async function setViewport(page, options = {}) {
|
|
|
12472
12506
|
const headerHandle = await header.elementHandle();
|
|
12473
12507
|
const scrollableHandle = await scrollableElementVertical.elementHandle();
|
|
12474
12508
|
if (headerHandle && scrollableHandle) {
|
|
12475
|
-
const isInside = await page.evaluate(
|
|
12476
|
-
([headerEl, containerEl]) => containerEl.contains(headerEl),
|
|
12477
|
-
[headerHandle, scrollableHandle]
|
|
12478
|
-
);
|
|
12509
|
+
const isInside = await page.evaluate(([headerEl, containerEl]) => containerEl.contains(headerEl), [headerHandle, scrollableHandle]);
|
|
12479
12510
|
if (!isInside) {
|
|
12480
12511
|
headerHeight = await header.evaluate((el) => el.offsetHeight);
|
|
12481
12512
|
}
|
|
@@ -12528,4 +12559,4 @@ const test = mergeTests(
|
|
|
12528
12559
|
test$3
|
|
12529
12560
|
);
|
|
12530
12561
|
|
|
12531
|
-
export { AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, compareFlowTemplateWithFlow, createRandomImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
|
|
12562
|
+
export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser };
|