@shopware-ag/acceptance-test-suite 12.14.0 → 12.15.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/dist/index.d.mts CHANGED
@@ -1,21 +1,13 @@
1
+ import { components } from '@shopware/api-client/admin-api-types';
2
+ import * as playwright_core from 'playwright-core';
3
+ import { APIRequestContext, APIResponse, BrowserContext, Page, Locator } from 'playwright-core';
4
+ export { APIRequestContext, APIResponse, BrowserContext, Locator, Page, Request } from 'playwright-core';
1
5
  import * as axe_core from 'axe-core';
2
6
  import * as playwright_test from '@playwright/test';
3
7
  import { Page as Page$1, Locator as Locator$1, Browser } from '@playwright/test';
4
8
  export { expect, mergeTests } from '@playwright/test';
5
- import * as playwright_core from 'playwright-core';
6
- import { APIRequestContext, APIResponse, Page, Locator, BrowserContext } from 'playwright-core';
7
- export { APIRequestContext, APIResponse, BrowserContext, Locator, Page, Request } from 'playwright-core';
8
- import { components } from '@shopware/api-client/admin-api-types';
9
9
  import { Image } from 'image-js';
10
10
 
11
- declare global {
12
- namespace PlaywrightTest {
13
- interface Matchers<R> {
14
- toHaveVisibleFocus(): Promise<R>;
15
- }
16
- }
17
- }
18
-
19
11
  interface RequestOptions$1<PAYLOAD> {
20
12
  [key: string]: unknown;
21
13
  data?: PAYLOAD;
@@ -54,6 +46,99 @@ declare class AdminApiContext {
54
46
  private handleRequest;
55
47
  }
56
48
 
49
+ interface RequestOptions<PAYLOAD> {
50
+ [key: string]: unknown;
51
+ data?: PAYLOAD;
52
+ }
53
+ interface StoreUser {
54
+ email: string;
55
+ password: string;
56
+ }
57
+ interface StoreApiContextOptions {
58
+ app_url?: string;
59
+ "sw-access-key"?: string;
60
+ "sw-context-token"?: string;
61
+ ignoreHTTPSErrors?: boolean;
62
+ }
63
+ declare class StoreApiContext {
64
+ private context;
65
+ private readonly options;
66
+ private static readonly defaultOptions;
67
+ constructor(context: APIRequestContext, options: StoreApiContextOptions);
68
+ static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
69
+ private static createContext;
70
+ login(user: StoreUser): Promise<{
71
+ [key: string]: string;
72
+ }>;
73
+ get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
74
+ post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
75
+ patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
76
+ delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
77
+ fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
78
+ head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
79
+ }
80
+
81
+ interface Email {
82
+ fromName: string;
83
+ fromAddress: string;
84
+ toName: string;
85
+ toAddress: string;
86
+ subject: string;
87
+ emailId: string;
88
+ }
89
+ declare class MailpitApiContext {
90
+ context: APIRequestContext;
91
+ constructor(context: APIRequestContext);
92
+ /**
93
+ * Fetches email headers based on the recipient's email address.
94
+ * @param email - The email address of the recipient.
95
+ * @returns An Email object containing the email headers.
96
+ */
97
+ getEmailHeaders(email: string): Promise<Email>;
98
+ /**
99
+ * Retrieves the body content of the email as an HTML string.
100
+ * @param email - The email address of the recipient.
101
+ * @returns A promise that resolves to the HTML content of the email.
102
+ */
103
+ getEmailBody(email: string): Promise<string>;
104
+ /**
105
+ * Generates the full email content, combining headers and body.
106
+ * @param email - The email address to fetch headers for.
107
+ * @returns A promise that resolves to the full email content as a string.
108
+ */
109
+ generateEmailContent(email: string): Promise<string>;
110
+ /**
111
+ * Retrieves the plain text content of the email.
112
+ * @param email - The email address of the recipient.
113
+ * @returns A promise that resolves to the plain text content of the email.
114
+ */
115
+ getRenderMessageTxt(email: string): Promise<string>;
116
+ /**
117
+ * Extracts the first URL found in the plain text content of the latest email.
118
+ * @param email - The email address of the recipient.
119
+ * @returns A promise that resolves to the first URL found in the email content.
120
+ * @throws An error if no URL is found in the email content.
121
+ */
122
+ getLinkFromMail(email: string): Promise<string>;
123
+ /**
124
+ * Deletes a specific email by ID if provided, or deletes all emails if no ID is provided.
125
+ * @param emailId - The ID of the email to delete (optional).
126
+ */
127
+ deleteMail(emailId?: string): Promise<void>;
128
+ /**
129
+ * Creates a new MailpitApiContext instance with the appropriate configuration.
130
+ * @param baseURL - The base URL for the API.
131
+ * @returns A promise that resolves to a MailpitApiContext instance.
132
+ */
133
+ static create(baseURL: string): Promise<MailpitApiContext>;
134
+ }
135
+
136
+ interface ApiContextTypes {
137
+ AdminApiContext: AdminApiContext;
138
+ StoreApiContext: StoreApiContext;
139
+ MailpitApiContext: MailpitApiContext;
140
+ }
141
+
57
142
  type SalesChannel = components["schemas"]["SalesChannel"] & {
58
143
  id: string;
59
144
  };
@@ -382,125 +467,38 @@ interface Flow {
382
467
  ];
383
468
  }
384
469
 
385
- declare const COUNTRY_ADDRESS_DATA: {
386
- DE: {
387
- street: string;
388
- city: string;
389
- country: string;
390
- postalCode: string;
391
- vatRegNo: string;
392
- };
393
- US: {
394
- street: string;
395
- city: string;
396
- country: string;
397
- postalCode: string;
398
- vatRegNo: string;
399
- };
400
- GB: {
401
- street: string;
402
- city: string;
403
- country: string;
404
- postalCode: string;
405
- vatRegNo: string;
406
- };
407
- };
408
- declare const getCountryAddressData: (countryCode?: string) => {
409
- street: string;
410
- city: string;
411
- country: string;
412
- postalCode: string;
413
- vatRegNo: string;
414
- };
415
- declare const getLocale: () => string;
416
- declare const getLanguageCode: (locale?: string) => string;
417
- declare const getCountryCodeFromLocale: (locale?: string) => string;
418
- declare const getCurrencyCodeFromLocale: (locale?: string) => string;
419
- declare const getCurrencySymbolFromLocale: (locale?: string) => string;
420
- declare const formatPrice: (price: number, locale?: string, currencyCode?: string) => string;
421
- type Language$1 = components["schemas"]["Language"] & {
422
- id: string;
423
- translationCode: components["schemas"]["Locale"] & {
424
- id: string;
425
- };
426
- };
427
- declare const getLanguageData: (adminApiContext: AdminApiContext, languageCode?: string) => Promise<Language$1>;
428
- declare const getSnippetSetId: (adminApiContext: AdminApiContext, languageCode?: string) => Promise<string>;
429
- type Currency$1 = components["schemas"]["Currency"] & {
430
- id: string;
431
- };
432
- declare const getCurrency: (adminApiContext: AdminApiContext, isoCode?: string) => Promise<Currency$1>;
433
- declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
434
- declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
435
- /**
436
- * Gives the default shipping method back called Standard
437
- * @param adminApiContext - An AdminApiContext entity
438
- *
439
- * @deprecated - Use getShippingMethodId instead
440
- */
441
- declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
442
- declare const getShippingMethodId: (name: string, adminApiContext: AdminApiContext) => Promise<string>;
443
- declare const getCountryId: (iso2: string, adminApiContext: AdminApiContext) => Promise<string>;
444
- declare const getThemeId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
445
- declare const getSalutationId: (salutationKey: string, adminApiContext: AdminApiContext) => Promise<string>;
446
- declare const getStateMachineId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
447
- declare const getStateMachineStateId: (stateMachineId: string, adminApiContext: AdminApiContext) => Promise<string>;
448
- declare const getFlowId: (flowName: string, adminApiContext: AdminApiContext) => Promise<string>;
449
- declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApiContext) => Promise<{
450
- id: string;
451
- }>;
452
- declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>;
453
- declare const getFlowTemplate: (flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<FlowTemplate>;
454
- declare const getFlow: (flowId: string, adminApiContext: AdminApiContext) => Promise<Flow>;
455
- declare const compareFlowTemplateWithFlow: (flowId: string, flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<boolean>;
456
- declare function extractIdFromUrl(url: string): string | null;
457
- type OrderStatus = "cancel" | "complete" | "reopen" | "process";
458
- declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
459
- /**
460
- * Return a single promotion entity with a fetched single discount entity
461
- */
462
- declare const getPromotionWithDiscount: (promotionId: string, adminApiContext: AdminApiContext) => Promise<Promotion>;
463
- declare const updateAdminUser: (adminUserId: string, adminApiContext: AdminApiContext, data: Record<string, string | boolean>) => Promise<void>;
464
-
465
- interface RequestOptions<PAYLOAD> {
466
- [key: string]: unknown;
467
- data?: PAYLOAD;
468
- }
469
- interface StoreUser {
470
- email: string;
471
- password: string;
472
- }
473
- interface StoreApiContextOptions {
474
- app_url?: string;
475
- "sw-access-key"?: string;
476
- "sw-context-token"?: string;
477
- ignoreHTTPSErrors?: boolean;
470
+ interface AdminSession {
471
+ context: BrowserContext;
472
+ user: User;
478
473
  }
479
- declare class StoreApiContext {
480
- private context;
481
- private readonly options;
482
- private static readonly defaultOptions;
483
- constructor(context: APIRequestContext, options: StoreApiContextOptions);
484
- static create(options?: StoreApiContextOptions): Promise<StoreApiContext>;
485
- private static createContext;
486
- login(user: StoreUser): Promise<{
487
- [key: string]: string;
488
- }>;
489
- get<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
490
- post<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
491
- patch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
492
- delete<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
493
- fetch<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
494
- head<PAYLOAD>(url: string, options?: RequestOptions<PAYLOAD>): Promise<APIResponse>;
474
+ interface PageContextTypes {
475
+ AdminSession: AdminSession;
476
+ AdminPage: Page;
477
+ StorefrontPage: Page;
478
+ InstallPage: Page;
479
+ page: Page;
480
+ context: BrowserContext;
495
481
  }
496
482
 
497
- declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
498
- declare const isPaaSInstance: () => boolean;
499
- declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>;
483
+ declare class Actor {
484
+ page: Page;
485
+ readonly name: string;
486
+ baseURL: string | undefined;
487
+ constructor(name: string, page: Page, baseURL?: string);
488
+ expects: playwright_test.Expect<{}>;
489
+ a11y_checks(locator: Locator): Promise<void>;
490
+ fillsIn(locator: Locator, input: string): Promise<void>;
491
+ presses(locator: Locator, key?: string): Promise<void>;
492
+ selectsRadioButton(radioGroup: Locator, inputLabel: string): Promise<void>;
493
+ attemptsTo(task: () => Promise<void>): Promise<void>;
494
+ goesTo(url: string, forceReload?: boolean): Promise<void>;
495
+ private camelCaseToLowerCase;
496
+ }
500
497
 
501
- declare function createRandomImage(width?: number, height?: number): Image;
502
- declare function createSolidColorImage(width?: number, height?: number, color?: [number, number, number]): Image;
503
- declare function encodeImage(image: Image): Buffer<ArrayBuffer>;
498
+ interface ActorFixtureTypes {
499
+ ShopCustomer: Actor;
500
+ ShopAdmin: Actor;
501
+ }
504
502
 
505
503
  interface IdPair {
506
504
  id: string;
@@ -615,6 +613,10 @@ declare class TestDataService {
615
613
  * Creates a digital product with a text file as its download.
616
614
  * The product will be added to the default sales channel category if configured.
617
615
  *
616
+ * Digital products default to `maxPurchase: 1`, mirroring the Administration
617
+ * which forces this limit when a product is created as a digital type.
618
+ * Pass `maxPurchase` in the overrides to change it.
619
+ *
618
620
  * @param content - The content of the text file for the product download.
619
621
  * @param overrides - Specific data overrides that will be applied to the product data struct.
620
622
  * @param taxId - The uuid of the tax rule to use for the product pricing.
@@ -1259,76 +1261,9 @@ declare class TestDataService {
1259
1261
  getBasicProductReviewStruct(productId: string, overrides?: Partial<ProductReview>): Partial<ProductReview>;
1260
1262
  }
1261
1263
 
1262
- /**
1263
- * Hides elements (via `visibility: hidden`).
1264
- */
1265
- declare function hideElements(page: Page, selectors: (string | Locator)[]): Promise<void>;
1266
- /**
1267
- * Replaces text content or input values of elements with a given replacement string (default: "***").
1268
- * - Works for inputs, textareas, contenteditables and generic elements.
1269
- * - Ensures frameworks see the change (dispatches input/change).
1270
- * - Also masks placeholder so empty fields show replacement text in screenshots.
1271
- */
1272
- declare function replaceElements(page: Page, selectors: (string | Locator)[], replaceWith?: string): Promise<void>;
1273
- interface ReplaceTarget {
1274
- selector: string | Locator;
1275
- replaceWith?: string;
1276
- }
1277
- /**
1278
- * Replaces elements individually based on an array of targets.
1279
- *
1280
- *@param page - Playwright page
1281
- *@param targets - Array of objects containing selectors and optional replacement strings.
1282
- */
1283
- declare function replaceElementsIndividually(page: Page, targets: ReplaceTarget[]): Promise<void>;
1284
- /**
1285
- * Calculates the ideal viewport dimensions for a Playwright test based on scrollable content,
1286
- * header visibility, and optional configuration. Useful for dynamic screenshot sizing or
1287
- * testing long-scrolling pages.
1288
- *
1289
- * This function:
1290
- * - Optionally waits for a network request (`requestURL`) before continuing.
1291
- * - Optionally waits for a specific locator (`waitForLocator`) to become visible.
1292
- * - Measures scrollable content height (`scrollableElementVertical`) and header height.
1293
- * - Measures scrollable content width (`scrollableElementHorizontal`).
1294
- * - Falls back to defaults if elements are not found or inaccessible.
1295
- *
1296
- * @param {Page} page - The Playwright `Page` object representing the current browser tab.
1297
- * @param {Options} [options] - Optional configuration to override default behavior.
1298
- * @param {string} [options.requestURL] - A URL substring to wait for via `waitForResponse`.
1299
- * @param {number} [options.width] - Base viewport width to use (default: 1440).
1300
- * @param {string | Locator} [options.scrollableElementVertical] - Selector or Locator for vertical scroll container.
1301
- * @param {string | Locator} [options.scrollableElementHorizontal] - Selector or Locator for horizontal scroll container.
1302
- * @param {number} [options.additionalHeight] - Extra height to add (e.g., to avoid cut-off).
1303
- * @param {string | Locator} [options.waitForSelector] - A selector or Locator to wait for visibility before measuring.
1304
- * @param {number} [options.contentHeight] - Default vertical height fallback if measurement fails.
1305
- * @param {number} [options.headerHeight] - Default header height fallback.
1306
- * @param {string} [options.headerElement] - Selector for a header element whose height should be added if outside scrollable container.
1307
- *
1308
- * @returns {Promise<{ contentWidth: number; totalHeight: number }>} - A Promise resolving to the measured dimensions:
1309
- * - `contentWidth`: the horizontal scroll width or fallback.
1310
- * - `totalHeight`: sum of content height, header height, and any additional height.
1311
- */
1312
- interface Options {
1313
- requestURL?: string;
1314
- width?: number;
1315
- scrollableElementVertical?: string | Locator;
1316
- scrollableElementHorizontal?: string | Locator;
1317
- additionalHeight?: number;
1318
- waitForSelector?: string | Locator;
1319
- contentHeight?: number;
1320
- headerHeight?: number;
1321
- headerElement?: string;
1264
+ interface TestDataFixtureTypes {
1265
+ TestDataService: TestDataService;
1322
1266
  }
1323
- declare function setViewport(page: Page, options?: Options): Promise<void>;
1324
- /**
1325
- * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
1326
- *
1327
- * @param page - Playwright page object
1328
- * @param filename - Filename of the screenshot
1329
- * @param locator - Optional Playwright locator to take a screenshot of instead of the desktop content
1330
- */
1331
- declare function assertScreenshot(page: Page, filename: string, locator?: Locator): Promise<void>;
1332
1267
 
1333
1268
  declare const BUNDLED_RESOURCES: {
1334
1269
  readonly en: {
@@ -4413,184 +4348,55 @@ declare const baseNamespaces: {
4413
4348
  title: string;
4414
4349
  message: string;
4415
4350
  backToShop: string;
4416
- };
4417
- readonly payment: {
4418
- methods: {
4419
- cashOnDelivery: string;
4420
- paidInAdvance: string;
4421
- invoice: string;
4422
- };
4423
- actions: {
4424
- change: string;
4425
- completePayment: string;
4426
- };
4427
- };
4428
- readonly recover: {
4429
- passwordRecovery: string;
4430
- subtitle: string;
4431
- requestEmail: string;
4432
- back: string;
4433
- emailSent: string;
4434
- newPassword: string;
4435
- passwordConfirmation: string;
4436
- changePassword: string;
4437
- invalidLink: string;
4438
- };
4439
- readonly offCanvasCart: {
4440
- general: {
4441
- title: string;
4442
- };
4443
- buttons: {
4444
- goToCheckout: string;
4445
- goToCart: string;
4446
- continueShopping: string;
4447
- };
4448
- };
4449
- readonly wishlist: {
4450
- removeProduct: string;
4451
- };
4452
- };
4453
- };
4454
-
4455
- /** Flatten nested JSON keys to "a.b.c" */
4456
- type Paths<T> = T extends object ? {
4457
- [K in keyof T & string]: T[K] extends object ? `${K}` | `${K}.${Paths<T[K]>}` : K;
4458
- }[keyof T & string] : never;
4459
- type TranslationKey<TNamespaces = typeof baseNamespaces> = TNamespaces extends Record<string, unknown> ? {
4460
- [A in keyof TNamespaces]: {
4461
- [N in keyof TNamespaces[A]]: `${A & string}:${N & string}:${Paths<TNamespaces[A][N]>}`;
4462
- }[keyof TNamespaces[A]];
4463
- }[keyof TNamespaces] : never;
4464
- type TranslateFn<TKey extends string = TranslationKey> = (key: TKey, options?: Record<string, unknown>) => string;
4465
-
4466
- declare class LanguageHelper {
4467
- private readonly i18nInstance;
4468
- private currentLng;
4469
- private readonly fallbackLng;
4470
- private readonly resources;
4471
- private constructor();
4472
- getLanguage(): string;
4473
- setLanguage(rawLanguage: string): Promise<void>;
4474
- translate(key: TranslationKey, options?: Record<string, unknown>): string;
4475
- static createInstance(rawLanguage: string, customResources?: typeof BUNDLED_RESOURCES): Promise<LanguageHelper>;
4476
- static setForContext(context: Record<string, unknown>, instance: LanguageHelper): void;
4477
- static getFromContext(context: Record<string, unknown>): LanguageHelper | undefined;
4478
- }
4479
- declare function setCurrentContext(context: Record<string, unknown> | null): void;
4480
- declare function getCurrentContext(): Record<string, unknown> | null;
4481
- declare function translate(key: TranslationKey, options?: Record<string, unknown>): string;
4482
-
4483
- /**
4484
- * Service to interact with feature flags
4485
- */
4486
- declare class FeatureService {
4487
- private readonly apiContext;
4488
- private features;
4489
- private resetFeatures;
4490
- constructor(apiContext: AdminApiContext);
4491
- enable(name: string | string[]): Promise<void>;
4492
- disable(name: string | string[]): Promise<void>;
4493
- isEnabled(name: string): Promise<boolean>;
4494
- private loadFeatures;
4495
- cleanup(): Promise<void>;
4496
- }
4497
-
4498
- declare const clearDelayedCache: (adminApiContext: AdminApiContext) => Promise<void>;
4499
-
4500
- declare function mockApiCalls(page: Page): Promise<void>;
4501
-
4502
- declare class Actor {
4503
- page: Page;
4504
- readonly name: string;
4505
- baseURL: string | undefined;
4506
- constructor(name: string, page: Page, baseURL?: string);
4507
- expects: playwright_test.Expect<{}>;
4508
- a11y_checks(locator: Locator): Promise<void>;
4509
- fillsIn(locator: Locator, input: string): Promise<void>;
4510
- presses(locator: Locator, key?: string): Promise<void>;
4511
- selectsRadioButton(radioGroup: Locator, inputLabel: string): Promise<void>;
4512
- attemptsTo(task: () => Promise<void>): Promise<void>;
4513
- goesTo(url: string, forceReload?: boolean): Promise<void>;
4514
- private camelCaseToLowerCase;
4515
- }
4516
-
4517
- interface Email {
4518
- fromName: string;
4519
- fromAddress: string;
4520
- toName: string;
4521
- toAddress: string;
4522
- subject: string;
4523
- emailId: string;
4524
- }
4525
- declare class MailpitApiContext {
4526
- context: APIRequestContext;
4527
- constructor(context: APIRequestContext);
4528
- /**
4529
- * Fetches email headers based on the recipient's email address.
4530
- * @param email - The email address of the recipient.
4531
- * @returns An Email object containing the email headers.
4532
- */
4533
- getEmailHeaders(email: string): Promise<Email>;
4534
- /**
4535
- * Retrieves the body content of the email as an HTML string.
4536
- * @param email - The email address of the recipient.
4537
- * @returns A promise that resolves to the HTML content of the email.
4538
- */
4539
- getEmailBody(email: string): Promise<string>;
4540
- /**
4541
- * Generates the full email content, combining headers and body.
4542
- * @param email - The email address to fetch headers for.
4543
- * @returns A promise that resolves to the full email content as a string.
4544
- */
4545
- generateEmailContent(email: string): Promise<string>;
4546
- /**
4547
- * Retrieves the plain text content of the email.
4548
- * @param email - The email address of the recipient.
4549
- * @returns A promise that resolves to the plain text content of the email.
4550
- */
4551
- getRenderMessageTxt(email: string): Promise<string>;
4552
- /**
4553
- * Extracts the first URL found in the plain text content of the latest email.
4554
- * @param email - The email address of the recipient.
4555
- * @returns A promise that resolves to the first URL found in the email content.
4556
- * @throws An error if no URL is found in the email content.
4557
- */
4558
- getLinkFromMail(email: string): Promise<string>;
4559
- /**
4560
- * Deletes a specific email by ID if provided, or deletes all emails if no ID is provided.
4561
- * @param emailId - The ID of the email to delete (optional).
4562
- */
4563
- deleteMail(emailId?: string): Promise<void>;
4564
- /**
4565
- * Creates a new MailpitApiContext instance with the appropriate configuration.
4566
- * @param baseURL - The base URL for the API.
4567
- * @returns A promise that resolves to a MailpitApiContext instance.
4568
- */
4569
- static create(baseURL: string): Promise<MailpitApiContext>;
4570
- }
4571
-
4572
- interface ApiContextTypes {
4573
- AdminApiContext: AdminApiContext;
4574
- StoreApiContext: StoreApiContext;
4575
- MailpitApiContext: MailpitApiContext;
4576
- }
4577
-
4578
- interface PageContextTypes {
4579
- AdminPage: Page;
4580
- StorefrontPage: Page;
4581
- InstallPage: Page;
4582
- page: Page;
4583
- context: BrowserContext;
4584
- }
4585
-
4586
- interface ActorFixtureTypes {
4587
- ShopCustomer: Actor;
4588
- ShopAdmin: Actor;
4589
- }
4351
+ };
4352
+ readonly payment: {
4353
+ methods: {
4354
+ cashOnDelivery: string;
4355
+ paidInAdvance: string;
4356
+ invoice: string;
4357
+ };
4358
+ actions: {
4359
+ change: string;
4360
+ completePayment: string;
4361
+ };
4362
+ };
4363
+ readonly recover: {
4364
+ passwordRecovery: string;
4365
+ subtitle: string;
4366
+ requestEmail: string;
4367
+ back: string;
4368
+ emailSent: string;
4369
+ newPassword: string;
4370
+ passwordConfirmation: string;
4371
+ changePassword: string;
4372
+ invalidLink: string;
4373
+ };
4374
+ readonly offCanvasCart: {
4375
+ general: {
4376
+ title: string;
4377
+ };
4378
+ buttons: {
4379
+ goToCheckout: string;
4380
+ goToCart: string;
4381
+ continueShopping: string;
4382
+ };
4383
+ };
4384
+ readonly wishlist: {
4385
+ removeProduct: string;
4386
+ };
4387
+ };
4388
+ };
4590
4389
 
4591
- interface TestDataFixtureTypes {
4592
- TestDataService: TestDataService;
4593
- }
4390
+ /** Flatten nested JSON keys to "a.b.c" */
4391
+ type Paths<T> = T extends object ? {
4392
+ [K in keyof T & string]: T[K] extends object ? `${K}` | `${K}.${Paths<T[K]>}` : K;
4393
+ }[keyof T & string] : never;
4394
+ type TranslationKey<TNamespaces = typeof baseNamespaces> = TNamespaces extends Record<string, unknown> ? {
4395
+ [A in keyof TNamespaces]: {
4396
+ [N in keyof TNamespaces[A]]: `${A & string}:${N & string}:${Paths<TNamespaces[A][N]>}`;
4397
+ }[keyof TNamespaces[A]];
4398
+ }[keyof TNamespaces] : never;
4399
+ type TranslateFn<TKey extends string = TranslationKey> = (key: TKey, options?: Record<string, unknown>) => string;
4594
4400
 
4595
4401
  type FeaturesType = Record<string, boolean>;
4596
4402
  interface HelperFixtureTypes {
@@ -4609,10 +4415,10 @@ interface HelperFixtureTypes {
4609
4415
  interface Country {
4610
4416
  id: string;
4611
4417
  }
4612
- interface Currency {
4418
+ interface Currency$1 {
4613
4419
  id: string;
4614
4420
  }
4615
- interface Language {
4421
+ interface Language$1 {
4616
4422
  id: string;
4617
4423
  translationCode: {
4618
4424
  id: string;
@@ -4635,8 +4441,8 @@ interface Theme {
4635
4441
  }
4636
4442
  interface ShopwareDataFixtureTypes {
4637
4443
  Country: Country;
4638
- Currency: Currency;
4639
- Language: Language;
4444
+ Currency: Currency$1;
4445
+ Language: Language$1;
4640
4446
  PaymentMethod: PaymentMethod;
4641
4447
  ShippingMethod: ShippingMethod;
4642
4448
  SnippetSet: SnippetSet;
@@ -5509,7 +5315,7 @@ declare class CustomerGroupListing implements PageObject {
5509
5315
  readonly page: Page;
5510
5316
  constructor(page: Page);
5511
5317
  getCustomerGroupByName(customerGroup: string): Promise<Record<string, Locator>>;
5512
- url(): string;
5318
+ url(searchTerms?: string[], page?: number): string;
5513
5319
  }
5514
5320
 
5515
5321
  declare class CustomerGroupCreate implements PageObject {
@@ -6654,6 +6460,21 @@ interface DataFixtureTypes {
6654
6460
  TagData: components["schemas"]["Tag"];
6655
6461
  }
6656
6462
 
6463
+ /**
6464
+ * Service to interact with feature flags
6465
+ */
6466
+ declare class FeatureService {
6467
+ private readonly apiContext;
6468
+ private features;
6469
+ private resetFeatures;
6470
+ constructor(apiContext: AdminApiContext);
6471
+ enable(name: string | string[]): Promise<void>;
6472
+ disable(name: string | string[]): Promise<void>;
6473
+ isEnabled(name: string): Promise<boolean>;
6474
+ private loadFeatures;
6475
+ cleanup(): Promise<void>;
6476
+ }
6477
+
6657
6478
  interface FeatureFixtureTypes {
6658
6479
  FeatureService: FeatureService;
6659
6480
  }
@@ -6691,6 +6512,194 @@ interface DefaultSalesChannelTypes {
6691
6512
  };
6692
6513
  }
6693
6514
 
6515
+ declare global {
6516
+ namespace PlaywrightTest {
6517
+ interface Matchers<R> {
6518
+ toHaveVisibleFocus(): Promise<R>;
6519
+ }
6520
+ }
6521
+ }
6522
+
6523
+ declare const COUNTRY_ADDRESS_DATA: {
6524
+ DE: {
6525
+ street: string;
6526
+ city: string;
6527
+ country: string;
6528
+ postalCode: string;
6529
+ vatRegNo: string;
6530
+ };
6531
+ US: {
6532
+ street: string;
6533
+ city: string;
6534
+ country: string;
6535
+ postalCode: string;
6536
+ vatRegNo: string;
6537
+ };
6538
+ GB: {
6539
+ street: string;
6540
+ city: string;
6541
+ country: string;
6542
+ postalCode: string;
6543
+ vatRegNo: string;
6544
+ };
6545
+ };
6546
+ declare const getCountryAddressData: (countryCode?: string) => {
6547
+ street: string;
6548
+ city: string;
6549
+ country: string;
6550
+ postalCode: string;
6551
+ vatRegNo: string;
6552
+ };
6553
+ declare const getLocale: () => string;
6554
+ declare const getLanguageCode: (locale?: string) => string;
6555
+ declare const getCountryCodeFromLocale: (locale?: string) => string;
6556
+ declare const getCurrencyCodeFromLocale: (locale?: string) => string;
6557
+ declare const getCurrencySymbolFromLocale: (locale?: string) => string;
6558
+ declare const formatPrice: (price: number, locale?: string, currencyCode?: string) => string;
6559
+ type Language = components["schemas"]["Language"] & {
6560
+ id: string;
6561
+ translationCode: components["schemas"]["Locale"] & {
6562
+ id: string;
6563
+ };
6564
+ };
6565
+ declare const getLanguageData: (adminApiContext: AdminApiContext, languageCode?: string) => Promise<Language>;
6566
+ declare const getSnippetSetId: (adminApiContext: AdminApiContext, languageCode?: string) => Promise<string>;
6567
+ type Currency = components["schemas"]["Currency"] & {
6568
+ id: string;
6569
+ };
6570
+ declare const getCurrency: (adminApiContext: AdminApiContext, isoCode?: string) => Promise<Currency>;
6571
+ declare const getTaxId: (adminApiContext: AdminApiContext) => Promise<string>;
6572
+ declare const getPaymentMethodId: (adminApiContext: AdminApiContext, handlerId?: string) => Promise<string>;
6573
+ /**
6574
+ * Gives the default shipping method back called Standard
6575
+ * @param adminApiContext - An AdminApiContext entity
6576
+ *
6577
+ * @deprecated - Use getShippingMethodId instead
6578
+ */
6579
+ declare const getDefaultShippingMethodId: (adminApiContext: AdminApiContext) => Promise<string>;
6580
+ declare const getShippingMethodId: (name: string, adminApiContext: AdminApiContext) => Promise<string>;
6581
+ declare const getCountryId: (iso2: string, adminApiContext: AdminApiContext) => Promise<string>;
6582
+ declare const getThemeId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
6583
+ declare const getSalutationId: (salutationKey: string, adminApiContext: AdminApiContext) => Promise<string>;
6584
+ declare const getStateMachineId: (technicalName: string, adminApiContext: AdminApiContext) => Promise<string>;
6585
+ declare const getStateMachineStateId: (stateMachineId: string, adminApiContext: AdminApiContext) => Promise<string>;
6586
+ declare const getFlowId: (flowName: string, adminApiContext: AdminApiContext) => Promise<string>;
6587
+ declare const getOrderTransactionId: (orderId: string, adminApiContext: AdminApiContext) => Promise<{
6588
+ id: string;
6589
+ }>;
6590
+ declare const getMediaId: (fileName: string, adminApiContext: AdminApiContext) => Promise<string>;
6591
+ declare const getFlowTemplate: (flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<FlowTemplate>;
6592
+ declare const getFlow: (flowId: string, adminApiContext: AdminApiContext) => Promise<Flow>;
6593
+ declare const compareFlowTemplateWithFlow: (flowId: string, flowTemplateId: string, adminApiContext: AdminApiContext) => Promise<boolean>;
6594
+ declare function extractIdFromUrl(url: string): string | null;
6595
+ type OrderStatus = "cancel" | "complete" | "reopen" | "process";
6596
+ declare const setOrderStatus: (orderId: string, orderStatus: OrderStatus, adminApiContext: AdminApiContext) => Promise<APIResponse>;
6597
+ /**
6598
+ * Return a single promotion entity with a fetched single discount entity
6599
+ */
6600
+ declare const getPromotionWithDiscount: (promotionId: string, adminApiContext: AdminApiContext) => Promise<Promotion>;
6601
+ declare const updateAdminUser: (adminUserId: string, adminApiContext: AdminApiContext, data: Record<string, string | boolean>) => Promise<void>;
6602
+
6603
+ declare const isSaaSInstance: (adminApiContext: AdminApiContext) => Promise<boolean>;
6604
+ declare const isPaaSInstance: () => boolean;
6605
+ declare const isThemeCompiled: (context: StoreApiContext, storefrontUrl: string) => Promise<boolean>;
6606
+
6607
+ declare function createRandomImage(width?: number, height?: number): Image;
6608
+ declare function createSolidColorImage(width?: number, height?: number, color?: [number, number, number]): Image;
6609
+ declare function encodeImage(image: Image): Buffer<ArrayBuffer>;
6610
+
6611
+ /**
6612
+ * Hides elements (via `visibility: hidden`).
6613
+ */
6614
+ declare function hideElements(page: Page, selectors: (string | Locator)[]): Promise<void>;
6615
+ /**
6616
+ * Replaces text content or input values of elements with a given replacement string (default: "***").
6617
+ * - Works for inputs, textareas, contenteditables and generic elements.
6618
+ * - Ensures frameworks see the change (dispatches input/change).
6619
+ * - Also masks placeholder so empty fields show replacement text in screenshots.
6620
+ */
6621
+ declare function replaceElements(page: Page, selectors: (string | Locator)[], replaceWith?: string): Promise<void>;
6622
+ interface ReplaceTarget {
6623
+ selector: string | Locator;
6624
+ replaceWith?: string;
6625
+ }
6626
+ /**
6627
+ * Replaces elements individually based on an array of targets.
6628
+ *
6629
+ *@param page - Playwright page
6630
+ *@param targets - Array of objects containing selectors and optional replacement strings.
6631
+ */
6632
+ declare function replaceElementsIndividually(page: Page, targets: ReplaceTarget[]): Promise<void>;
6633
+ /**
6634
+ * Calculates the ideal viewport dimensions for a Playwright test based on scrollable content,
6635
+ * header visibility, and optional configuration. Useful for dynamic screenshot sizing or
6636
+ * testing long-scrolling pages.
6637
+ *
6638
+ * This function:
6639
+ * - Optionally waits for a network request (`requestURL`) before continuing.
6640
+ * - Optionally waits for a specific locator (`waitForLocator`) to become visible.
6641
+ * - Measures scrollable content height (`scrollableElementVertical`) and header height.
6642
+ * - Measures scrollable content width (`scrollableElementHorizontal`).
6643
+ * - Falls back to defaults if elements are not found or inaccessible.
6644
+ *
6645
+ * @param {Page} page - The Playwright `Page` object representing the current browser tab.
6646
+ * @param {Options} [options] - Optional configuration to override default behavior.
6647
+ * @param {string} [options.requestURL] - A URL substring to wait for via `waitForResponse`.
6648
+ * @param {number} [options.width] - Base viewport width to use (default: 1440).
6649
+ * @param {string | Locator} [options.scrollableElementVertical] - Selector or Locator for vertical scroll container.
6650
+ * @param {string | Locator} [options.scrollableElementHorizontal] - Selector or Locator for horizontal scroll container.
6651
+ * @param {number} [options.additionalHeight] - Extra height to add (e.g., to avoid cut-off).
6652
+ * @param {string | Locator} [options.waitForSelector] - A selector or Locator to wait for visibility before measuring.
6653
+ * @param {number} [options.contentHeight] - Default vertical height fallback if measurement fails.
6654
+ * @param {number} [options.headerHeight] - Default header height fallback.
6655
+ * @param {string} [options.headerElement] - Selector for a header element whose height should be added if outside scrollable container.
6656
+ *
6657
+ * @returns {Promise<{ contentWidth: number; totalHeight: number }>} - A Promise resolving to the measured dimensions:
6658
+ * - `contentWidth`: the horizontal scroll width or fallback.
6659
+ * - `totalHeight`: sum of content height, header height, and any additional height.
6660
+ */
6661
+ interface Options {
6662
+ requestURL?: string;
6663
+ width?: number;
6664
+ scrollableElementVertical?: string | Locator;
6665
+ scrollableElementHorizontal?: string | Locator;
6666
+ additionalHeight?: number;
6667
+ waitForSelector?: string | Locator;
6668
+ contentHeight?: number;
6669
+ headerHeight?: number;
6670
+ headerElement?: string;
6671
+ }
6672
+ declare function setViewport(page: Page, options?: Options): Promise<void>;
6673
+ /**
6674
+ * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
6675
+ *
6676
+ * @param page - Playwright page object
6677
+ * @param filename - Filename of the screenshot
6678
+ * @param locator - Optional Playwright locator to take a screenshot of instead of the desktop content
6679
+ */
6680
+ declare function assertScreenshot(page: Page, filename: string, locator?: Locator): Promise<void>;
6681
+
6682
+ declare class LanguageHelper {
6683
+ private readonly i18nInstance;
6684
+ private currentLng;
6685
+ private readonly fallbackLng;
6686
+ private readonly resources;
6687
+ private constructor();
6688
+ getLanguage(): string;
6689
+ setLanguage(rawLanguage: string): Promise<void>;
6690
+ translate(key: TranslationKey, options?: Record<string, unknown>): string;
6691
+ static createInstance(rawLanguage: string, customResources?: typeof BUNDLED_RESOURCES): Promise<LanguageHelper>;
6692
+ static setForContext(context: Record<string, unknown>, instance: LanguageHelper): void;
6693
+ static getFromContext(context: Record<string, unknown>): LanguageHelper | undefined;
6694
+ }
6695
+ declare function setCurrentContext(context: Record<string, unknown> | null): void;
6696
+ declare function getCurrentContext(): Record<string, unknown> | null;
6697
+ declare function translate(key: TranslationKey, options?: Record<string, unknown>): string;
6698
+
6699
+ declare const clearDelayedCache: (adminApiContext: AdminApiContext) => Promise<void>;
6700
+
6701
+ declare function mockApiCalls(page: Page | BrowserContext): Promise<void>;
6702
+
6694
6703
  /**
6695
6704
  * Creates a new admin page context (login page) without the actual login.
6696
6705
  * @param browser - The Playwright Browser instance.
@@ -6698,6 +6707,11 @@ interface DefaultSalesChannelTypes {
6698
6707
  * @returns The Playwright Page instance for the admin login page.
6699
6708
  */
6700
6709
  declare function createNewAdminPageContext(browser: Browser, SalesChannelBaseConfig: DefaultSalesChannelTypes["SalesChannelBaseConfig"]): Promise<Page$1>;
6710
+ /**
6711
+ * Hides the Symfony debug toolbar after every reload of the given page.
6712
+ * @param page - The Playwright Page instance to patch.
6713
+ */
6714
+ declare function hideSymfonyToolbarOnReload(page: Page$1): void;
6701
6715
  /**
6702
6716
  * Performs admin login on the given page with the provided merchant user.
6703
6717
  * @param adminLoginPage - The Playwright Page instance for the admin login page.
@@ -6736,7 +6750,7 @@ declare function uploadRandomPngMedia(target: UploadMediaTarget, imageName: stri
6736
6750
  */
6737
6751
  type Task<TArgs extends unknown[] = any[]> = (...args: TArgs) => () => Promise<void>;
6738
6752
 
6739
- declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions & FixtureTypes & {
6753
+ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions & Omit<FixtureTypes, "AdminSession"> & FixtureTypes & {
6740
6754
  SaveProduct: Task;
6741
6755
  } & {
6742
6756
  ExpectNotification: Task;
@@ -6816,7 +6830,12 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6816
6830
  SelectProductFilterOption: Task;
6817
6831
  } & {
6818
6832
  CheckVisibilityInHome: Task;
6819
- }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions & FixtureTypes>;
6833
+ }, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions & FixtureTypes & {
6834
+ AdminApiContext: AdminApiContext;
6835
+ AdminSession: AdminSession;
6836
+ IdProvider: IdProvider;
6837
+ SalesChannelBaseConfig: StoreBaseConfig;
6838
+ }>;
6820
6839
 
6821
- export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
6840
+ export { Actor, AdminPageObjects, BUNDLED_RESOURCES, COUNTRY_ADDRESS_DATA, FeatureService, IdProvider, LanguageHelper, RuleType, StorefrontPageObjects, TestDataService, assertScreenshot, baseNamespaces, clearDelayedCache, compareFlowTemplateWithFlow, createNewAdminPageContext, createRandomImage, createSolidColorImage, encodeImage, extractIdFromUrl, formatPrice, getCountryAddressData, getCountryCodeFromLocale, getCountryId, getCurrency, getCurrencyCodeFromLocale, getCurrencySymbolFromLocale, getCurrentContext, getDefaultShippingMethodId, getFlow, getFlowId, getFlowTemplate, getLanguageCode, getLanguageData, getLocale, getMediaId, getOrderTransactionId, getPaymentMethodId, getPromotionWithDiscount, getSalutationId, getShippingMethodId, getSnippetSetId, getStateMachineId, getStateMachineStateId, getTaxId, getThemeId, hideElements, hideSymfonyToolbarOnReload, isPaaSInstance, isSaaSInstance, isThemeCompiled, loginToAdministration, mockApiCalls, replaceElements, replaceElementsIndividually, setCurrentContext, setOrderStatus, setViewport, test, translate, updateAdminUser, uploadRandomPngMedia };
6822
6841
  export type { AccountData, AclRole, Address, CalculatedTaxes, Category$1 as Category, CategoryCustomizableLinkData, CategoryData, CmsPage, Country$1 as Country, CreatedRecord, Currency$2 as Currency, CustomField, CustomFieldData, CustomFieldSet, Customer, CustomerAddress, CustomerGroup, DataServiceOptions, DeliveryTime, FixtureTypes, Flow, FlowConfig, FlowTemplate, Language$2 as Language, Manufacturer, Media$1 as Media, Options, Order, OrderDelivery, OrderLineItem, OrderStatus, PageObject, PaymentMethod$1 as PaymentMethod, Price, Product, ProductCrossSelling, ProductPrice, ProductReview, Promotion, PromotionDiscount, PropertyGroup, PropertyGroupOption, RegistrationData, ReplaceTarget, Rule, RuleAssignmentEntity, SalesChannel, SalesChannelAnalytics, SalesChannelDomain, SalesChannelRecord, Salutation, ShippingMethod$1 as ShippingMethod, SimpleLineItem, StateMachine, StateMachineState, SyncApiOperation, SystemConfig, Tag, TagData, Task, Tax$1 as Tax, TaxRules, TranslateFn, TranslationKey, UploadMediaTarget, User, VariantListingConfig };