@shopware-ag/acceptance-test-suite 12.14.1 → 12.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts 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;
@@ -1263,76 +1261,9 @@ declare class TestDataService {
1263
1261
  getBasicProductReviewStruct(productId: string, overrides?: Partial<ProductReview>): Partial<ProductReview>;
1264
1262
  }
1265
1263
 
1266
- /**
1267
- * Hides elements (via `visibility: hidden`).
1268
- */
1269
- declare function hideElements(page: Page, selectors: (string | Locator)[]): Promise<void>;
1270
- /**
1271
- * Replaces text content or input values of elements with a given replacement string (default: "***").
1272
- * - Works for inputs, textareas, contenteditables and generic elements.
1273
- * - Ensures frameworks see the change (dispatches input/change).
1274
- * - Also masks placeholder so empty fields show replacement text in screenshots.
1275
- */
1276
- declare function replaceElements(page: Page, selectors: (string | Locator)[], replaceWith?: string): Promise<void>;
1277
- interface ReplaceTarget {
1278
- selector: string | Locator;
1279
- replaceWith?: string;
1280
- }
1281
- /**
1282
- * Replaces elements individually based on an array of targets.
1283
- *
1284
- *@param page - Playwright page
1285
- *@param targets - Array of objects containing selectors and optional replacement strings.
1286
- */
1287
- declare function replaceElementsIndividually(page: Page, targets: ReplaceTarget[]): Promise<void>;
1288
- /**
1289
- * Calculates the ideal viewport dimensions for a Playwright test based on scrollable content,
1290
- * header visibility, and optional configuration. Useful for dynamic screenshot sizing or
1291
- * testing long-scrolling pages.
1292
- *
1293
- * This function:
1294
- * - Optionally waits for a network request (`requestURL`) before continuing.
1295
- * - Optionally waits for a specific locator (`waitForLocator`) to become visible.
1296
- * - Measures scrollable content height (`scrollableElementVertical`) and header height.
1297
- * - Measures scrollable content width (`scrollableElementHorizontal`).
1298
- * - Falls back to defaults if elements are not found or inaccessible.
1299
- *
1300
- * @param {Page} page - The Playwright `Page` object representing the current browser tab.
1301
- * @param {Options} [options] - Optional configuration to override default behavior.
1302
- * @param {string} [options.requestURL] - A URL substring to wait for via `waitForResponse`.
1303
- * @param {number} [options.width] - Base viewport width to use (default: 1440).
1304
- * @param {string | Locator} [options.scrollableElementVertical] - Selector or Locator for vertical scroll container.
1305
- * @param {string | Locator} [options.scrollableElementHorizontal] - Selector or Locator for horizontal scroll container.
1306
- * @param {number} [options.additionalHeight] - Extra height to add (e.g., to avoid cut-off).
1307
- * @param {string | Locator} [options.waitForSelector] - A selector or Locator to wait for visibility before measuring.
1308
- * @param {number} [options.contentHeight] - Default vertical height fallback if measurement fails.
1309
- * @param {number} [options.headerHeight] - Default header height fallback.
1310
- * @param {string} [options.headerElement] - Selector for a header element whose height should be added if outside scrollable container.
1311
- *
1312
- * @returns {Promise<{ contentWidth: number; totalHeight: number }>} - A Promise resolving to the measured dimensions:
1313
- * - `contentWidth`: the horizontal scroll width or fallback.
1314
- * - `totalHeight`: sum of content height, header height, and any additional height.
1315
- */
1316
- interface Options {
1317
- requestURL?: string;
1318
- width?: number;
1319
- scrollableElementVertical?: string | Locator;
1320
- scrollableElementHorizontal?: string | Locator;
1321
- additionalHeight?: number;
1322
- waitForSelector?: string | Locator;
1323
- contentHeight?: number;
1324
- headerHeight?: number;
1325
- headerElement?: string;
1264
+ interface TestDataFixtureTypes {
1265
+ TestDataService: TestDataService;
1326
1266
  }
1327
- declare function setViewport(page: Page, options?: Options): Promise<void>;
1328
- /**
1329
- * Takes a screenshot of the desktop content of the page or the provided locator and compares it to existing ones.
1330
- *
1331
- * @param page - Playwright page object
1332
- * @param filename - Filename of the screenshot
1333
- * @param locator - Optional Playwright locator to take a screenshot of instead of the desktop content
1334
- */
1335
- declare function assertScreenshot(page: Page, filename: string, locator?: Locator): Promise<void>;
1336
1267
 
1337
1268
  declare const BUNDLED_RESOURCES: {
1338
1269
  readonly en: {
@@ -4418,183 +4349,54 @@ declare const baseNamespaces: {
4418
4349
  message: string;
4419
4350
  backToShop: string;
4420
4351
  };
4421
- readonly payment: {
4422
- methods: {
4423
- cashOnDelivery: string;
4424
- paidInAdvance: string;
4425
- invoice: string;
4426
- };
4427
- actions: {
4428
- change: string;
4429
- completePayment: string;
4430
- };
4431
- };
4432
- readonly recover: {
4433
- passwordRecovery: string;
4434
- subtitle: string;
4435
- requestEmail: string;
4436
- back: string;
4437
- emailSent: string;
4438
- newPassword: string;
4439
- passwordConfirmation: string;
4440
- changePassword: string;
4441
- invalidLink: string;
4442
- };
4443
- readonly offCanvasCart: {
4444
- general: {
4445
- title: string;
4446
- };
4447
- buttons: {
4448
- goToCheckout: string;
4449
- goToCart: string;
4450
- continueShopping: string;
4451
- };
4452
- };
4453
- readonly wishlist: {
4454
- removeProduct: string;
4455
- };
4456
- };
4457
- };
4458
-
4459
- /** Flatten nested JSON keys to "a.b.c" */
4460
- type Paths<T> = T extends object ? {
4461
- [K in keyof T & string]: T[K] extends object ? `${K}` | `${K}.${Paths<T[K]>}` : K;
4462
- }[keyof T & string] : never;
4463
- type TranslationKey<TNamespaces = typeof baseNamespaces> = TNamespaces extends Record<string, unknown> ? {
4464
- [A in keyof TNamespaces]: {
4465
- [N in keyof TNamespaces[A]]: `${A & string}:${N & string}:${Paths<TNamespaces[A][N]>}`;
4466
- }[keyof TNamespaces[A]];
4467
- }[keyof TNamespaces] : never;
4468
- type TranslateFn<TKey extends string = TranslationKey> = (key: TKey, options?: Record<string, unknown>) => string;
4469
-
4470
- declare class LanguageHelper {
4471
- private readonly i18nInstance;
4472
- private currentLng;
4473
- private readonly fallbackLng;
4474
- private readonly resources;
4475
- private constructor();
4476
- getLanguage(): string;
4477
- setLanguage(rawLanguage: string): Promise<void>;
4478
- translate(key: TranslationKey, options?: Record<string, unknown>): string;
4479
- static createInstance(rawLanguage: string, customResources?: typeof BUNDLED_RESOURCES): Promise<LanguageHelper>;
4480
- static setForContext(context: Record<string, unknown>, instance: LanguageHelper): void;
4481
- static getFromContext(context: Record<string, unknown>): LanguageHelper | undefined;
4482
- }
4483
- declare function setCurrentContext(context: Record<string, unknown> | null): void;
4484
- declare function getCurrentContext(): Record<string, unknown> | null;
4485
- declare function translate(key: TranslationKey, options?: Record<string, unknown>): string;
4486
-
4487
- /**
4488
- * Service to interact with feature flags
4489
- */
4490
- declare class FeatureService {
4491
- private readonly apiContext;
4492
- private features;
4493
- private resetFeatures;
4494
- constructor(apiContext: AdminApiContext);
4495
- enable(name: string | string[]): Promise<void>;
4496
- disable(name: string | string[]): Promise<void>;
4497
- isEnabled(name: string): Promise<boolean>;
4498
- private loadFeatures;
4499
- cleanup(): Promise<void>;
4500
- }
4501
-
4502
- declare const clearDelayedCache: (adminApiContext: AdminApiContext) => Promise<void>;
4503
-
4504
- declare function mockApiCalls(page: Page): Promise<void>;
4505
-
4506
- declare class Actor {
4507
- page: Page;
4508
- readonly name: string;
4509
- baseURL: string | undefined;
4510
- constructor(name: string, page: Page, baseURL?: string);
4511
- expects: playwright_test.Expect<{}>;
4512
- a11y_checks(locator: Locator): Promise<void>;
4513
- fillsIn(locator: Locator, input: string): Promise<void>;
4514
- presses(locator: Locator, key?: string): Promise<void>;
4515
- selectsRadioButton(radioGroup: Locator, inputLabel: string): Promise<void>;
4516
- attemptsTo(task: () => Promise<void>): Promise<void>;
4517
- goesTo(url: string, forceReload?: boolean): Promise<void>;
4518
- private camelCaseToLowerCase;
4519
- }
4520
-
4521
- interface Email {
4522
- fromName: string;
4523
- fromAddress: string;
4524
- toName: string;
4525
- toAddress: string;
4526
- subject: string;
4527
- emailId: string;
4528
- }
4529
- declare class MailpitApiContext {
4530
- context: APIRequestContext;
4531
- constructor(context: APIRequestContext);
4532
- /**
4533
- * Fetches email headers based on the recipient's email address.
4534
- * @param email - The email address of the recipient.
4535
- * @returns An Email object containing the email headers.
4536
- */
4537
- getEmailHeaders(email: string): Promise<Email>;
4538
- /**
4539
- * Retrieves the body content of the email as an HTML string.
4540
- * @param email - The email address of the recipient.
4541
- * @returns A promise that resolves to the HTML content of the email.
4542
- */
4543
- getEmailBody(email: string): Promise<string>;
4544
- /**
4545
- * Generates the full email content, combining headers and body.
4546
- * @param email - The email address to fetch headers for.
4547
- * @returns A promise that resolves to the full email content as a string.
4548
- */
4549
- generateEmailContent(email: string): Promise<string>;
4550
- /**
4551
- * Retrieves the plain text content of the email.
4552
- * @param email - The email address of the recipient.
4553
- * @returns A promise that resolves to the plain text content of the email.
4554
- */
4555
- getRenderMessageTxt(email: string): Promise<string>;
4556
- /**
4557
- * Extracts the first URL found in the plain text content of the latest email.
4558
- * @param email - The email address of the recipient.
4559
- * @returns A promise that resolves to the first URL found in the email content.
4560
- * @throws An error if no URL is found in the email content.
4561
- */
4562
- getLinkFromMail(email: string): Promise<string>;
4563
- /**
4564
- * Deletes a specific email by ID if provided, or deletes all emails if no ID is provided.
4565
- * @param emailId - The ID of the email to delete (optional).
4566
- */
4567
- deleteMail(emailId?: string): Promise<void>;
4568
- /**
4569
- * Creates a new MailpitApiContext instance with the appropriate configuration.
4570
- * @param baseURL - The base URL for the API.
4571
- * @returns A promise that resolves to a MailpitApiContext instance.
4572
- */
4573
- static create(baseURL: string): Promise<MailpitApiContext>;
4574
- }
4575
-
4576
- interface ApiContextTypes {
4577
- AdminApiContext: AdminApiContext;
4578
- StoreApiContext: StoreApiContext;
4579
- MailpitApiContext: MailpitApiContext;
4580
- }
4581
-
4582
- interface PageContextTypes {
4583
- AdminPage: Page;
4584
- StorefrontPage: Page;
4585
- InstallPage: Page;
4586
- page: Page;
4587
- context: BrowserContext;
4588
- }
4589
-
4590
- interface ActorFixtureTypes {
4591
- ShopCustomer: Actor;
4592
- ShopAdmin: Actor;
4593
- }
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
+ };
4594
4389
 
4595
- interface TestDataFixtureTypes {
4596
- TestDataService: TestDataService;
4597
- }
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;
4598
4400
 
4599
4401
  type FeaturesType = Record<string, boolean>;
4600
4402
  interface HelperFixtureTypes {
@@ -4613,10 +4415,10 @@ interface HelperFixtureTypes {
4613
4415
  interface Country {
4614
4416
  id: string;
4615
4417
  }
4616
- interface Currency {
4418
+ interface Currency$1 {
4617
4419
  id: string;
4618
4420
  }
4619
- interface Language {
4421
+ interface Language$1 {
4620
4422
  id: string;
4621
4423
  translationCode: {
4622
4424
  id: string;
@@ -4639,8 +4441,8 @@ interface Theme {
4639
4441
  }
4640
4442
  interface ShopwareDataFixtureTypes {
4641
4443
  Country: Country;
4642
- Currency: Currency;
4643
- Language: Language;
4444
+ Currency: Currency$1;
4445
+ Language: Language$1;
4644
4446
  PaymentMethod: PaymentMethod;
4645
4447
  ShippingMethod: ShippingMethod;
4646
4448
  SnippetSet: SnippetSet;
@@ -6472,7 +6274,7 @@ declare class ListingPageLayoutDetail implements PageObject {
6472
6274
  readonly navigatorButton: Locator;
6473
6275
  readonly layoutAssignmentButton: Locator;
6474
6276
  readonly page: Page;
6475
- constructor(page: Page);
6277
+ constructor(page: Page, instanceMeta: HelperFixtureTypes["InstanceMeta"]);
6476
6278
  url(layoutId: string): string;
6477
6279
  }
6478
6280
 
@@ -6658,6 +6460,21 @@ interface DataFixtureTypes {
6658
6460
  TagData: components["schemas"]["Tag"];
6659
6461
  }
6660
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
+
6661
6478
  interface FeatureFixtureTypes {
6662
6479
  FeatureService: FeatureService;
6663
6480
  }
@@ -6695,6 +6512,194 @@ interface DefaultSalesChannelTypes {
6695
6512
  };
6696
6513
  }
6697
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
+
6698
6703
  /**
6699
6704
  * Creates a new admin page context (login page) without the actual login.
6700
6705
  * @param browser - The Playwright Browser instance.
@@ -6702,6 +6707,11 @@ interface DefaultSalesChannelTypes {
6702
6707
  * @returns The Playwright Page instance for the admin login page.
6703
6708
  */
6704
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;
6705
6715
  /**
6706
6716
  * Performs admin login on the given page with the provided merchant user.
6707
6717
  * @param adminLoginPage - The Playwright Page instance for the admin login page.
@@ -6740,7 +6750,7 @@ declare function uploadRandomPngMedia(target: UploadMediaTarget, imageName: stri
6740
6750
  */
6741
6751
  type Task<TArgs extends unknown[] = any[]> = (...args: TArgs) => () => Promise<void>;
6742
6752
 
6743
- 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 & {
6744
6754
  SaveProduct: Task;
6745
6755
  } & {
6746
6756
  ExpectNotification: Task;
@@ -6820,7 +6830,12 @@ declare const test: playwright_test.TestType<playwright_test.PlaywrightTestArgs
6820
6830
  SelectProductFilterOption: Task;
6821
6831
  } & {
6822
6832
  CheckVisibilityInHome: Task;
6823
- }, 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
+ }>;
6824
6839
 
6825
- 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 };
6826
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 };