@shopware-ag/acceptance-test-suite 1.4.0 → 2.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/README.md +5 -5
- package/dist/index.d.mts +105 -49
- package/dist/index.d.ts +105 -49
- package/dist/index.mjs +438 -358
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -210,9 +210,9 @@ There are several page objects to navigate the different pages of the Administra
|
|
|
210
210
|
```TypeScript
|
|
211
211
|
import { test, expect } from './../BaseTestFile';
|
|
212
212
|
|
|
213
|
-
test('Storefront cart test scenario', async ({ StorefrontCheckoutCart }) => {
|
|
213
|
+
test('Storefront cart test scenario', async ({ StorefrontPage, StorefrontCheckoutCart }) => {
|
|
214
214
|
|
|
215
|
-
await StorefrontCheckoutCart.
|
|
215
|
+
await StorefrontPage.goto(StorefrontCheckoutCart.url());
|
|
216
216
|
await expect(StorefrontCheckoutCart.grandTotalPrice).toHaveText('€100.00*');
|
|
217
217
|
});
|
|
218
218
|
```
|
|
@@ -236,7 +236,7 @@ The actor class is just a lightweight solution to simplify the execution of reus
|
|
|
236
236
|
* `page`: A Playwright page context the actor is navigating.
|
|
237
237
|
|
|
238
238
|
**Methods**
|
|
239
|
-
* `goesTo`: Accepts a page
|
|
239
|
+
* `goesTo`: Accepts an url of a page the actor should navigate to.
|
|
240
240
|
* `attemptsTo`: Accepts a "task" function with reusable test logic the actor should perform.
|
|
241
241
|
* `expects`: A one-to-one export of the Playwright `expect` method to use it in the actor pattern.
|
|
242
242
|
|
|
@@ -257,7 +257,7 @@ test('Product detail test scenario', async ({
|
|
|
257
257
|
ProductData
|
|
258
258
|
}) => {
|
|
259
259
|
|
|
260
|
-
await ShopCustomer.goesTo(StorefrontProductDetail);
|
|
260
|
+
await ShopCustomer.goesTo(StorefrontProductDetail.url(ProductData));
|
|
261
261
|
await ShopCustomer.attemptsTo(AddProductToCart(ProductData));
|
|
262
262
|
await ShopCustomer.expects(StorefrontProductDetail.offCanvasSummaryTotalPrice).toHaveText('€99.99*');
|
|
263
263
|
});
|
|
@@ -289,7 +289,7 @@ export const Login = base.extend<{ Login: Task }, FixtureTypes>({
|
|
|
289
289
|
return async function Login() {
|
|
290
290
|
const { customer } = DefaultSalesChannel;
|
|
291
291
|
|
|
292
|
-
await ShopCustomer.goesTo(StorefrontAccountLogin);
|
|
292
|
+
await ShopCustomer.goesTo(StorefrontAccountLogin.url());
|
|
293
293
|
|
|
294
294
|
await StorefrontAccountLogin.emailInput.fill(customer.email);
|
|
295
295
|
await StorefrontAccountLogin.passwordInput.fill(customer.password);
|
package/dist/index.d.mts
CHANGED
|
@@ -96,18 +96,13 @@ interface PageContextTypes {
|
|
|
96
96
|
StorefrontPage: Page;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
interface PageObject {
|
|
100
|
-
readonly page: Page;
|
|
101
|
-
goTo(): Promise<void>;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
99
|
declare class Actor {
|
|
105
100
|
page: Page;
|
|
106
101
|
readonly name: string;
|
|
107
102
|
constructor(name: string, page: Page);
|
|
108
103
|
expects: _playwright_test.Expect<{}>;
|
|
109
104
|
attemptsTo(task: () => Promise<void>): Promise<void>;
|
|
110
|
-
goesTo(
|
|
105
|
+
goesTo(url: string): Promise<void>;
|
|
111
106
|
private camelCaseToLowerCase;
|
|
112
107
|
}
|
|
113
108
|
|
|
@@ -116,6 +111,26 @@ interface ActorFixtureTypes {
|
|
|
116
111
|
ShopAdmin: Actor;
|
|
117
112
|
}
|
|
118
113
|
|
|
114
|
+
type Customer = components['schemas']['Customer'] & {
|
|
115
|
+
id: string;
|
|
116
|
+
password: string;
|
|
117
|
+
};
|
|
118
|
+
type Product = components['schemas']['Product'] & {
|
|
119
|
+
id: string;
|
|
120
|
+
price: {
|
|
121
|
+
gross: number;
|
|
122
|
+
net: number;
|
|
123
|
+
linked: boolean;
|
|
124
|
+
currencyId: string;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
127
|
+
type Category$1 = components['schemas']['Category'] & {
|
|
128
|
+
id: string;
|
|
129
|
+
};
|
|
130
|
+
type Order = components['schemas']['Order'] & {
|
|
131
|
+
id: string;
|
|
132
|
+
};
|
|
133
|
+
|
|
119
134
|
interface StoreBaseConfig {
|
|
120
135
|
storefrontTypeId: string;
|
|
121
136
|
enGBLocaleId: string;
|
|
@@ -135,44 +150,45 @@ interface DefaultSalesChannelTypes {
|
|
|
135
150
|
SalesChannelBaseConfig: StoreBaseConfig;
|
|
136
151
|
DefaultSalesChannel: {
|
|
137
152
|
salesChannel: components['schemas']['SalesChannel'];
|
|
138
|
-
customer:
|
|
139
|
-
password: string;
|
|
140
|
-
};
|
|
153
|
+
customer: Customer;
|
|
141
154
|
url: string;
|
|
142
155
|
};
|
|
143
156
|
}
|
|
144
157
|
|
|
158
|
+
interface PageObject {
|
|
159
|
+
readonly page: Page;
|
|
160
|
+
url(...args: unknown[]): string;
|
|
161
|
+
}
|
|
162
|
+
|
|
145
163
|
declare class Home implements PageObject {
|
|
146
164
|
readonly page: Page;
|
|
147
165
|
readonly productImages: Locator;
|
|
148
166
|
constructor(page: Page);
|
|
149
|
-
|
|
167
|
+
url(): string;
|
|
150
168
|
}
|
|
151
169
|
|
|
152
170
|
declare class ProductDetail$1 implements PageObject {
|
|
153
171
|
readonly page: Page;
|
|
154
|
-
readonly productData: components['schemas']['Product'];
|
|
155
172
|
readonly addToCartButton: Locator;
|
|
173
|
+
readonly quantitySelect: Locator;
|
|
174
|
+
readonly productSingleImage: Locator;
|
|
156
175
|
readonly offCanvasCartTitle: Locator;
|
|
157
176
|
readonly offCanvasCart: Locator;
|
|
158
177
|
readonly offCanvasCartGoToCheckoutButton: Locator;
|
|
159
|
-
readonly productSingleImage: Locator;
|
|
160
178
|
readonly offCanvasLineItemImages: Locator;
|
|
161
|
-
readonly quantitySelect: Locator;
|
|
162
179
|
readonly offCanvasSummaryTotalPrice: Locator;
|
|
163
180
|
readonly offCanvas: Locator;
|
|
164
|
-
constructor(page: Page
|
|
165
|
-
|
|
181
|
+
constructor(page: Page);
|
|
182
|
+
url(productData: Product): string;
|
|
166
183
|
}
|
|
167
184
|
|
|
168
185
|
declare class Category implements PageObject {
|
|
169
186
|
readonly page: Page;
|
|
170
|
-
readonly categoryData: components['schemas']['Category'];
|
|
171
187
|
readonly sortingSelect: Locator;
|
|
172
188
|
readonly firstProductBuyButton: Locator;
|
|
173
189
|
readonly noProductsFoundAlert: Locator;
|
|
174
|
-
constructor(page: Page
|
|
175
|
-
|
|
190
|
+
constructor(page: Page);
|
|
191
|
+
url(categoryName: string): string;
|
|
176
192
|
}
|
|
177
193
|
|
|
178
194
|
declare class CheckoutCart implements PageObject {
|
|
@@ -186,7 +202,7 @@ declare class CheckoutCart implements PageObject {
|
|
|
186
202
|
readonly cartLineItemImages: Locator;
|
|
187
203
|
readonly unitPriceInfo: Locator;
|
|
188
204
|
constructor(page: Page);
|
|
189
|
-
|
|
205
|
+
url(): string;
|
|
190
206
|
}
|
|
191
207
|
|
|
192
208
|
declare class CheckoutConfirm implements PageObject {
|
|
@@ -212,7 +228,7 @@ declare class CheckoutConfirm implements PageObject {
|
|
|
212
228
|
*/
|
|
213
229
|
readonly cartLineItemImages: Locator;
|
|
214
230
|
constructor(page: Page);
|
|
215
|
-
|
|
231
|
+
url(): string;
|
|
216
232
|
}
|
|
217
233
|
|
|
218
234
|
declare class CheckoutFinish implements PageObject {
|
|
@@ -223,7 +239,7 @@ declare class CheckoutFinish implements PageObject {
|
|
|
223
239
|
readonly cartLineItemImages: Locator;
|
|
224
240
|
private readonly orderNumberRegex;
|
|
225
241
|
constructor(page: Page);
|
|
226
|
-
|
|
242
|
+
url(): string;
|
|
227
243
|
getOrderNumber(): Promise<string | null>;
|
|
228
244
|
getOrderId(): string | null;
|
|
229
245
|
}
|
|
@@ -232,7 +248,7 @@ declare class CheckoutRegister implements PageObject {
|
|
|
232
248
|
readonly page: Page;
|
|
233
249
|
readonly cartLineItemImages: Locator;
|
|
234
250
|
constructor(page: Page);
|
|
235
|
-
|
|
251
|
+
url(): string;
|
|
236
252
|
}
|
|
237
253
|
|
|
238
254
|
declare class Account implements PageObject {
|
|
@@ -245,7 +261,7 @@ declare class Account implements PageObject {
|
|
|
245
261
|
readonly newsletterCheckbox: Locator;
|
|
246
262
|
readonly newsletterRegistrationSuccessMessage: Locator;
|
|
247
263
|
constructor(page: Page);
|
|
248
|
-
|
|
264
|
+
url(): string;
|
|
249
265
|
}
|
|
250
266
|
|
|
251
267
|
declare class AccountLogin implements PageObject {
|
|
@@ -266,7 +282,7 @@ declare class AccountLogin implements PageObject {
|
|
|
266
282
|
readonly countryInput: Locator;
|
|
267
283
|
readonly registerButton: Locator;
|
|
268
284
|
constructor(page: Page);
|
|
269
|
-
|
|
285
|
+
url(): string;
|
|
270
286
|
}
|
|
271
287
|
|
|
272
288
|
declare class AccountProfile implements PageObject {
|
|
@@ -286,7 +302,7 @@ declare class AccountProfile implements PageObject {
|
|
|
286
302
|
readonly currentPasswordInput: Locator;
|
|
287
303
|
readonly saveNewPasswordButton: Locator;
|
|
288
304
|
constructor(page: Page);
|
|
289
|
-
|
|
305
|
+
url(): string;
|
|
290
306
|
}
|
|
291
307
|
|
|
292
308
|
declare class AccountOrder implements PageObject {
|
|
@@ -295,7 +311,7 @@ declare class AccountOrder implements PageObject {
|
|
|
295
311
|
readonly orderExpandButton: Locator;
|
|
296
312
|
readonly digitalProductDownloadButton: Locator;
|
|
297
313
|
constructor(page: Page);
|
|
298
|
-
|
|
314
|
+
url(): string;
|
|
299
315
|
}
|
|
300
316
|
|
|
301
317
|
declare class AccountAddresses implements PageObject {
|
|
@@ -306,7 +322,7 @@ declare class AccountAddresses implements PageObject {
|
|
|
306
322
|
readonly useDefaultBillingAddressButton: Locator;
|
|
307
323
|
readonly useDefaultShippingAddressButton: Locator;
|
|
308
324
|
constructor(page: Page);
|
|
309
|
-
|
|
325
|
+
url(): string;
|
|
310
326
|
}
|
|
311
327
|
|
|
312
328
|
declare class AccountPayment implements PageObject {
|
|
@@ -316,21 +332,22 @@ declare class AccountPayment implements PageObject {
|
|
|
316
332
|
readonly invoiceOption: Locator;
|
|
317
333
|
readonly changeDefaultPaymentButton: Locator;
|
|
318
334
|
constructor(page: Page);
|
|
319
|
-
|
|
335
|
+
url(): string;
|
|
320
336
|
}
|
|
321
337
|
|
|
322
338
|
declare class Search implements PageObject {
|
|
323
339
|
readonly page: Page;
|
|
340
|
+
readonly headline: Locator;
|
|
324
341
|
readonly productImages: Locator;
|
|
325
342
|
constructor(page: Page);
|
|
326
|
-
|
|
343
|
+
url(searchTerm: string): string;
|
|
327
344
|
}
|
|
328
345
|
|
|
329
346
|
declare class SearchSuggest implements PageObject {
|
|
330
347
|
readonly page: Page;
|
|
331
348
|
readonly searchSuggestLineItemImages: Locator;
|
|
332
349
|
constructor(page: Page);
|
|
333
|
-
|
|
350
|
+
url(searchTerm: string): string;
|
|
334
351
|
}
|
|
335
352
|
|
|
336
353
|
interface StorefrontPageTypes {
|
|
@@ -406,30 +423,26 @@ declare class ProductDetail implements PageObject {
|
|
|
406
423
|
readonly propertyOptionSizeSmall: Locator;
|
|
407
424
|
readonly propertyOptionSizeMedium: Locator;
|
|
408
425
|
readonly propertyOptionSizeLarge: Locator;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
goTo(): Promise<void>;
|
|
412
|
-
getProductId(): string | undefined;
|
|
426
|
+
constructor(page: Page);
|
|
427
|
+
url(productId: string): string;
|
|
413
428
|
}
|
|
414
429
|
|
|
415
430
|
declare class OrderDetail implements PageObject {
|
|
416
431
|
readonly page: Page;
|
|
432
|
+
readonly saveButton: Locator;
|
|
417
433
|
readonly dataGridContextButton: Locator;
|
|
418
434
|
readonly orderTag: Locator;
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
goTo(): Promise<void>;
|
|
435
|
+
constructor(page: Page);
|
|
436
|
+
url(orderId: string): string;
|
|
422
437
|
}
|
|
423
438
|
|
|
424
439
|
declare class CustomerDetail implements PageObject {
|
|
425
440
|
readonly page: Page;
|
|
426
|
-
readonly customerId: string | undefined;
|
|
427
|
-
readonly customer: components['schemas']['Customer'];
|
|
428
441
|
readonly editButton: Locator;
|
|
429
442
|
readonly generalTab: Locator;
|
|
430
443
|
readonly accountCard: Locator;
|
|
431
|
-
constructor(page: Page
|
|
432
|
-
|
|
444
|
+
constructor(page: Page);
|
|
445
|
+
url(customerId: string): string;
|
|
433
446
|
}
|
|
434
447
|
|
|
435
448
|
declare class FirstRunWizard implements PageObject {
|
|
@@ -473,7 +486,7 @@ declare class FirstRunWizard implements PageObject {
|
|
|
473
486
|
readonly recommendationHeader: Locator;
|
|
474
487
|
readonly toolsRecommendedPlugin: Locator;
|
|
475
488
|
constructor(page: Page);
|
|
476
|
-
|
|
489
|
+
url(): string;
|
|
477
490
|
}
|
|
478
491
|
|
|
479
492
|
declare class FlowBuilderCreate implements PageObject {
|
|
@@ -481,11 +494,12 @@ declare class FlowBuilderCreate implements PageObject {
|
|
|
481
494
|
readonly saveButton: Locator;
|
|
482
495
|
readonly header: Locator;
|
|
483
496
|
constructor(page: Page);
|
|
484
|
-
|
|
497
|
+
url(): string;
|
|
485
498
|
}
|
|
486
499
|
|
|
487
500
|
declare class FlowBuilderListing implements PageObject {
|
|
488
501
|
readonly page: Page;
|
|
502
|
+
readonly createFlowButton: Locator;
|
|
489
503
|
readonly firstFlowName: Locator;
|
|
490
504
|
readonly firstFlowContextButton: Locator;
|
|
491
505
|
readonly flowContextMenu: Locator;
|
|
@@ -495,7 +509,41 @@ declare class FlowBuilderListing implements PageObject {
|
|
|
495
509
|
readonly successAlert: Locator;
|
|
496
510
|
readonly successAlertMessage: Locator;
|
|
497
511
|
constructor(page: Page);
|
|
498
|
-
|
|
512
|
+
url(): string;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
declare class FlowBuilderDetail implements PageObject {
|
|
516
|
+
readonly page: Page;
|
|
517
|
+
readonly saveButton: Locator;
|
|
518
|
+
readonly generalTab: Locator;
|
|
519
|
+
readonly flowTab: Locator;
|
|
520
|
+
constructor(page: Page);
|
|
521
|
+
url(flowId: string, tabName?: string): string;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
declare class DataSharing implements PageObject {
|
|
525
|
+
readonly page: Page;
|
|
526
|
+
readonly dataConsentHeadline: Locator;
|
|
527
|
+
readonly dataSharingSuccessMessageLabel: Locator;
|
|
528
|
+
readonly dataSharingAgreeButton: Locator;
|
|
529
|
+
readonly dataSharingDisableButton: Locator;
|
|
530
|
+
readonly dataSharingTermsAgreementLabel: Locator;
|
|
531
|
+
constructor(page: Page);
|
|
532
|
+
url(): string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
declare class Dashboard implements PageObject {
|
|
536
|
+
readonly page: Page;
|
|
537
|
+
readonly welcomeHeadline: Locator;
|
|
538
|
+
readonly dataSharingConsentBanner: Locator;
|
|
539
|
+
readonly dataSharingAgreeButton: Locator;
|
|
540
|
+
readonly dataSharingNotAtTheMomentButton: Locator;
|
|
541
|
+
readonly dataSharingTermsAgreementLabel: Locator;
|
|
542
|
+
readonly dataSharingSettingsLink: Locator;
|
|
543
|
+
readonly dataSharingAcceptMessageText: Locator;
|
|
544
|
+
readonly dataSharingNotAtTheMomentMessageText: Locator;
|
|
545
|
+
constructor(page: Page);
|
|
546
|
+
url(): string;
|
|
499
547
|
}
|
|
500
548
|
|
|
501
549
|
interface AdministrationPageTypes {
|
|
@@ -505,6 +553,9 @@ interface AdministrationPageTypes {
|
|
|
505
553
|
AdminFirstRunWizard: FirstRunWizard;
|
|
506
554
|
AdminFlowBuilderCreate: FlowBuilderCreate;
|
|
507
555
|
AdminFlowBuilderListing: FlowBuilderListing;
|
|
556
|
+
AdminFlowBuilderDetail: FlowBuilderDetail;
|
|
557
|
+
AdminDataSharing: DataSharing;
|
|
558
|
+
AdminDashboard: Dashboard;
|
|
508
559
|
}
|
|
509
560
|
declare const AdminPageObjects: {
|
|
510
561
|
ProductDetail: typeof ProductDetail;
|
|
@@ -513,13 +564,16 @@ declare const AdminPageObjects: {
|
|
|
513
564
|
FirstRunWizard: typeof FirstRunWizard;
|
|
514
565
|
FlowBuilderCreate: typeof FlowBuilderCreate;
|
|
515
566
|
FlowBuilderListing: typeof FlowBuilderListing;
|
|
567
|
+
FlowBuilderDetail: typeof FlowBuilderDetail;
|
|
568
|
+
Dashboard: typeof Dashboard;
|
|
569
|
+
DataSharing: typeof DataSharing;
|
|
516
570
|
};
|
|
517
571
|
|
|
518
572
|
interface DataFixtureTypes {
|
|
519
|
-
ProductData:
|
|
520
|
-
CategoryData:
|
|
573
|
+
ProductData: Product;
|
|
574
|
+
CategoryData: Category$1;
|
|
521
575
|
DigitalProductData: {
|
|
522
|
-
product:
|
|
576
|
+
product: Product;
|
|
523
577
|
fileContent: string;
|
|
524
578
|
};
|
|
525
579
|
PromotionWithCodeData: components['schemas']['Promotion'];
|
|
@@ -529,7 +583,7 @@ interface DataFixtureTypes {
|
|
|
529
583
|
propertyGroupSize: components['schemas']['PropertyGroup'];
|
|
530
584
|
};
|
|
531
585
|
MediaData: components['schemas']['Media'];
|
|
532
|
-
OrderData:
|
|
586
|
+
OrderData: Order;
|
|
533
587
|
TagData: components['schemas']['Tag'];
|
|
534
588
|
}
|
|
535
589
|
|
|
@@ -556,6 +610,8 @@ declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApi
|
|
|
556
610
|
}>;
|
|
557
611
|
declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>;
|
|
558
612
|
declare function extractIdFromUrl(url: string): string | null;
|
|
613
|
+
type OrderStatus = 'cancel' | 'complete' | 'reopen' | 'process';
|
|
614
|
+
declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
|
|
559
615
|
|
|
560
616
|
declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
|
|
561
617
|
|
|
@@ -597,4 +653,4 @@ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArg
|
|
|
597
653
|
ValidateAccessibility: (pageName: string, assertViolations?: boolean | undefined, createReport?: boolean | undefined, ruleTags?: string[] | undefined, outputDir?: string | undefined) => () => Promise<void>;
|
|
598
654
|
}, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & HelperFixtureTypes & FixtureTypes>;
|
|
599
655
|
|
|
600
|
-
export { AdminPageObjects, type FixtureTypes, type PageObject, StorefrontPageObjects, type Task, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, test };
|
|
656
|
+
export { AdminPageObjects, type FixtureTypes, type PageObject, StorefrontPageObjects, type Task, createRandomImage, extractIdFromUrl, getCountryId, getCurrency, getDefaultShippingMethodId, getFlowId, getLanguageData, getMediaId, getOrderTransactionId, getPaymentMethodId, getSalutationId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, isSaaSInstance, setOrderStatus, test };
|