@shopware-ag/acceptance-test-suite 1.5.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 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.goTo();
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 object the actor should be navigating to.
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(pageObject: PageObject): Promise<void>;
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: components['schemas']['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
- goTo(): Promise<void>;
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, productData: components['schemas']['Product']);
165
- goTo(productData?: components['schemas']['Product']): Promise<void>;
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, CategoryData: components['schemas']['Category']);
175
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- readonly productData: components['schemas']['Product'];
410
- constructor(page: Page, productData: components['schemas']['Product']);
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
- readonly orderData: components['schemas']['Order'];
420
- constructor(page: Page, orderData: components['schemas']['Order']);
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, customer: components['schemas']['Customer']);
432
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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
- goTo(): Promise<void>;
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,21 +509,32 @@ declare class FlowBuilderListing implements PageObject {
495
509
  readonly successAlert: Locator;
496
510
  readonly successAlertMessage: Locator;
497
511
  constructor(page: Page);
498
- goTo(): Promise<void>;
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;
499
522
  }
500
523
 
501
524
  declare class DataSharing implements PageObject {
502
525
  readonly page: Page;
526
+ readonly dataConsentHeadline: Locator;
503
527
  readonly dataSharingSuccessMessageLabel: Locator;
504
528
  readonly dataSharingAgreeButton: Locator;
505
529
  readonly dataSharingDisableButton: Locator;
506
530
  readonly dataSharingTermsAgreementLabel: Locator;
507
531
  constructor(page: Page);
508
- goTo(): Promise<void>;
532
+ url(): string;
509
533
  }
510
534
 
511
535
  declare class Dashboard implements PageObject {
512
536
  readonly page: Page;
537
+ readonly welcomeHeadline: Locator;
513
538
  readonly dataSharingConsentBanner: Locator;
514
539
  readonly dataSharingAgreeButton: Locator;
515
540
  readonly dataSharingNotAtTheMomentButton: Locator;
@@ -518,7 +543,7 @@ declare class Dashboard implements PageObject {
518
543
  readonly dataSharingAcceptMessageText: Locator;
519
544
  readonly dataSharingNotAtTheMomentMessageText: Locator;
520
545
  constructor(page: Page);
521
- goTo(): Promise<void>;
546
+ url(): string;
522
547
  }
523
548
 
524
549
  interface AdministrationPageTypes {
@@ -528,6 +553,7 @@ interface AdministrationPageTypes {
528
553
  AdminFirstRunWizard: FirstRunWizard;
529
554
  AdminFlowBuilderCreate: FlowBuilderCreate;
530
555
  AdminFlowBuilderListing: FlowBuilderListing;
556
+ AdminFlowBuilderDetail: FlowBuilderDetail;
531
557
  AdminDataSharing: DataSharing;
532
558
  AdminDashboard: Dashboard;
533
559
  }
@@ -538,15 +564,16 @@ declare const AdminPageObjects: {
538
564
  FirstRunWizard: typeof FirstRunWizard;
539
565
  FlowBuilderCreate: typeof FlowBuilderCreate;
540
566
  FlowBuilderListing: typeof FlowBuilderListing;
567
+ FlowBuilderDetail: typeof FlowBuilderDetail;
541
568
  Dashboard: typeof Dashboard;
542
569
  DataSharing: typeof DataSharing;
543
570
  };
544
571
 
545
572
  interface DataFixtureTypes {
546
- ProductData: components['schemas']['Product'];
547
- CategoryData: components['schemas']['Category'];
573
+ ProductData: Product;
574
+ CategoryData: Category$1;
548
575
  DigitalProductData: {
549
- product: components['schemas']['Product'];
576
+ product: Product;
550
577
  fileContent: string;
551
578
  };
552
579
  PromotionWithCodeData: components['schemas']['Promotion'];
@@ -556,7 +583,7 @@ interface DataFixtureTypes {
556
583
  propertyGroupSize: components['schemas']['PropertyGroup'];
557
584
  };
558
585
  MediaData: components['schemas']['Media'];
559
- OrderData: components['schemas']['Order'];
586
+ OrderData: Order;
560
587
  TagData: components['schemas']['Tag'];
561
588
  }
562
589