@shopware-ag/acceptance-test-suite 2.3.0 → 2.3.1
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 +48 -27
- package/dist/index.d.ts +48 -27
- package/dist/index.mjs +287 -246
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -71,6 +71,31 @@ declare class StoreApiContext {
|
|
|
71
71
|
head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
interface ApiContextTypes {
|
|
75
|
+
AdminApiContext: AdminApiContext;
|
|
76
|
+
StoreApiContext: StoreApiContext;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface PageContextTypes {
|
|
80
|
+
AdminPage: Page;
|
|
81
|
+
StorefrontPage: Page;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare class Actor {
|
|
85
|
+
page: Page;
|
|
86
|
+
readonly name: string;
|
|
87
|
+
constructor(name: string, page: Page);
|
|
88
|
+
expects: _playwright_test.Expect<{}>;
|
|
89
|
+
attemptsTo(task: () => Promise<void>): Promise<void>;
|
|
90
|
+
goesTo(url: string): Promise<void>;
|
|
91
|
+
private camelCaseToLowerCase;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface ActorFixtureTypes {
|
|
95
|
+
ShopCustomer: Actor;
|
|
96
|
+
ShopAdmin: Actor;
|
|
97
|
+
}
|
|
98
|
+
|
|
74
99
|
interface IdPair {
|
|
75
100
|
id: string;
|
|
76
101
|
uuid: string;
|
|
@@ -169,7 +194,7 @@ type Promotion = components['schemas']['Promotion'] & {
|
|
|
169
194
|
|
|
170
195
|
interface CreatedRecord {
|
|
171
196
|
resource: string;
|
|
172
|
-
|
|
197
|
+
payload: Record<string, string>;
|
|
173
198
|
}
|
|
174
199
|
interface SimpleLineItem {
|
|
175
200
|
product: Product;
|
|
@@ -204,7 +229,25 @@ declare class TestDataService {
|
|
|
204
229
|
readonly defaultLanguageId: string;
|
|
205
230
|
readonly defaultCountryId: string;
|
|
206
231
|
readonly defaultCustomerGroupId: string;
|
|
232
|
+
/**
|
|
233
|
+
* Configures if an automated cleanup of the data should be executed.
|
|
234
|
+
*
|
|
235
|
+
* @private
|
|
236
|
+
*/
|
|
207
237
|
private shouldCleanUp;
|
|
238
|
+
/**
|
|
239
|
+
* Configuration of higher priority entities for the cleanup operation.
|
|
240
|
+
* These entities will be deleted before others.
|
|
241
|
+
* This will prevent restricted delete operations of associated entities.
|
|
242
|
+
*
|
|
243
|
+
* @private
|
|
244
|
+
*/
|
|
245
|
+
private highPriorityEntities;
|
|
246
|
+
/**
|
|
247
|
+
* A registry of all created records.
|
|
248
|
+
*
|
|
249
|
+
* @private
|
|
250
|
+
*/
|
|
208
251
|
private createdRecords;
|
|
209
252
|
constructor(AdminApiClient: AdminApiContext, IdProvider: IdProvider, options: DataServiceOptions);
|
|
210
253
|
/**
|
|
@@ -405,9 +448,9 @@ declare class TestDataService {
|
|
|
405
448
|
* All entities added to the registry will be deleted by the cleanup call.
|
|
406
449
|
*
|
|
407
450
|
* @param resource - The resource name of the entity.
|
|
408
|
-
* @param
|
|
451
|
+
* @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity.
|
|
409
452
|
*/
|
|
410
|
-
addCreatedRecord(resource: string,
|
|
453
|
+
addCreatedRecord(resource: string, payload: string | Record<string, string>): void;
|
|
411
454
|
/**
|
|
412
455
|
* Set the configuration of automated data clean up.
|
|
413
456
|
* If set to "true" the data service will delete all entities created by it.
|
|
@@ -480,32 +523,10 @@ declare class TestDataService {
|
|
|
480
523
|
getBasicPromotionStruct(salesChannelId?: string, overrides?: Partial<Promotion>): Partial<Promotion>;
|
|
481
524
|
}
|
|
482
525
|
|
|
483
|
-
interface
|
|
484
|
-
AdminApiContext: AdminApiContext;
|
|
485
|
-
StoreApiContext: StoreApiContext;
|
|
526
|
+
interface TestDataFixtureTypes {
|
|
486
527
|
TestDataService: TestDataService;
|
|
487
528
|
}
|
|
488
529
|
|
|
489
|
-
interface PageContextTypes {
|
|
490
|
-
AdminPage: Page;
|
|
491
|
-
StorefrontPage: Page;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
declare class Actor {
|
|
495
|
-
page: Page;
|
|
496
|
-
readonly name: string;
|
|
497
|
-
constructor(name: string, page: Page);
|
|
498
|
-
expects: _playwright_test.Expect<{}>;
|
|
499
|
-
attemptsTo(task: () => Promise<void>): Promise<void>;
|
|
500
|
-
goesTo(url: string): Promise<void>;
|
|
501
|
-
private camelCaseToLowerCase;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
interface ActorFixtureTypes {
|
|
505
|
-
ShopCustomer: Actor;
|
|
506
|
-
ShopAdmin: Actor;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
530
|
interface HelperFixtureTypes {
|
|
510
531
|
IdProvider: IdProvider;
|
|
511
532
|
SaaSInstanceSetup: () => Promise<void>;
|
|
@@ -972,7 +993,7 @@ interface DataFixtureTypes {
|
|
|
972
993
|
TagData: components['schemas']['Tag'];
|
|
973
994
|
}
|
|
974
995
|
|
|
975
|
-
interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
|
|
996
|
+
interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, TestDataFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
|
|
976
997
|
}
|
|
977
998
|
|
|
978
999
|
declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,31 @@ declare class StoreApiContext {
|
|
|
71
71
|
head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
interface ApiContextTypes {
|
|
75
|
+
AdminApiContext: AdminApiContext;
|
|
76
|
+
StoreApiContext: StoreApiContext;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface PageContextTypes {
|
|
80
|
+
AdminPage: Page;
|
|
81
|
+
StorefrontPage: Page;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare class Actor {
|
|
85
|
+
page: Page;
|
|
86
|
+
readonly name: string;
|
|
87
|
+
constructor(name: string, page: Page);
|
|
88
|
+
expects: _playwright_test.Expect<{}>;
|
|
89
|
+
attemptsTo(task: () => Promise<void>): Promise<void>;
|
|
90
|
+
goesTo(url: string): Promise<void>;
|
|
91
|
+
private camelCaseToLowerCase;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface ActorFixtureTypes {
|
|
95
|
+
ShopCustomer: Actor;
|
|
96
|
+
ShopAdmin: Actor;
|
|
97
|
+
}
|
|
98
|
+
|
|
74
99
|
interface IdPair {
|
|
75
100
|
id: string;
|
|
76
101
|
uuid: string;
|
|
@@ -169,7 +194,7 @@ type Promotion = components['schemas']['Promotion'] & {
|
|
|
169
194
|
|
|
170
195
|
interface CreatedRecord {
|
|
171
196
|
resource: string;
|
|
172
|
-
|
|
197
|
+
payload: Record<string, string>;
|
|
173
198
|
}
|
|
174
199
|
interface SimpleLineItem {
|
|
175
200
|
product: Product;
|
|
@@ -204,7 +229,25 @@ declare class TestDataService {
|
|
|
204
229
|
readonly defaultLanguageId: string;
|
|
205
230
|
readonly defaultCountryId: string;
|
|
206
231
|
readonly defaultCustomerGroupId: string;
|
|
232
|
+
/**
|
|
233
|
+
* Configures if an automated cleanup of the data should be executed.
|
|
234
|
+
*
|
|
235
|
+
* @private
|
|
236
|
+
*/
|
|
207
237
|
private shouldCleanUp;
|
|
238
|
+
/**
|
|
239
|
+
* Configuration of higher priority entities for the cleanup operation.
|
|
240
|
+
* These entities will be deleted before others.
|
|
241
|
+
* This will prevent restricted delete operations of associated entities.
|
|
242
|
+
*
|
|
243
|
+
* @private
|
|
244
|
+
*/
|
|
245
|
+
private highPriorityEntities;
|
|
246
|
+
/**
|
|
247
|
+
* A registry of all created records.
|
|
248
|
+
*
|
|
249
|
+
* @private
|
|
250
|
+
*/
|
|
208
251
|
private createdRecords;
|
|
209
252
|
constructor(AdminApiClient: AdminApiContext, IdProvider: IdProvider, options: DataServiceOptions);
|
|
210
253
|
/**
|
|
@@ -405,9 +448,9 @@ declare class TestDataService {
|
|
|
405
448
|
* All entities added to the registry will be deleted by the cleanup call.
|
|
406
449
|
*
|
|
407
450
|
* @param resource - The resource name of the entity.
|
|
408
|
-
* @param
|
|
451
|
+
* @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity.
|
|
409
452
|
*/
|
|
410
|
-
addCreatedRecord(resource: string,
|
|
453
|
+
addCreatedRecord(resource: string, payload: string | Record<string, string>): void;
|
|
411
454
|
/**
|
|
412
455
|
* Set the configuration of automated data clean up.
|
|
413
456
|
* If set to "true" the data service will delete all entities created by it.
|
|
@@ -480,32 +523,10 @@ declare class TestDataService {
|
|
|
480
523
|
getBasicPromotionStruct(salesChannelId?: string, overrides?: Partial<Promotion>): Partial<Promotion>;
|
|
481
524
|
}
|
|
482
525
|
|
|
483
|
-
interface
|
|
484
|
-
AdminApiContext: AdminApiContext;
|
|
485
|
-
StoreApiContext: StoreApiContext;
|
|
526
|
+
interface TestDataFixtureTypes {
|
|
486
527
|
TestDataService: TestDataService;
|
|
487
528
|
}
|
|
488
529
|
|
|
489
|
-
interface PageContextTypes {
|
|
490
|
-
AdminPage: Page;
|
|
491
|
-
StorefrontPage: Page;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
declare class Actor {
|
|
495
|
-
page: Page;
|
|
496
|
-
readonly name: string;
|
|
497
|
-
constructor(name: string, page: Page);
|
|
498
|
-
expects: _playwright_test.Expect<{}>;
|
|
499
|
-
attemptsTo(task: () => Promise<void>): Promise<void>;
|
|
500
|
-
goesTo(url: string): Promise<void>;
|
|
501
|
-
private camelCaseToLowerCase;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
interface ActorFixtureTypes {
|
|
505
|
-
ShopCustomer: Actor;
|
|
506
|
-
ShopAdmin: Actor;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
530
|
interface HelperFixtureTypes {
|
|
510
531
|
IdProvider: IdProvider;
|
|
511
532
|
SaaSInstanceSetup: () => Promise<void>;
|
|
@@ -972,7 +993,7 @@ interface DataFixtureTypes {
|
|
|
972
993
|
TagData: components['schemas']['Tag'];
|
|
973
994
|
}
|
|
974
995
|
|
|
975
|
-
interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
|
|
996
|
+
interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, TestDataFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
|
|
976
997
|
}
|
|
977
998
|
|
|
978
999
|
declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<{
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { test as test$
|
|
1
|
+
import { test as test$d, expect, request, mergeTests } from '@playwright/test';
|
|
2
2
|
export * from '@playwright/test';
|
|
3
3
|
import { Image } from 'image-js';
|
|
4
4
|
import crypto from 'crypto';
|
|
@@ -217,7 +217,7 @@ const isThemeCompiled = async (page) => {
|
|
|
217
217
|
return allCSSFound;
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
-
const test$
|
|
220
|
+
const test$b = test$d.extend({
|
|
221
221
|
SalesChannelBaseConfig: [
|
|
222
222
|
async ({ AdminApiContext }, use) => {
|
|
223
223
|
const requests = {
|
|
@@ -413,7 +413,7 @@ const test$a = test$c.extend({
|
|
|
413
413
|
});
|
|
414
414
|
const tmpPage = await tmpContext.newPage();
|
|
415
415
|
if (!await isThemeCompiled(tmpPage)) {
|
|
416
|
-
test$
|
|
416
|
+
test$d.slow();
|
|
417
417
|
await AdminApiContext.post(
|
|
418
418
|
`./_action/theme/${SalesChannelBaseConfig.defaultThemeId}/assign/${uuid}`
|
|
419
419
|
);
|
|
@@ -616,6 +616,177 @@ __publicField$r(_StoreApiContext, "defaultOptions", {
|
|
|
616
616
|
});
|
|
617
617
|
let StoreApiContext = _StoreApiContext;
|
|
618
618
|
|
|
619
|
+
const test$a = test$d.extend({
|
|
620
|
+
AdminApiContext: [
|
|
621
|
+
async ({}, use) => {
|
|
622
|
+
const adminApiContext = await AdminApiContext.create();
|
|
623
|
+
await use(adminApiContext);
|
|
624
|
+
},
|
|
625
|
+
{ scope: "worker" }
|
|
626
|
+
],
|
|
627
|
+
StoreApiContext: [
|
|
628
|
+
async ({ DefaultSalesChannel }, use) => {
|
|
629
|
+
const options = {
|
|
630
|
+
app_url: process.env["APP_URL"],
|
|
631
|
+
"sw-access-key": DefaultSalesChannel.salesChannel.accessKey,
|
|
632
|
+
ignoreHTTPSErrors: true
|
|
633
|
+
};
|
|
634
|
+
const storeApiContext = await StoreApiContext.create(options);
|
|
635
|
+
await use(storeApiContext);
|
|
636
|
+
},
|
|
637
|
+
{ scope: "worker" }
|
|
638
|
+
]
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
async function mockApiCalls(page) {
|
|
642
|
+
await page.route("**/api/notification/message*", (route) => route.fulfill({
|
|
643
|
+
status: 200,
|
|
644
|
+
contentType: "application/json",
|
|
645
|
+
body: JSON.stringify({ notifications: [], timestamp: "2024-06-19 06:23:25.040" })
|
|
646
|
+
}));
|
|
647
|
+
await page.route("**/api/_action/store/plugin/search*", (route) => route.fulfill({
|
|
648
|
+
status: 200,
|
|
649
|
+
contentType: "application/json",
|
|
650
|
+
body: JSON.stringify({ items: [], total: 0 })
|
|
651
|
+
}));
|
|
652
|
+
await page.route("**/api/_action/store/updates*", (route) => route.fulfill({
|
|
653
|
+
status: 200,
|
|
654
|
+
contentType: "application/json",
|
|
655
|
+
body: JSON.stringify({ items: [], total: 0 })
|
|
656
|
+
}));
|
|
657
|
+
await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
|
|
658
|
+
status: 200,
|
|
659
|
+
contentType: "application/json",
|
|
660
|
+
body: JSON.stringify({ items: [], total: 0 })
|
|
661
|
+
}));
|
|
662
|
+
await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
|
|
663
|
+
status: 200,
|
|
664
|
+
contentType: "application/json",
|
|
665
|
+
body: process.env.SBP_SHOP_INFO_JSON ?? "{}"
|
|
666
|
+
}));
|
|
667
|
+
await page.route("**/api/sbp/bookableplans*", (route) => route.fulfill({
|
|
668
|
+
status: 200,
|
|
669
|
+
contentType: "application/json",
|
|
670
|
+
body: process.env.SBP_BOOKABLE_PLANS_JSON ?? "{}"
|
|
671
|
+
}));
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
const test$9 = test$d.extend({
|
|
675
|
+
AdminPage: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, browser }, use) => {
|
|
676
|
+
const context = await browser.newContext({
|
|
677
|
+
baseURL: SalesChannelBaseConfig.adminUrl,
|
|
678
|
+
serviceWorkers: "block"
|
|
679
|
+
});
|
|
680
|
+
const page = await context.newPage();
|
|
681
|
+
await mockApiCalls(page);
|
|
682
|
+
const { id, uuid } = IdProvider.getIdPair();
|
|
683
|
+
const adminUser = {
|
|
684
|
+
id: uuid,
|
|
685
|
+
username: `admin_${id}`,
|
|
686
|
+
firstName: `${id} admin`,
|
|
687
|
+
lastName: `${id} admin`,
|
|
688
|
+
localeId: SalesChannelBaseConfig.enGBLocaleId,
|
|
689
|
+
email: `admin_${id}@example.com`,
|
|
690
|
+
timezone: "Europe/Berlin",
|
|
691
|
+
password: "shopware",
|
|
692
|
+
admin: true
|
|
693
|
+
};
|
|
694
|
+
const response = await AdminApiContext.post("user", {
|
|
695
|
+
data: adminUser
|
|
696
|
+
});
|
|
697
|
+
expect(response.ok()).toBeTruthy();
|
|
698
|
+
await page.goto("#/login");
|
|
699
|
+
await page.addStyleTag({
|
|
700
|
+
content: `
|
|
701
|
+
.sf-toolbar {
|
|
702
|
+
width: 0 !important;
|
|
703
|
+
height: 0 !important;
|
|
704
|
+
display: none !important;
|
|
705
|
+
pointer-events: none !important;
|
|
706
|
+
}
|
|
707
|
+
`.trim()
|
|
708
|
+
});
|
|
709
|
+
await page.getByLabel(/Username|Email address/).fill(adminUser.username);
|
|
710
|
+
await page.getByLabel("Password").fill(adminUser.password);
|
|
711
|
+
await page.getByRole("button", { name: "Log in" }).click();
|
|
712
|
+
await expect(page.locator("css=.sw-admin-menu__header-logo").first()).toBeVisible({
|
|
713
|
+
timeout: 2e4
|
|
714
|
+
});
|
|
715
|
+
await expect(page.locator(".sw-skeleton")).toHaveCount(0, {
|
|
716
|
+
timeout: 1e4
|
|
717
|
+
});
|
|
718
|
+
await expect(page.locator(".sw-loader")).toHaveCount(0, {
|
|
719
|
+
timeout: 1e4
|
|
720
|
+
});
|
|
721
|
+
await use(page);
|
|
722
|
+
await page.close();
|
|
723
|
+
await context.close();
|
|
724
|
+
const cleanupResponse = await AdminApiContext.delete(`user/${uuid}`);
|
|
725
|
+
expect(cleanupResponse.ok()).toBeTruthy();
|
|
726
|
+
},
|
|
727
|
+
StorefrontPage: async ({ DefaultStorefront, browser }, use) => {
|
|
728
|
+
const { url } = DefaultStorefront;
|
|
729
|
+
const context = await browser.newContext({
|
|
730
|
+
baseURL: url
|
|
731
|
+
});
|
|
732
|
+
const page = await context.newPage();
|
|
733
|
+
await page.goto("./", { waitUntil: "load" });
|
|
734
|
+
await use(page);
|
|
735
|
+
await page.close();
|
|
736
|
+
await context.close();
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
var __defProp$q = Object.defineProperty;
|
|
741
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
742
|
+
var __publicField$q = (obj, key, value) => {
|
|
743
|
+
__defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
744
|
+
return value;
|
|
745
|
+
};
|
|
746
|
+
class Actor {
|
|
747
|
+
constructor(name, page) {
|
|
748
|
+
__publicField$q(this, "page");
|
|
749
|
+
__publicField$q(this, "name");
|
|
750
|
+
__publicField$q(this, "expects", expect);
|
|
751
|
+
this.name = name;
|
|
752
|
+
this.page = page;
|
|
753
|
+
}
|
|
754
|
+
async attemptsTo(task) {
|
|
755
|
+
const stepTitle = `${this.name} attempts to ${this.camelCaseToLowerCase(task.name)}`;
|
|
756
|
+
await test$d.step(stepTitle, async () => await task());
|
|
757
|
+
}
|
|
758
|
+
async goesTo(url) {
|
|
759
|
+
const stepTitle = `${this.name} navigates to "${url}"`;
|
|
760
|
+
await test$d.step(stepTitle, async () => {
|
|
761
|
+
await this.page.goto(url);
|
|
762
|
+
await this.page.addStyleTag({
|
|
763
|
+
content: `
|
|
764
|
+
.sf-toolbar {
|
|
765
|
+
width: 0 !important;
|
|
766
|
+
height: 0 !important;
|
|
767
|
+
display: none !important;
|
|
768
|
+
pointer-events: none !important;
|
|
769
|
+
}
|
|
770
|
+
`.trim()
|
|
771
|
+
});
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
camelCaseToLowerCase(str) {
|
|
775
|
+
return str.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
const test$8 = test$d.extend({
|
|
780
|
+
ShopCustomer: async ({ StorefrontPage }, use) => {
|
|
781
|
+
const shopCustomer = new Actor("Shop customer", StorefrontPage);
|
|
782
|
+
await use(shopCustomer);
|
|
783
|
+
},
|
|
784
|
+
ShopAdmin: async ({ AdminPage }, use) => {
|
|
785
|
+
const shopAdmin = new Actor("Shop administrator", AdminPage);
|
|
786
|
+
await use(shopAdmin);
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
|
|
619
790
|
function createRandomImage(width = 800, height = 600) {
|
|
620
791
|
const buffer = Buffer.alloc(width * height * 4);
|
|
621
792
|
let i = 0;
|
|
@@ -625,27 +796,45 @@ function createRandomImage(width = 800, height = 600) {
|
|
|
625
796
|
return new Image(width, height, buffer);
|
|
626
797
|
}
|
|
627
798
|
|
|
628
|
-
var __defProp$
|
|
629
|
-
var __defNormalProp$
|
|
630
|
-
var __publicField$
|
|
631
|
-
__defNormalProp$
|
|
799
|
+
var __defProp$p = Object.defineProperty;
|
|
800
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
801
|
+
var __publicField$p = (obj, key, value) => {
|
|
802
|
+
__defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
632
803
|
return value;
|
|
633
804
|
};
|
|
634
805
|
class TestDataService {
|
|
635
806
|
constructor(AdminApiClient, IdProvider, options) {
|
|
636
|
-
__publicField$
|
|
637
|
-
__publicField$
|
|
638
|
-
__publicField$
|
|
639
|
-
__publicField$
|
|
640
|
-
__publicField$
|
|
641
|
-
__publicField$
|
|
642
|
-
__publicField$
|
|
643
|
-
__publicField$
|
|
644
|
-
__publicField$
|
|
645
|
-
__publicField$
|
|
646
|
-
__publicField$
|
|
647
|
-
|
|
648
|
-
|
|
807
|
+
__publicField$p(this, "AdminApiClient");
|
|
808
|
+
__publicField$p(this, "IdProvider");
|
|
809
|
+
__publicField$p(this, "namePrefix", "Test-");
|
|
810
|
+
__publicField$p(this, "nameSuffix", "");
|
|
811
|
+
__publicField$p(this, "defaultSalesChannel");
|
|
812
|
+
__publicField$p(this, "defaultTaxId");
|
|
813
|
+
__publicField$p(this, "defaultCurrencyId");
|
|
814
|
+
__publicField$p(this, "defaultCategoryId");
|
|
815
|
+
__publicField$p(this, "defaultLanguageId");
|
|
816
|
+
__publicField$p(this, "defaultCountryId");
|
|
817
|
+
__publicField$p(this, "defaultCustomerGroupId");
|
|
818
|
+
/**
|
|
819
|
+
* Configures if an automated cleanup of the data should be executed.
|
|
820
|
+
*
|
|
821
|
+
* @private
|
|
822
|
+
*/
|
|
823
|
+
__publicField$p(this, "shouldCleanUp", true);
|
|
824
|
+
/**
|
|
825
|
+
* Configuration of higher priority entities for the cleanup operation.
|
|
826
|
+
* These entities will be deleted before others.
|
|
827
|
+
* This will prevent restricted delete operations of associated entities.
|
|
828
|
+
*
|
|
829
|
+
* @private
|
|
830
|
+
*/
|
|
831
|
+
__publicField$p(this, "highPriorityEntities", ["order", "product"]);
|
|
832
|
+
/**
|
|
833
|
+
* A registry of all created records.
|
|
834
|
+
*
|
|
835
|
+
* @private
|
|
836
|
+
*/
|
|
837
|
+
__publicField$p(this, "createdRecords", []);
|
|
649
838
|
this.AdminApiClient = AdminApiClient;
|
|
650
839
|
this.IdProvider = IdProvider;
|
|
651
840
|
this.defaultSalesChannel = options.defaultSalesChannel;
|
|
@@ -711,8 +900,7 @@ class TestDataService {
|
|
|
711
900
|
async createDigitalProduct(content = "Lorem ipsum dolor", overrides = {}, taxId = this.defaultTaxId, currencyId = this.defaultCurrencyId) {
|
|
712
901
|
const product = await this.createBasicProduct(overrides, taxId, currencyId);
|
|
713
902
|
const media = await this.createMediaTXT(content);
|
|
714
|
-
|
|
715
|
-
this.addCreatedRecord("product-download", productDownload.id);
|
|
903
|
+
await this.assignProductDownload(product.id, media.id);
|
|
716
904
|
return product;
|
|
717
905
|
}
|
|
718
906
|
/**
|
|
@@ -822,7 +1010,7 @@ class TestDataService {
|
|
|
822
1010
|
data: Object.assign({}, colorPropertyGroup, overrides)
|
|
823
1011
|
});
|
|
824
1012
|
const { data: propertyGroup } = await propertyGroupResponse.json();
|
|
825
|
-
this.addCreatedRecord("
|
|
1013
|
+
this.addCreatedRecord("property_group", propertyGroup.id);
|
|
826
1014
|
return propertyGroup;
|
|
827
1015
|
}
|
|
828
1016
|
/**
|
|
@@ -849,7 +1037,7 @@ class TestDataService {
|
|
|
849
1037
|
data: Object.assign({}, textPropertyGroup, overrides)
|
|
850
1038
|
});
|
|
851
1039
|
const { data: propertyGroup } = await propertyGroupResponse.json();
|
|
852
|
-
this.addCreatedRecord("
|
|
1040
|
+
this.addCreatedRecord("property_group", propertyGroup.id);
|
|
853
1041
|
return propertyGroup;
|
|
854
1042
|
}
|
|
855
1043
|
/**
|
|
@@ -1190,10 +1378,18 @@ class TestDataService {
|
|
|
1190
1378
|
* All entities added to the registry will be deleted by the cleanup call.
|
|
1191
1379
|
*
|
|
1192
1380
|
* @param resource - The resource name of the entity.
|
|
1193
|
-
* @param
|
|
1381
|
+
* @param payload - You can pass a payload object for the delete operation or simply pass the uuid of the entity.
|
|
1194
1382
|
*/
|
|
1195
|
-
addCreatedRecord(resource,
|
|
1196
|
-
|
|
1383
|
+
addCreatedRecord(resource, payload) {
|
|
1384
|
+
const res = resource.replace("-", "_");
|
|
1385
|
+
if (typeof payload === "string") {
|
|
1386
|
+
this.createdRecords.push({
|
|
1387
|
+
resource: res,
|
|
1388
|
+
payload: { id: payload }
|
|
1389
|
+
});
|
|
1390
|
+
} else {
|
|
1391
|
+
this.createdRecords.push({ resource: res, payload });
|
|
1392
|
+
}
|
|
1197
1393
|
}
|
|
1198
1394
|
/**
|
|
1199
1395
|
* Set the configuration of automated data clean up.
|
|
@@ -1211,16 +1407,31 @@ class TestDataService {
|
|
|
1211
1407
|
if (!this.shouldCleanUp) {
|
|
1212
1408
|
return Promise.reject();
|
|
1213
1409
|
}
|
|
1410
|
+
const priorityDeleteOperations = {};
|
|
1214
1411
|
const deleteOperations = {};
|
|
1215
1412
|
this.createdRecords.forEach((record) => {
|
|
1216
|
-
if (
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1413
|
+
if (this.highPriorityEntities.includes(record.resource)) {
|
|
1414
|
+
if (!priorityDeleteOperations[`delete-${record.resource}`]) {
|
|
1415
|
+
priorityDeleteOperations[`delete-${record.resource}`] = {
|
|
1416
|
+
entity: record.resource,
|
|
1417
|
+
action: "delete",
|
|
1418
|
+
payload: []
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
priorityDeleteOperations[`delete-${record.resource}`].payload.push(record.payload);
|
|
1422
|
+
} else {
|
|
1423
|
+
if (!deleteOperations[`delete-${record.resource}`]) {
|
|
1424
|
+
deleteOperations[`delete-${record.resource}`] = {
|
|
1425
|
+
entity: record.resource,
|
|
1426
|
+
action: "delete",
|
|
1427
|
+
payload: []
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
deleteOperations[`delete-${record.resource}`].payload.push(record.payload);
|
|
1222
1431
|
}
|
|
1223
|
-
|
|
1432
|
+
});
|
|
1433
|
+
await this.AdminApiClient.post("_action/sync", {
|
|
1434
|
+
data: priorityDeleteOperations
|
|
1224
1435
|
});
|
|
1225
1436
|
return await this.AdminApiClient.post("_action/sync", {
|
|
1226
1437
|
data: deleteOperations
|
|
@@ -1581,190 +1792,19 @@ class TestDataService {
|
|
|
1581
1792
|
}
|
|
1582
1793
|
}
|
|
1583
1794
|
|
|
1584
|
-
const test$
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
const options = {
|
|
1595
|
-
app_url: process.env["APP_URL"],
|
|
1596
|
-
"sw-access-key": DefaultSalesChannel.salesChannel.accessKey,
|
|
1597
|
-
ignoreHTTPSErrors: true
|
|
1598
|
-
};
|
|
1599
|
-
const storeApiContext = await StoreApiContext.create(options);
|
|
1600
|
-
await use(storeApiContext);
|
|
1601
|
-
},
|
|
1602
|
-
{ scope: "worker" }
|
|
1603
|
-
],
|
|
1604
|
-
TestDataService: [
|
|
1605
|
-
async ({ AdminApiContext: AdminApiContext2, IdProvider, DefaultSalesChannel, SalesChannelBaseConfig }, use) => {
|
|
1606
|
-
const DataService = new TestDataService(AdminApiContext2, IdProvider, {
|
|
1607
|
-
defaultSalesChannel: DefaultSalesChannel.salesChannel,
|
|
1608
|
-
defaultTaxId: SalesChannelBaseConfig.taxId,
|
|
1609
|
-
defaultCurrencyId: SalesChannelBaseConfig.defaultCurrencyId,
|
|
1610
|
-
defaultCategoryId: DefaultSalesChannel.salesChannel.navigationCategoryId,
|
|
1611
|
-
defaultLanguageId: DefaultSalesChannel.salesChannel.languageId,
|
|
1612
|
-
defaultCountryId: DefaultSalesChannel.salesChannel.countryId,
|
|
1613
|
-
defaultCustomerGroupId: DefaultSalesChannel.salesChannel.customerGroupId
|
|
1614
|
-
});
|
|
1615
|
-
await use(DataService);
|
|
1616
|
-
await DataService.cleanUp();
|
|
1617
|
-
},
|
|
1618
|
-
{ scope: "worker" }
|
|
1619
|
-
]
|
|
1620
|
-
});
|
|
1621
|
-
|
|
1622
|
-
async function mockApiCalls(page) {
|
|
1623
|
-
await page.route("**/api/notification/message*", (route) => route.fulfill({
|
|
1624
|
-
status: 200,
|
|
1625
|
-
contentType: "application/json",
|
|
1626
|
-
body: JSON.stringify({ notifications: [], timestamp: "2024-06-19 06:23:25.040" })
|
|
1627
|
-
}));
|
|
1628
|
-
await page.route("**/api/_action/store/plugin/search*", (route) => route.fulfill({
|
|
1629
|
-
status: 200,
|
|
1630
|
-
contentType: "application/json",
|
|
1631
|
-
body: JSON.stringify({ items: [], total: 0 })
|
|
1632
|
-
}));
|
|
1633
|
-
await page.route("**/api/_action/store/updates*", (route) => route.fulfill({
|
|
1634
|
-
status: 200,
|
|
1635
|
-
contentType: "application/json",
|
|
1636
|
-
body: JSON.stringify({ items: [], total: 0 })
|
|
1637
|
-
}));
|
|
1638
|
-
await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
|
|
1639
|
-
status: 200,
|
|
1640
|
-
contentType: "application/json",
|
|
1641
|
-
body: JSON.stringify({ items: [], total: 0 })
|
|
1642
|
-
}));
|
|
1643
|
-
await page.route("**/api/sbp/shop-info*", (route) => route.fulfill({
|
|
1644
|
-
status: 200,
|
|
1645
|
-
contentType: "application/json",
|
|
1646
|
-
body: process.env.SBP_SHOP_INFO_JSON ?? "{}"
|
|
1647
|
-
}));
|
|
1648
|
-
await page.route("**/api/sbp/bookableplans*", (route) => route.fulfill({
|
|
1649
|
-
status: 200,
|
|
1650
|
-
contentType: "application/json",
|
|
1651
|
-
body: process.env.SBP_BOOKABLE_PLANS_JSON ?? "{}"
|
|
1652
|
-
}));
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
const test$8 = test$c.extend({
|
|
1656
|
-
AdminPage: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, browser }, use) => {
|
|
1657
|
-
const context = await browser.newContext({
|
|
1658
|
-
baseURL: SalesChannelBaseConfig.adminUrl,
|
|
1659
|
-
serviceWorkers: "block"
|
|
1660
|
-
});
|
|
1661
|
-
const page = await context.newPage();
|
|
1662
|
-
await mockApiCalls(page);
|
|
1663
|
-
const { id, uuid } = IdProvider.getIdPair();
|
|
1664
|
-
const adminUser = {
|
|
1665
|
-
id: uuid,
|
|
1666
|
-
username: `admin_${id}`,
|
|
1667
|
-
firstName: `${id} admin`,
|
|
1668
|
-
lastName: `${id} admin`,
|
|
1669
|
-
localeId: SalesChannelBaseConfig.enGBLocaleId,
|
|
1670
|
-
email: `admin_${id}@example.com`,
|
|
1671
|
-
timezone: "Europe/Berlin",
|
|
1672
|
-
password: "shopware",
|
|
1673
|
-
admin: true
|
|
1674
|
-
};
|
|
1675
|
-
const response = await AdminApiContext.post("user", {
|
|
1676
|
-
data: adminUser
|
|
1677
|
-
});
|
|
1678
|
-
expect(response.ok()).toBeTruthy();
|
|
1679
|
-
await page.goto("#/login");
|
|
1680
|
-
await page.addStyleTag({
|
|
1681
|
-
content: `
|
|
1682
|
-
.sf-toolbar {
|
|
1683
|
-
width: 0 !important;
|
|
1684
|
-
height: 0 !important;
|
|
1685
|
-
display: none !important;
|
|
1686
|
-
pointer-events: none !important;
|
|
1687
|
-
}
|
|
1688
|
-
`.trim()
|
|
1689
|
-
});
|
|
1690
|
-
await page.getByLabel(/Username|Email address/).fill(adminUser.username);
|
|
1691
|
-
await page.getByLabel("Password").fill(adminUser.password);
|
|
1692
|
-
await page.getByRole("button", { name: "Log in" }).click();
|
|
1693
|
-
await expect(page.locator("css=.sw-admin-menu__header-logo").first()).toBeVisible({
|
|
1694
|
-
timeout: 2e4
|
|
1695
|
-
});
|
|
1696
|
-
await expect(page.locator(".sw-skeleton")).toHaveCount(0, {
|
|
1697
|
-
timeout: 1e4
|
|
1698
|
-
});
|
|
1699
|
-
await expect(page.locator(".sw-loader")).toHaveCount(0, {
|
|
1700
|
-
timeout: 1e4
|
|
1701
|
-
});
|
|
1702
|
-
await use(page);
|
|
1703
|
-
await page.close();
|
|
1704
|
-
await context.close();
|
|
1705
|
-
const cleanupResponse = await AdminApiContext.delete(`user/${uuid}`);
|
|
1706
|
-
expect(cleanupResponse.ok()).toBeTruthy();
|
|
1707
|
-
},
|
|
1708
|
-
StorefrontPage: async ({ DefaultStorefront, browser }, use) => {
|
|
1709
|
-
const { url } = DefaultStorefront;
|
|
1710
|
-
const context = await browser.newContext({
|
|
1711
|
-
baseURL: url
|
|
1712
|
-
});
|
|
1713
|
-
const page = await context.newPage();
|
|
1714
|
-
await page.goto("./", { waitUntil: "load" });
|
|
1715
|
-
await use(page);
|
|
1716
|
-
await page.close();
|
|
1717
|
-
await context.close();
|
|
1718
|
-
}
|
|
1719
|
-
});
|
|
1720
|
-
|
|
1721
|
-
var __defProp$p = Object.defineProperty;
|
|
1722
|
-
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1723
|
-
var __publicField$p = (obj, key, value) => {
|
|
1724
|
-
__defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1725
|
-
return value;
|
|
1726
|
-
};
|
|
1727
|
-
class Actor {
|
|
1728
|
-
constructor(name, page) {
|
|
1729
|
-
__publicField$p(this, "page");
|
|
1730
|
-
__publicField$p(this, "name");
|
|
1731
|
-
__publicField$p(this, "expects", expect);
|
|
1732
|
-
this.name = name;
|
|
1733
|
-
this.page = page;
|
|
1734
|
-
}
|
|
1735
|
-
async attemptsTo(task) {
|
|
1736
|
-
const stepTitle = `${this.name} attempts to ${this.camelCaseToLowerCase(task.name)}`;
|
|
1737
|
-
await test$c.step(stepTitle, async () => await task());
|
|
1738
|
-
}
|
|
1739
|
-
async goesTo(url) {
|
|
1740
|
-
const stepTitle = `${this.name} navigates to "${url}"`;
|
|
1741
|
-
await test$c.step(stepTitle, async () => {
|
|
1742
|
-
await this.page.goto(url);
|
|
1743
|
-
await this.page.addStyleTag({
|
|
1744
|
-
content: `
|
|
1745
|
-
.sf-toolbar {
|
|
1746
|
-
width: 0 !important;
|
|
1747
|
-
height: 0 !important;
|
|
1748
|
-
display: none !important;
|
|
1749
|
-
pointer-events: none !important;
|
|
1750
|
-
}
|
|
1751
|
-
`.trim()
|
|
1752
|
-
});
|
|
1795
|
+
const test$7 = test$d.extend({
|
|
1796
|
+
TestDataService: async ({ AdminApiContext, IdProvider, DefaultSalesChannel, SalesChannelBaseConfig }, use) => {
|
|
1797
|
+
const DataService = new TestDataService(AdminApiContext, IdProvider, {
|
|
1798
|
+
defaultSalesChannel: DefaultSalesChannel.salesChannel,
|
|
1799
|
+
defaultTaxId: SalesChannelBaseConfig.taxId,
|
|
1800
|
+
defaultCurrencyId: SalesChannelBaseConfig.defaultCurrencyId,
|
|
1801
|
+
defaultCategoryId: DefaultSalesChannel.salesChannel.navigationCategoryId,
|
|
1802
|
+
defaultLanguageId: DefaultSalesChannel.salesChannel.languageId,
|
|
1803
|
+
defaultCountryId: DefaultSalesChannel.salesChannel.countryId,
|
|
1804
|
+
defaultCustomerGroupId: DefaultSalesChannel.salesChannel.customerGroupId
|
|
1753
1805
|
});
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
return str.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
const test$7 = test$c.extend({
|
|
1761
|
-
ShopCustomer: async ({ StorefrontPage }, use) => {
|
|
1762
|
-
const shopCustomer = new Actor("Shop customer", StorefrontPage);
|
|
1763
|
-
await use(shopCustomer);
|
|
1764
|
-
},
|
|
1765
|
-
ShopAdmin: async ({ AdminPage }, use) => {
|
|
1766
|
-
const shopAdmin = new Actor("Shop administrator", AdminPage);
|
|
1767
|
-
await use(shopAdmin);
|
|
1806
|
+
await use(DataService);
|
|
1807
|
+
await DataService.cleanUp();
|
|
1768
1808
|
}
|
|
1769
1809
|
});
|
|
1770
1810
|
|
|
@@ -1806,7 +1846,7 @@ class IdProvider {
|
|
|
1806
1846
|
}
|
|
1807
1847
|
}
|
|
1808
1848
|
|
|
1809
|
-
const test$6 = test$
|
|
1849
|
+
const test$6 = test$d.extend({
|
|
1810
1850
|
IdProvider: [
|
|
1811
1851
|
async ({}, use, workerInfo) => {
|
|
1812
1852
|
const seed = process.env.SHOPWARE_ACCESS_KEY_ID || process.env.SHOPWARE_ADMIN_PASSWORD || "test-suite";
|
|
@@ -2291,7 +2331,7 @@ const StorefrontPageObjects = {
|
|
|
2291
2331
|
Search,
|
|
2292
2332
|
SearchSuggest
|
|
2293
2333
|
};
|
|
2294
|
-
const test$5 = test$
|
|
2334
|
+
const test$5 = test$d.extend({
|
|
2295
2335
|
StorefrontHome: async ({ StorefrontPage }, use) => {
|
|
2296
2336
|
await use(new Home(StorefrontPage));
|
|
2297
2337
|
},
|
|
@@ -2684,7 +2724,7 @@ const AdminPageObjects = {
|
|
|
2684
2724
|
Dashboard,
|
|
2685
2725
|
DataSharing
|
|
2686
2726
|
};
|
|
2687
|
-
const test$4 = test$
|
|
2727
|
+
const test$4 = test$d.extend({
|
|
2688
2728
|
AdminProductDetail: async ({ AdminPage }, use) => {
|
|
2689
2729
|
await use(new ProductDetail(AdminPage));
|
|
2690
2730
|
},
|
|
@@ -2714,7 +2754,7 @@ const test$4 = test$c.extend({
|
|
|
2714
2754
|
}
|
|
2715
2755
|
});
|
|
2716
2756
|
|
|
2717
|
-
const ProductData = test$
|
|
2757
|
+
const ProductData = test$d.extend({
|
|
2718
2758
|
ProductData: async ({ IdProvider, SalesChannelBaseConfig, AdminApiContext, DefaultSalesChannel }, use) => {
|
|
2719
2759
|
const { id: productId, uuid: productUuid } = IdProvider.getIdPair();
|
|
2720
2760
|
const productName = `Product_test_${productId}`;
|
|
@@ -2775,7 +2815,7 @@ const ProductData = test$c.extend({
|
|
|
2775
2815
|
}
|
|
2776
2816
|
});
|
|
2777
2817
|
|
|
2778
|
-
const CategoryData = test$
|
|
2818
|
+
const CategoryData = test$d.extend({
|
|
2779
2819
|
CategoryData: async ({ IdProvider, AdminApiContext, DefaultSalesChannel, ProductData }, use) => {
|
|
2780
2820
|
const { id: categoryId, uuid: categoryUuid } = IdProvider.getIdPair();
|
|
2781
2821
|
const categoryName = `Category-${categoryId}`;
|
|
@@ -2802,7 +2842,7 @@ const CategoryData = test$c.extend({
|
|
|
2802
2842
|
}
|
|
2803
2843
|
});
|
|
2804
2844
|
|
|
2805
|
-
const DigitalProductData = test$
|
|
2845
|
+
const DigitalProductData = test$d.extend({
|
|
2806
2846
|
DigitalProductData: async ({ ProductData, IdProvider, AdminApiContext }, use) => {
|
|
2807
2847
|
const newMediaResource = await AdminApiContext.post("./media?_response", {
|
|
2808
2848
|
data: {
|
|
@@ -2857,7 +2897,7 @@ const DigitalProductData = test$c.extend({
|
|
|
2857
2897
|
}
|
|
2858
2898
|
});
|
|
2859
2899
|
|
|
2860
|
-
const PropertiesData = test$
|
|
2900
|
+
const PropertiesData = test$d.extend({
|
|
2861
2901
|
PropertiesData: async ({ AdminApiContext }, use) => {
|
|
2862
2902
|
const propertyGroupColorResponse = await AdminApiContext.post("property-group?_response=1", {
|
|
2863
2903
|
data: {
|
|
@@ -2907,7 +2947,7 @@ const PropertiesData = test$c.extend({
|
|
|
2907
2947
|
}
|
|
2908
2948
|
});
|
|
2909
2949
|
|
|
2910
|
-
const CartWithProductData = test$
|
|
2950
|
+
const CartWithProductData = test$d.extend({
|
|
2911
2951
|
CartWithProductData: async ({ StoreApiContext, DefaultSalesChannel, ProductData }, use) => {
|
|
2912
2952
|
await StoreApiContext.login(DefaultSalesChannel.customer);
|
|
2913
2953
|
const cartResponse = await StoreApiContext.post("checkout/cart", {
|
|
@@ -2933,7 +2973,7 @@ const CartWithProductData = test$c.extend({
|
|
|
2933
2973
|
}
|
|
2934
2974
|
});
|
|
2935
2975
|
|
|
2936
|
-
const PromotionWithCodeData = test$
|
|
2976
|
+
const PromotionWithCodeData = test$d.extend({
|
|
2937
2977
|
PromotionWithCodeData: async ({ AdminApiContext, DefaultSalesChannel, IdProvider }, use) => {
|
|
2938
2978
|
const promotionCode = `${IdProvider.getIdPair().id}`;
|
|
2939
2979
|
const promotionName = `Test Promotion ${promotionCode}`;
|
|
@@ -2975,7 +3015,7 @@ const PromotionWithCodeData = test$c.extend({
|
|
|
2975
3015
|
}
|
|
2976
3016
|
});
|
|
2977
3017
|
|
|
2978
|
-
const MediaData = test$
|
|
3018
|
+
const MediaData = test$d.extend({
|
|
2979
3019
|
MediaData: async ({ AdminApiContext, IdProvider }, use) => {
|
|
2980
3020
|
const imageId = IdProvider.getIdPair().id;
|
|
2981
3021
|
const imageFilePath = `./tmp/image-${imageId}.png`;
|
|
@@ -3022,7 +3062,7 @@ const MediaData = test$c.extend({
|
|
|
3022
3062
|
}
|
|
3023
3063
|
});
|
|
3024
3064
|
|
|
3025
|
-
const OrderData = test$
|
|
3065
|
+
const OrderData = test$d.extend({
|
|
3026
3066
|
OrderData: async ({ IdProvider, AdminApiContext, SalesChannelBaseConfig, DefaultSalesChannel, ProductData }, use) => {
|
|
3027
3067
|
const requests = {
|
|
3028
3068
|
currencyEUR: getCurrency("EUR", AdminApiContext),
|
|
@@ -3239,7 +3279,7 @@ const OrderData = test$c.extend({
|
|
|
3239
3279
|
}
|
|
3240
3280
|
});
|
|
3241
3281
|
|
|
3242
|
-
const TagData = test$
|
|
3282
|
+
const TagData = test$d.extend({
|
|
3243
3283
|
TagData: async ({ IdProvider, AdminApiContext }, use) => {
|
|
3244
3284
|
const tagUUID = IdProvider.getIdPair().uuid;
|
|
3245
3285
|
const tagId = IdProvider.getIdPair().id;
|
|
@@ -3270,7 +3310,7 @@ const test$3 = mergeTests(
|
|
|
3270
3310
|
TagData
|
|
3271
3311
|
);
|
|
3272
3312
|
|
|
3273
|
-
const SaveProduct = test$
|
|
3313
|
+
const SaveProduct = test$d.extend({
|
|
3274
3314
|
SaveProduct: async ({ ShopAdmin, AdminProductDetail }, use) => {
|
|
3275
3315
|
const task = () => {
|
|
3276
3316
|
return async function SaveProduct2() {
|
|
@@ -3292,7 +3332,7 @@ const test$2 = mergeTests(
|
|
|
3292
3332
|
SaveProduct
|
|
3293
3333
|
);
|
|
3294
3334
|
|
|
3295
|
-
const Login = test$
|
|
3335
|
+
const Login = test$d.extend({
|
|
3296
3336
|
Login: async ({ ShopCustomer, DefaultSalesChannel, StorefrontAccountLogin, StorefrontAccount }, use) => {
|
|
3297
3337
|
const task = () => {
|
|
3298
3338
|
return async function Login2() {
|
|
@@ -3308,7 +3348,7 @@ const Login = test$c.extend({
|
|
|
3308
3348
|
}
|
|
3309
3349
|
});
|
|
3310
3350
|
|
|
3311
|
-
const Logout = test$
|
|
3351
|
+
const Logout = test$d.extend({
|
|
3312
3352
|
Logout: async ({ ShopCustomer, StorefrontAccountLogin }, use) => {
|
|
3313
3353
|
const task = () => {
|
|
3314
3354
|
return async function Logout2() {
|
|
@@ -3322,7 +3362,7 @@ const Logout = test$c.extend({
|
|
|
3322
3362
|
}
|
|
3323
3363
|
});
|
|
3324
3364
|
|
|
3325
|
-
const Register = test$
|
|
3365
|
+
const Register = test$d.extend({
|
|
3326
3366
|
Register: async ({ StorefrontAccountLogin, AdminApiContext }, use) => {
|
|
3327
3367
|
const registrationData = {
|
|
3328
3368
|
firstName: "Jeff",
|
|
@@ -3365,7 +3405,7 @@ const Register = test$c.extend({
|
|
|
3365
3405
|
}
|
|
3366
3406
|
});
|
|
3367
3407
|
|
|
3368
|
-
const AddProductToCart = test$
|
|
3408
|
+
const AddProductToCart = test$d.extend({
|
|
3369
3409
|
AddProductToCart: async ({ ShopCustomer, StorefrontProductDetail }, use) => {
|
|
3370
3410
|
const task = (ProductData, quantity = "1") => {
|
|
3371
3411
|
return async function AddProductToCart2() {
|
|
@@ -3379,7 +3419,7 @@ const AddProductToCart = test$c.extend({
|
|
|
3379
3419
|
}
|
|
3380
3420
|
});
|
|
3381
3421
|
|
|
3382
|
-
const ProceedFromProductToCheckout = test$
|
|
3422
|
+
const ProceedFromProductToCheckout = test$d.extend({
|
|
3383
3423
|
ProceedFromProductToCheckout: async ({ ShopCustomer, StorefrontProductDetail, StorefrontCheckoutConfirm }, use) => {
|
|
3384
3424
|
const task = () => {
|
|
3385
3425
|
return async function ProceedFromProductToCheckout2() {
|
|
@@ -3391,7 +3431,7 @@ const ProceedFromProductToCheckout = test$c.extend({
|
|
|
3391
3431
|
}
|
|
3392
3432
|
});
|
|
3393
3433
|
|
|
3394
|
-
const ProceedFromCartToCheckout = test$
|
|
3434
|
+
const ProceedFromCartToCheckout = test$d.extend({
|
|
3395
3435
|
ProceedFromCartToCheckout: async ({
|
|
3396
3436
|
ShopCustomer,
|
|
3397
3437
|
StorefrontCheckoutCart,
|
|
@@ -3407,7 +3447,7 @@ const ProceedFromCartToCheckout = test$c.extend({
|
|
|
3407
3447
|
}
|
|
3408
3448
|
});
|
|
3409
3449
|
|
|
3410
|
-
const ConfirmTermsAndConditions = test$
|
|
3450
|
+
const ConfirmTermsAndConditions = test$d.extend({
|
|
3411
3451
|
ConfirmTermsAndConditions: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
|
|
3412
3452
|
const task = () => {
|
|
3413
3453
|
return async function ConfirmTermsAndConditions2() {
|
|
@@ -3419,7 +3459,7 @@ const ConfirmTermsAndConditions = test$c.extend({
|
|
|
3419
3459
|
}
|
|
3420
3460
|
});
|
|
3421
3461
|
|
|
3422
|
-
const SelectCashOnDeliveryPaymentOption = test$
|
|
3462
|
+
const SelectCashOnDeliveryPaymentOption = test$d.extend({
|
|
3423
3463
|
SelectCashOnDeliveryPaymentOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
|
|
3424
3464
|
const task = () => {
|
|
3425
3465
|
return async function SelectCashOnDeliveryPaymentOption2() {
|
|
@@ -3431,7 +3471,7 @@ const SelectCashOnDeliveryPaymentOption = test$c.extend({
|
|
|
3431
3471
|
}
|
|
3432
3472
|
});
|
|
3433
3473
|
|
|
3434
|
-
const SelectInvoicePaymentOption = test$
|
|
3474
|
+
const SelectInvoicePaymentOption = test$d.extend({
|
|
3435
3475
|
SelectInvoicePaymentOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
|
|
3436
3476
|
const task = () => {
|
|
3437
3477
|
return async function SelectInvoicePaymentOption2() {
|
|
@@ -3443,7 +3483,7 @@ const SelectInvoicePaymentOption = test$c.extend({
|
|
|
3443
3483
|
}
|
|
3444
3484
|
});
|
|
3445
3485
|
|
|
3446
|
-
const SelectPaidInAdvancePaymentOption = test$
|
|
3486
|
+
const SelectPaidInAdvancePaymentOption = test$d.extend({
|
|
3447
3487
|
SelectPaidInAdvancePaymentOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
|
|
3448
3488
|
const task = () => {
|
|
3449
3489
|
return async function SelectPaidInAdvancePaymentOption2() {
|
|
@@ -3455,7 +3495,7 @@ const SelectPaidInAdvancePaymentOption = test$c.extend({
|
|
|
3455
3495
|
}
|
|
3456
3496
|
});
|
|
3457
3497
|
|
|
3458
|
-
const SelectStandardShippingOption = test$
|
|
3498
|
+
const SelectStandardShippingOption = test$d.extend({
|
|
3459
3499
|
SelectStandardShippingOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
|
|
3460
3500
|
const task = () => {
|
|
3461
3501
|
return async function SelectStandardShippingOption2() {
|
|
@@ -3467,7 +3507,7 @@ const SelectStandardShippingOption = test$c.extend({
|
|
|
3467
3507
|
}
|
|
3468
3508
|
});
|
|
3469
3509
|
|
|
3470
|
-
const SelectExpressShippingOption = test$
|
|
3510
|
+
const SelectExpressShippingOption = test$d.extend({
|
|
3471
3511
|
SelectExpressShippingOption: async ({ ShopCustomer, StorefrontCheckoutConfirm }, use) => {
|
|
3472
3512
|
const task = () => {
|
|
3473
3513
|
return async function SelectExpressShippingOption2() {
|
|
@@ -3479,7 +3519,7 @@ const SelectExpressShippingOption = test$c.extend({
|
|
|
3479
3519
|
}
|
|
3480
3520
|
});
|
|
3481
3521
|
|
|
3482
|
-
const SubmitOrder = test$
|
|
3522
|
+
const SubmitOrder = test$d.extend({
|
|
3483
3523
|
SubmitOrder: async ({ ShopCustomer, StorefrontCheckoutConfirm, StorefrontCheckoutFinish }, use) => {
|
|
3484
3524
|
const task = () => {
|
|
3485
3525
|
return async function SubmitOrder2() {
|
|
@@ -3491,7 +3531,7 @@ const SubmitOrder = test$c.extend({
|
|
|
3491
3531
|
}
|
|
3492
3532
|
});
|
|
3493
3533
|
|
|
3494
|
-
const OpenSearchResultPage = test$
|
|
3534
|
+
const OpenSearchResultPage = test$d.extend({
|
|
3495
3535
|
OpenSearchResultPage: async ({ StorefrontSearch }, use) => {
|
|
3496
3536
|
const task = (searchTerm) => {
|
|
3497
3537
|
return async function OpenSearchResultPage2() {
|
|
@@ -3503,7 +3543,7 @@ const OpenSearchResultPage = test$c.extend({
|
|
|
3503
3543
|
}
|
|
3504
3544
|
});
|
|
3505
3545
|
|
|
3506
|
-
const OpenSearchSuggestPage = test$
|
|
3546
|
+
const OpenSearchSuggestPage = test$d.extend({
|
|
3507
3547
|
OpenSearchSuggestPage: async ({ StorefrontSearchSuggest }, use) => {
|
|
3508
3548
|
const task = (searchTerm) => {
|
|
3509
3549
|
return async function OpenSearchSuggestPage2() {
|
|
@@ -3515,7 +3555,7 @@ const OpenSearchSuggestPage = test$c.extend({
|
|
|
3515
3555
|
}
|
|
3516
3556
|
});
|
|
3517
3557
|
|
|
3518
|
-
const ValidateAccessibility = test$
|
|
3558
|
+
const ValidateAccessibility = test$d.extend({
|
|
3519
3559
|
ValidateAccessibility: async ({ ShopCustomer }, use) => {
|
|
3520
3560
|
const task = (pageName, assertViolations = true, createReport = true, ruleTags = ["wcag2a", "wcag2aa", "wcag2aaa", "wcag21a", "wcag21aa", "best-practice"], outputDir = "test-results/AccessibilityReports") => {
|
|
3521
3561
|
return async function ValidateAccessibility2() {
|
|
@@ -3561,6 +3601,7 @@ const test$1 = mergeTests(
|
|
|
3561
3601
|
|
|
3562
3602
|
const test = mergeTests(
|
|
3563
3603
|
test$6,
|
|
3604
|
+
test$b,
|
|
3564
3605
|
test$a,
|
|
3565
3606
|
test$9,
|
|
3566
3607
|
test$8,
|