@shopware-ag/acceptance-test-suite 1.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.
@@ -0,0 +1,531 @@
1
+ import * as _playwright_test from '@playwright/test';
2
+ import { APIRequestContext, APIResponse, Page, Locator } from '@playwright/test';
3
+ export * from '@playwright/test';
4
+ import { components } from '@shopware/api-client/admin-api-types';
5
+ import { Image } from 'image-js';
6
+
7
+ interface IdPair {
8
+ id: string;
9
+ uuid: string;
10
+ }
11
+ declare class IdProvider {
12
+ private readonly workerIndex;
13
+ private readonly seed;
14
+ constructor(workerIndex: number, seed: string);
15
+ getIdPair(): IdPair;
16
+ getUniqueName(): string;
17
+ getWorkerDerivedStableId(key: string): IdPair;
18
+ }
19
+
20
+ interface HelperFixtureTypes {
21
+ IdProvider: IdProvider;
22
+ }
23
+
24
+ type Task = (...args: never[]) => () => Promise<void>;
25
+
26
+ interface RequestOptions$1<PAYLOAD> {
27
+ [key: string]: unknown;
28
+ data?: PAYLOAD;
29
+ }
30
+ interface AdminApiContextOptions {
31
+ app_url?: string;
32
+ client_id?: string;
33
+ client_secret?: string;
34
+ access_token?: string;
35
+ admin_username?: string;
36
+ admin_password?: string;
37
+ ignoreHTTPSErrors?: boolean;
38
+ }
39
+ declare class AdminApiContext {
40
+ private context;
41
+ private readonly options;
42
+ private static readonly defaultOptions;
43
+ constructor(context: APIRequestContext, options: AdminApiContextOptions);
44
+ static create(options?: AdminApiContextOptions): Promise<AdminApiContext>;
45
+ private static createApiRequestContext;
46
+ private static authenticateWithClientCredentials;
47
+ private static authenticateWithUserPassword;
48
+ isAuthenticated(): boolean;
49
+ get<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
50
+ post<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
51
+ patch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
52
+ delete<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
53
+ fetch<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
54
+ head<PAYLOAD>(url: string, options?: RequestOptions$1<PAYLOAD>): Promise<APIResponse>;
55
+ }
56
+
57
+ interface RequestOptions<PAYLOAD> {
58
+ [key: string]: unknown;
59
+ data?: PAYLOAD;
60
+ }
61
+ interface StoreUser {
62
+ email: string;
63
+ password: string;
64
+ }
65
+ interface StoreApiContextOptions {
66
+ 'app_url'?: string;
67
+ 'sw-access-key'?: string;
68
+ 'sw-context-token'?: string;
69
+ ignoreHTTPSErrors?: boolean;
70
+ }
71
+ declare class StoreApiContext {
72
+ private context;
73
+ private readonly options;
74
+ private static readonly defaultOptions;
75
+ constructor(context: APIRequestContext, options: StoreApiContextOptions);
76
+ static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
77
+ private static createContext;
78
+ login(user: StoreUser): Promise<{
79
+ [key: string]: string;
80
+ }>;
81
+ get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
82
+ post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
83
+ patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
84
+ delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
85
+ fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
86
+ head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
87
+ }
88
+
89
+ interface ApiContextTypes {
90
+ AdminApiContext: AdminApiContext;
91
+ StoreApiContext: StoreApiContext;
92
+ }
93
+
94
+ interface PageContextTypes {
95
+ AdminPage: Page;
96
+ StorefrontPage: Page;
97
+ }
98
+
99
+ interface PageObject {
100
+ readonly page: Page;
101
+ goTo(): Promise<void>;
102
+ }
103
+
104
+ declare class Actor {
105
+ page: Page;
106
+ readonly name: string;
107
+ constructor(name: string, page: Page);
108
+ expects: _playwright_test.Expect<{}>;
109
+ attemptsTo(task: () => Promise<void>): Promise<void>;
110
+ goesTo(pageObject: PageObject): Promise<void>;
111
+ private camelCaseToLowerCase;
112
+ }
113
+
114
+ interface ActorFixtureTypes {
115
+ ShopCustomer: Actor;
116
+ ShopAdmin: Actor;
117
+ }
118
+
119
+ interface StoreBaseConfig {
120
+ storefrontTypeId: string;
121
+ enGBLocaleId: string;
122
+ enGBLanguageId: string;
123
+ eurCurrencyId: string;
124
+ invoicePaymentMethodId: string;
125
+ defaultShippingMethod: string;
126
+ taxId: string;
127
+ deCountryId: string;
128
+ enGBSnippetSetId: string;
129
+ defaultThemeId: string;
130
+ appUrl: string | undefined;
131
+ adminUrl: string;
132
+ }
133
+ interface DefaultSalesChannelTypes {
134
+ SalesChannelBaseConfig: StoreBaseConfig;
135
+ DefaultSalesChannel: {
136
+ salesChannel: components['schemas']['SalesChannel'];
137
+ customer: components['schemas']['Customer'] & {
138
+ password: string;
139
+ };
140
+ url: string;
141
+ };
142
+ }
143
+
144
+ declare class Home implements PageObject {
145
+ readonly page: Page;
146
+ readonly productImages: Locator;
147
+ constructor(page: Page);
148
+ goTo(): Promise<void>;
149
+ }
150
+
151
+ declare class ProductDetail$1 implements PageObject {
152
+ readonly page: Page;
153
+ readonly productData: components['schemas']['Product'];
154
+ readonly addToCartButton: Locator;
155
+ readonly offCanvasCartTitle: Locator;
156
+ readonly offCanvasCart: Locator;
157
+ readonly offCanvasCartGoToCheckoutButton: Locator;
158
+ readonly productSingleImage: Locator;
159
+ readonly offCanvasLineItemImages: Locator;
160
+ readonly quantitySelect: Locator;
161
+ readonly offCanvasSummaryTotalPrice: Locator;
162
+ readonly offCanvas: Locator;
163
+ constructor(page: Page, productData: components['schemas']['Product']);
164
+ goTo(productData?: components['schemas']['Product']): Promise<void>;
165
+ }
166
+
167
+ declare class CheckoutCart implements PageObject {
168
+ readonly page: Page;
169
+ readonly headline: Locator;
170
+ readonly goToCheckoutButton: Locator;
171
+ readonly enterDiscountInput: Locator;
172
+ readonly grandTotalPrice: Locator;
173
+ readonly emptyCartAlert: Locator;
174
+ readonly stockReachedAlert: Locator;
175
+ readonly cartLineItemImages: Locator;
176
+ readonly unitPriceInfo: Locator;
177
+ constructor(page: Page);
178
+ goTo(): Promise<void>;
179
+ }
180
+
181
+ declare class CheckoutConfirm implements PageObject {
182
+ readonly page: Page;
183
+ readonly headline: Locator;
184
+ readonly termsAndConditionsCheckbox: Locator;
185
+ readonly immediateAccessToDigitalProductCheckbox: Locator;
186
+ readonly grandTotalPrice: Locator;
187
+ readonly submitOrderButton: Locator;
188
+ /**
189
+ * Payment options
190
+ */
191
+ readonly paymentCashOnDelivery: Locator;
192
+ readonly paymentPaidInAdvance: Locator;
193
+ readonly paymentInvoice: Locator;
194
+ /**
195
+ * Shipping options
196
+ */
197
+ readonly shippingStandard: Locator;
198
+ readonly shippingExpress: Locator;
199
+ /**
200
+ * Product details
201
+ */
202
+ readonly cartLineItemImages: Locator;
203
+ constructor(page: Page);
204
+ goTo(): Promise<void>;
205
+ }
206
+
207
+ declare class CheckoutFinish implements PageObject {
208
+ readonly page: Page;
209
+ readonly headline: Locator;
210
+ readonly orderNumberText: Locator;
211
+ readonly grandTotalPrice: Locator;
212
+ readonly cartLineItemImages: Locator;
213
+ private readonly orderNumberRegex;
214
+ constructor(page: Page);
215
+ goTo(): Promise<void>;
216
+ getOrderNumber(): Promise<string | null>;
217
+ getOrderId(): string | null;
218
+ }
219
+
220
+ declare class CheckoutRegister implements PageObject {
221
+ readonly page: Page;
222
+ readonly cartLineItemImages: Locator;
223
+ constructor(page: Page);
224
+ goTo(): Promise<void>;
225
+ }
226
+
227
+ declare class Account implements PageObject {
228
+ readonly page: Page;
229
+ readonly headline: Locator;
230
+ readonly personalDataCardTitle: Locator;
231
+ constructor(page: Page);
232
+ goTo(): Promise<void>;
233
+ }
234
+
235
+ declare class AccountLogin implements PageObject {
236
+ readonly page: Page;
237
+ readonly emailInput: Locator;
238
+ readonly passwordInput: Locator;
239
+ readonly loginButton: Locator;
240
+ readonly logoutLink: Locator;
241
+ readonly successAlert: Locator;
242
+ readonly personalFormArea: Locator;
243
+ readonly billingAddressFormArea: Locator;
244
+ readonly firstNameInput: Locator;
245
+ readonly lastNameInput: Locator;
246
+ readonly registerEmailInput: Locator;
247
+ readonly registerPasswordInput: Locator;
248
+ readonly streetAddressInput: Locator;
249
+ readonly cityInput: Locator;
250
+ readonly countryInput: Locator;
251
+ readonly registerButton: Locator;
252
+ constructor(page: Page);
253
+ goTo(): Promise<void>;
254
+ }
255
+
256
+ declare class AccountOrder implements PageObject {
257
+ readonly page: Page;
258
+ readonly cartLineItemImages: Locator;
259
+ readonly orderExpandButton: Locator;
260
+ readonly digitalProductDownloadButton: Locator;
261
+ constructor(page: Page);
262
+ goTo(): Promise<void>;
263
+ }
264
+
265
+ declare class Search implements PageObject {
266
+ readonly page: Page;
267
+ readonly productImages: Locator;
268
+ constructor(page: Page);
269
+ goTo(): Promise<void>;
270
+ }
271
+
272
+ declare class SearchSuggest implements PageObject {
273
+ readonly page: Page;
274
+ readonly searchSuggestLineItemImages: Locator;
275
+ constructor(page: Page);
276
+ goTo(): Promise<void>;
277
+ }
278
+
279
+ interface StorefrontPageTypes {
280
+ StorefrontHome: Home;
281
+ StorefrontProductDetail: ProductDetail$1;
282
+ StorefrontCheckoutCart: CheckoutCart;
283
+ StorefrontCheckoutConfirm: CheckoutConfirm;
284
+ StorefrontCheckoutFinish: CheckoutFinish;
285
+ StorefrontCheckoutRegister: CheckoutRegister;
286
+ StorefrontAccount: Account;
287
+ StorefrontAccountLogin: AccountLogin;
288
+ StorefrontAccountOrder: AccountOrder;
289
+ StorefrontSearch: Search;
290
+ StorefrontSearchSuggest: SearchSuggest;
291
+ }
292
+ declare const StorefrontPageObjects: {
293
+ Home: typeof Home;
294
+ ProductDetail: typeof ProductDetail$1;
295
+ CheckoutCart: typeof CheckoutCart;
296
+ CheckoutConfirm: typeof CheckoutConfirm;
297
+ CheckoutFinish: typeof CheckoutFinish;
298
+ CheckoutRegister: typeof CheckoutRegister;
299
+ Account: typeof Account;
300
+ AccountLogin: typeof AccountLogin;
301
+ AccountOrder: typeof AccountOrder;
302
+ Search: typeof Search;
303
+ SearchSuggest: typeof SearchSuggest;
304
+ };
305
+
306
+ declare class ProductDetail implements PageObject {
307
+ readonly page: Page;
308
+ /**
309
+ * Save interactions
310
+ */
311
+ readonly savePhysicalProductButton: Locator;
312
+ readonly saveButtonLoadingSpinner: Locator;
313
+ readonly saveButtonCheckMark: Locator;
314
+ /**
315
+ * Media Upload interactions
316
+ */
317
+ readonly uploadMediaButton: Locator;
318
+ readonly coverImage: Locator;
319
+ readonly productImage: Locator;
320
+ /**
321
+ * Tabs
322
+ */
323
+ readonly variantsTabLink: Locator;
324
+ /**
325
+ * Variants Generation
326
+ */
327
+ readonly generateVariantsButton: Locator;
328
+ readonly variantsModal: Locator;
329
+ readonly variantsModalHeadline: Locator;
330
+ readonly variantsNextButton: Locator;
331
+ readonly variantsSaveButton: Locator;
332
+ /**
333
+ * Property Selection
334
+ */
335
+ readonly propertyGroupColor: Locator;
336
+ readonly propertyGroupSize: Locator;
337
+ readonly propertyOptionGrid: Locator;
338
+ readonly propertyOptionColorBlue: Locator;
339
+ readonly propertyOptionColorRed: Locator;
340
+ readonly propertyOptionColorGreen: Locator;
341
+ readonly propertyOptionSizeSmall: Locator;
342
+ readonly propertyOptionSizeMedium: Locator;
343
+ readonly propertyOptionSizeLarge: Locator;
344
+ readonly productData: components['schemas']['Product'];
345
+ constructor(page: Page, productData: components['schemas']['Product']);
346
+ goTo(): Promise<void>;
347
+ getProductId(): string | undefined;
348
+ }
349
+
350
+ declare class OrderDetail implements PageObject {
351
+ readonly page: Page;
352
+ readonly dataGridContextButton: Locator;
353
+ readonly orderTag: Locator;
354
+ private readonly orderData;
355
+ constructor(page: Page, orderData: components['schemas']['Order']);
356
+ goTo(): Promise<void>;
357
+ }
358
+
359
+ declare class CustomerDetail implements PageObject {
360
+ readonly page: Page;
361
+ readonly customerId: string | undefined;
362
+ readonly editButton: Locator;
363
+ readonly generalTab: Locator;
364
+ readonly accountCard: Locator;
365
+ constructor(page: Page, customer: components['schemas']['Customer']);
366
+ goTo(): Promise<void>;
367
+ }
368
+
369
+ declare class FirstRunWizard implements PageObject {
370
+ readonly page: Page;
371
+ readonly nextButton: Locator;
372
+ readonly configureLaterButton: Locator;
373
+ readonly skipButton: Locator;
374
+ readonly finishButton: Locator;
375
+ readonly backButton: Locator;
376
+ readonly smtpServerButton: Locator;
377
+ readonly dataImportHeader: Locator;
378
+ readonly installLanguagePackButton: Locator;
379
+ readonly installDemoDataButton: Locator;
380
+ readonly installMigrationAssistantButton: Locator;
381
+ readonly defaultValuesHeader: Locator;
382
+ readonly mailerConfigurationHeader: Locator;
383
+ readonly payPalSetupHeader: Locator;
384
+ readonly extensionsHeader: Locator;
385
+ readonly shopwareAccountHeader: Locator;
386
+ readonly shopwareStoreHeader: Locator;
387
+ readonly doneHeader: Locator;
388
+ readonly frwSuccessText: Locator;
389
+ readonly welcomeText: Locator;
390
+ readonly pluginCardInfo: Locator;
391
+ readonly dataImportCard: Locator;
392
+ readonly salesChannelSelectionList: Locator;
393
+ readonly salesChannelSelectionMultiSelect: Locator;
394
+ readonly smtpServerTitle: Locator;
395
+ readonly smtpServerFields: Locator;
396
+ readonly payPalPaymethods: Locator;
397
+ readonly payPalInfoCard: Locator;
398
+ readonly emailAddressInputField: Locator;
399
+ readonly passwordInputField: Locator;
400
+ readonly forgotPasswordLink: Locator;
401
+ readonly extensionStoreHeading: Locator;
402
+ readonly documentationLink: Locator;
403
+ readonly forumLink: Locator;
404
+ readonly roadmapLink: Locator;
405
+ readonly germanRegionSelector: Locator;
406
+ readonly toolsSelector: Locator;
407
+ readonly recommendationHeader: Locator;
408
+ readonly toolsRecommendedPlugin: Locator;
409
+ constructor(page: Page);
410
+ goTo(): Promise<void>;
411
+ }
412
+
413
+ declare class FlowBuilderCreate implements PageObject {
414
+ readonly page: Page;
415
+ readonly saveButton: Locator;
416
+ readonly header: Locator;
417
+ constructor(page: Page);
418
+ goTo(): Promise<void>;
419
+ }
420
+
421
+ declare class FlowBuilderListing implements PageObject {
422
+ readonly page: Page;
423
+ readonly firstFlowName: Locator;
424
+ readonly firstFlowContextButton: Locator;
425
+ readonly flowContextMenu: Locator;
426
+ readonly contextMenuDownload: Locator;
427
+ readonly flowDownloadModal: Locator;
428
+ readonly downloadFlowButton: Locator;
429
+ readonly successAlert: Locator;
430
+ readonly successAlertMessage: Locator;
431
+ constructor(page: Page);
432
+ goTo(): Promise<void>;
433
+ }
434
+
435
+ interface AdministrationPageTypes {
436
+ AdminProductDetail: ProductDetail;
437
+ AdminOrderDetail: OrderDetail;
438
+ AdminCustomerDetail: CustomerDetail;
439
+ AdminFirstRunWizard: FirstRunWizard;
440
+ AdminFlowBuilderCreate: FlowBuilderCreate;
441
+ AdminFlowBuilderListing: FlowBuilderListing;
442
+ }
443
+ declare const AdminPageObjects: {
444
+ ProductDetail: typeof ProductDetail;
445
+ OrderDetail: typeof OrderDetail;
446
+ CustomerDetail: typeof CustomerDetail;
447
+ FirstRunWizard: typeof FirstRunWizard;
448
+ FlowBuilderCreate: typeof FlowBuilderCreate;
449
+ FlowBuilderListing: typeof FlowBuilderListing;
450
+ };
451
+
452
+ interface DataFixtureTypes {
453
+ ProductData: components['schemas']['Product'];
454
+ DigitalProductData: {
455
+ product: components['schemas']['Product'];
456
+ fileContent: string;
457
+ };
458
+ PromotionWithCodeData: components['schemas']['Promotion'];
459
+ CartWithProductData: Record<string, unknown>;
460
+ PropertiesData: {
461
+ propertyGroupColor: components['schemas']['PropertyGroup'];
462
+ propertyGroupSize: components['schemas']['PropertyGroup'];
463
+ };
464
+ MediaData: components['schemas']['Media'];
465
+ OrderData: components['schemas']['Order'];
466
+ TagData: components['schemas']['Tag'];
467
+ }
468
+
469
+ interface FixtureTypes extends ApiContextTypes, PageContextTypes, ActorFixtureTypes, HelperFixtureTypes, DefaultSalesChannelTypes, StorefrontPageTypes, AdministrationPageTypes, DataFixtureTypes {
470
+ }
471
+
472
+ declare const getLanguageData: (languageCode: string, adminApiContext: AdminApiContext) => Promise<{
473
+ id: string;
474
+ localeId: string;
475
+ }>;
476
+ declare const getSnippetSetId: (languageCode: string, adminApiContext: AdminApiContext) => Promise<string>;
477
+ declare const getCurrency: (isoCode: 'EUR', adminApiContext: AdminApiContext) => Promise<any>;
478
+ declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
479
+ declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
480
+ declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
481
+ declare const getCountryId: (iso2: string, adminApiContext: AdminApiContext) => Promise<string>;
482
+ declare const getThemeId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
483
+ declare const getSalutationId: (salutationKey: string, adminApiContext: AdminApiContext) => Promise<string>;
484
+ declare const getStateMachineId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
485
+ declare const getStateMachineStateId: (stateMachineId: string, adminApiContext: AdminApiContext) => Promise<string>;
486
+ declare const getFlowId: (eventName: string, adminApiContext: AdminApiContext) => Promise<{
487
+ id: string;
488
+ }>;
489
+ declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApiContext) => Promise<{
490
+ id: string;
491
+ }>;
492
+ declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>;
493
+ declare function extractIdFromUrl(url: string): string | null;
494
+
495
+ declare function createRandomImage(width?: number, height?: number): Image;
496
+
497
+ declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArgs & _playwright_test.PlaywrightTestOptions & FixtureTypes & {
498
+ SaveProduct: Task;
499
+ } & {
500
+ Login: Task;
501
+ } & {
502
+ Logout: Task;
503
+ } & {
504
+ Register: Task;
505
+ } & {
506
+ AddProductToCart: Task;
507
+ } & {
508
+ ProceedFromProductToCheckout: Task;
509
+ } & {
510
+ ProceedFromCartToCheckout: Task;
511
+ } & {
512
+ ConfirmTermsAndConditions: Task;
513
+ } & {
514
+ SelectInvoicePaymentOption: Task;
515
+ } & {
516
+ SelectCashOnDeliveryPaymentOption: Task;
517
+ } & {
518
+ SelectPaidInAdvancePaymentOption: Task;
519
+ } & {
520
+ SelectStandardShippingOption: Task;
521
+ } & {
522
+ SelectExpressShippingOption: Task;
523
+ } & {
524
+ SubmitOrder: Task;
525
+ } & {
526
+ OpenSearchResultPage: Task;
527
+ } & {
528
+ OpenSearchSuggestPage: Task;
529
+ }, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & HelperFixtureTypes & FixtureTypes>;
530
+
531
+ 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, test };