pi-lean-dimension 0.2.4 → 0.3.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.
Files changed (159) hide show
  1. package/README.md +1 -1
  2. package/node_modules/pi-lean-portal/AGENTS.md +15 -23
  3. package/node_modules/pi-lean-portal/README.md +35 -7
  4. package/node_modules/pi-lean-portal/__tests__/browser-toggle-profile.test.ts +12 -1
  5. package/node_modules/pi-lean-portal/__tests__/browser-toggle.test.ts +263 -1126
  6. package/node_modules/pi-lean-portal/__tests__/fetch-backend.test.ts +6 -32
  7. package/node_modules/pi-lean-portal/__tests__/helpers/mock-python-bridge.py +1 -1
  8. package/node_modules/pi-lean-portal/__tests__/helpers/probe-user-backend.ts +1 -2
  9. package/node_modules/pi-lean-portal/__tests__/helpers/setup-temp-dir.ts +26 -0
  10. package/node_modules/pi-lean-portal/__tests__/plugin-config-browser.test.ts +1 -1
  11. package/node_modules/pi-lean-portal/__tests__/plugin-contract.test.ts +1 -1
  12. package/node_modules/pi-lean-portal/__tests__/plugin-loading.test.ts +1 -1
  13. package/node_modules/pi-lean-portal/__tests__/probe-user-backend.test.ts +1 -1
  14. package/node_modules/pi-lean-portal/__tests__/python-adapter.test.ts +65 -69
  15. package/node_modules/pi-lean-portal/__tests__/router-dispatch.test.ts +1 -14
  16. package/node_modules/pi-lean-portal/__tests__/run-contributed-suites.test.ts +31 -16
  17. package/node_modules/pi-lean-portal/__tests__/snapshot-cache.test.ts +1 -1
  18. package/node_modules/pi-lean-portal/__tests__/web-guides.test.ts +146 -19
  19. package/node_modules/pi-lean-portal/backends/playwright-base/playwright-plugin.ts +1 -1
  20. package/node_modules/pi-lean-portal/backends/python-adapter.ts +3 -3
  21. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/__init__.py +2 -4
  22. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/__pycache__/__init__.cpython-312.pyc +0 -0
  23. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/__pycache__/__init__.cpython-313.pyc +0 -0
  24. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/__pycache__/playwright_base.cpython-312.pyc +0 -0
  25. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/__pycache__/playwright_base.cpython-313.pyc +0 -0
  26. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/playwright_base.py +572 -81
  27. package/node_modules/pi-lean-portal/backends/python-base/tests/__pycache__/test_playwright_base_quirks.cpython-313-pytest-9.1.1.pyc +0 -0
  28. package/node_modules/pi-lean-portal/backends/python-base/tests/test_playwright_base_quirks.py +13 -43
  29. package/node_modules/pi-lean-portal/browser-profile.ts +2 -3
  30. package/node_modules/pi-lean-portal/browser-toggle.ts +168 -385
  31. package/node_modules/pi-lean-portal/contributed/CHOOSING.md +2 -2
  32. package/node_modules/pi-lean-portal/contributed/README.md +65 -6
  33. package/node_modules/pi-lean-portal/contributed/camoufox-py/__pycache__/bridge.cpython-312.pyc +0 -0
  34. package/node_modules/pi-lean-portal/contributed/camoufox-py/bridge.py +108 -14
  35. package/node_modules/pi-lean-portal/contributed/camoufox-py/pin.json +4 -0
  36. package/node_modules/pi-lean-portal/core/fetch-backend.ts +10 -30
  37. package/node_modules/pi-lean-portal/core/guides.ts +14 -18
  38. package/node_modules/pi-lean-portal/core/router.ts +2 -20
  39. package/node_modules/pi-lean-portal/core/shared/bot-detection.ts +19 -30
  40. package/node_modules/pi-lean-portal/core/shared/browser-data.ts +4 -4
  41. package/node_modules/pi-lean-portal/core/shared/nav-settle.ts +2 -2
  42. package/node_modules/pi-lean-portal/core/shared/paths.ts +16 -2
  43. package/node_modules/pi-lean-portal/core/shared/settings-reader.ts +2 -7
  44. package/node_modules/pi-lean-portal/core/shared/snapshot-cache.ts +1 -1
  45. package/node_modules/pi-lean-portal/index.ts +8 -1
  46. package/node_modules/pi-lean-portal/package.json +2 -1
  47. package/node_modules/pi-lean-portal/tools/web-learn.ts +1 -4
  48. package/node_modules/pi-lean-search/__tests__/web-search.test.ts +87 -0
  49. package/node_modules/pi-lean-search/index.ts +134 -64
  50. package/node_modules/pi-lean-search/package.json +2 -1
  51. package/node_modules/playwright/README.md +3 -3
  52. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +2 -2
  53. package/node_modules/playwright/lib/cli/reportActions.js +2 -2
  54. package/node_modules/playwright/lib/common/index.js +77 -52
  55. package/node_modules/playwright/lib/common/index.js.txt +10 -11
  56. package/node_modules/playwright/lib/errorContext.js +2 -3
  57. package/node_modules/playwright/lib/index.js +30 -8
  58. package/node_modules/playwright/lib/matchers/expect.js +4811 -4379
  59. package/node_modules/playwright/lib/matchers/expect.js.LICENSE +87 -140
  60. package/node_modules/playwright/lib/matchers/expect.js.txt +30 -35
  61. package/node_modules/playwright/lib/program.js +19 -0
  62. package/node_modules/playwright/lib/runner/index.js +309 -153
  63. package/node_modules/playwright/lib/runner/index.js.txt +13 -12
  64. package/node_modules/playwright/lib/transform/babelBundle.js +12899 -11654
  65. package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +379 -354
  66. package/node_modules/playwright/lib/transform/babelBundle.js.txt +39 -39
  67. package/node_modules/playwright/lib/transform/esmLoader.js +3129 -1116
  68. package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +81 -61
  69. package/node_modules/playwright/lib/transform/esmLoader.js.txt +21 -18
  70. package/node_modules/playwright/lib/util.js +2 -29
  71. package/node_modules/playwright/lib/worker/workerProcessEntry.js +14 -32
  72. package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +7 -8
  73. package/node_modules/playwright/package.json +3 -6
  74. package/node_modules/playwright/types/test.d.ts +391 -4
  75. package/node_modules/playwright/types/testReporter.d.ts +79 -4
  76. package/node_modules/playwright-core/browsers.json +12 -18
  77. package/node_modules/playwright-core/lib/bootstrap.js +1 -1
  78. package/node_modules/playwright-core/lib/coreBundle.js +11344 -9900
  79. package/node_modules/playwright-core/lib/server/electron/loader.js +5 -2
  80. package/node_modules/playwright-core/lib/serverRegistry.js +5 -1
  81. package/node_modules/playwright-core/lib/tools/cli-client/help.json +21 -6
  82. package/node_modules/playwright-core/lib/tools/cli-client/program.js +1 -1
  83. package/node_modules/playwright-core/lib/tools/cli-client/session.js +4 -0
  84. package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/SKILL.md +21 -5
  85. package/node_modules/playwright-core/lib/tools/{cli-client/skill/references/spec-driven-testing.md → skills/playwright-cli/references/test-generation.md} +135 -7
  86. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +143 -0
  87. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  88. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +85 -0
  89. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +67 -0
  90. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +75 -0
  91. package/node_modules/playwright-core/lib/tools/utils/extension.js +31 -8
  92. package/node_modules/playwright-core/lib/utilsBundle.js +37698 -33670
  93. package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +391 -268
  94. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +11 -0
  95. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +1 -0
  96. package/node_modules/playwright-core/lib/vite/dashboard/index.html +2 -2
  97. package/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -1
  98. package/node_modules/playwright-core/lib/vite/htmlReport/report.js +15 -55
  99. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  100. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CwYYHbcZ.js +32 -0
  101. package/node_modules/playwright-core/lib/vite/recorder/assets/index-DYjdXIbE.js +129 -0
  102. package/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +1 -0
  103. package/node_modules/playwright-core/lib/vite/recorder/index.html +2 -2
  104. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-By56iMx7.js +32 -0
  105. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-B34OrIms.js +181 -0
  106. package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  107. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-COQkjINf.js +7 -0
  108. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  109. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +1 -0
  110. package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  111. package/node_modules/playwright-core/lib/vite/traceViewer/index.Dl36UVQT.js +1 -0
  112. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +5 -5
  113. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  114. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +2 -2
  115. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -4
  116. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.C7UW1sC9.css +1 -0
  117. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.D962mr9b.js +5 -0
  118. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +5 -5
  119. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  120. package/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
  121. package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
  122. package/node_modules/playwright-core/lib/xdg-open +338 -137
  123. package/node_modules/playwright-core/package.json +2 -2
  124. package/node_modules/playwright-core/types/protocol.d.ts +249 -36
  125. package/node_modules/playwright-core/types/structs.d.ts +3 -1
  126. package/node_modules/playwright-core/types/types.d.ts +2009 -266
  127. package/package.json +3 -3
  128. package/node_modules/pi-lean-portal/__tests__/url-safety.test.ts +0 -188
  129. package/node_modules/pi-lean-portal/backends/python-base/pi_browser_bridge/bridge.py +0 -525
  130. package/node_modules/pi-lean-portal/core/shared/url-safety.ts +0 -164
  131. package/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +0 -2739
  132. package/node_modules/playwright-core/lib/tools/cli-client/skill/references/test-generation.md +0 -134
  133. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-BY2S1tHT.css +0 -1
  134. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-C_5TMfeg.js +0 -52
  135. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +0 -1
  136. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DeBYQozu.js +0 -32
  137. package/node_modules/playwright-core/lib/vite/recorder/assets/index-4ZiSSCmn.css +0 -1
  138. package/node_modules/playwright-core/lib/vite/recorder/assets/index-Bq-mQf8S.js +0 -193
  139. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-LEHpjmcn.js +0 -32
  140. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BNmKHKpQ.js +0 -264
  141. package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-BYQrIQwR.js +0 -1
  142. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +0 -9
  143. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +0 -1
  144. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.CjdS-WJx.css +0 -1
  145. package/node_modules/playwright-core/lib/vite/traceViewer/index.CzXZzn5A.css +0 -1
  146. package/node_modules/playwright-core/lib/vite/traceViewer/index.DMMX1gXU.js +0 -2
  147. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.v8KI4P3m.js +0 -2
  148. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BZQ54Kgt.css +0 -1
  149. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Ut8wwJNp.js +0 -6
  150. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +0 -32
  151. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/element-attributes.md +0 -0
  152. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/playwright-tests.md +0 -0
  153. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/request-mocking.md +0 -0
  154. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/running-code.md +0 -0
  155. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/session-management.md +0 -0
  156. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/storage-state.md +0 -0
  157. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/tracing.md +0 -0
  158. /package/node_modules/playwright-core/lib/tools/{cli-client/skill → skills/playwright-cli}/references/video-recording.md +0 -0
  159. /package/node_modules/playwright-core/lib/tools/{trace → skills/playwright-trace}/SKILL.md +0 -0
@@ -32,6 +32,7 @@ export type HtmlReporterOptions = {
32
32
  noSnippets?: boolean;
33
33
  noCopyPrompt?: boolean;
34
34
  doNotInlineAssets?: boolean;
35
+ mergeFiles?: boolean;
35
36
  };
36
37
 
37
38
  export type ReporterDescription = Readonly<
@@ -1640,6 +1641,31 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
1640
1641
  */
1641
1642
  retries?: number;
1642
1643
 
1644
+ /**
1645
+ * Controls when failed tests are retried. Defaults to `'immediate'`.
1646
+ * - `'immediate'` - A failed test is retried as soon as a worker is available, interleaved with the rest of the
1647
+ * run. This is the default.
1648
+ * - `'isolated'` - Retries are run at the end, after all other tests have finished, one by one in a single worker.
1649
+ * This minimizes the interference between retried tests and the rest of the suite, at the expense of the total
1650
+ * run time.
1651
+ *
1652
+ * Learn more about [test retries](https://playwright.dev/docs/test-retries#retries).
1653
+ *
1654
+ * **Usage**
1655
+ *
1656
+ * ```js
1657
+ * // playwright.config.ts
1658
+ * import { defineConfig } from '@playwright/test';
1659
+ *
1660
+ * export default defineConfig({
1661
+ * retries: 2,
1662
+ * retryStrategy: 'isolated',
1663
+ * });
1664
+ * ```
1665
+ *
1666
+ */
1667
+ retryStrategy?: "immediate"|"isolated";
1668
+
1643
1669
  /**
1644
1670
  * Shard tests and execute only the selected shard. Specify in the one-based form like `{ total: 5, current: 2 }`.
1645
1671
  *
@@ -6918,6 +6944,61 @@ export interface PlaywrightWorkerOptions {
6918
6944
  * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) are ignored.
6919
6945
  */
6920
6946
  connectOptions: ConnectOptions | undefined;
6947
+ /**
6948
+ * **NOTE** This option trades test isolation for speed and is intended for component tests that drive a story gallery. Leave
6949
+ * it unset for end-to-end tests - a fresh browser context per test is one of the core guarantees of Playwright Test.
6950
+ *
6951
+ * **Experimental.** When set to `true`, all tests in a worker process run in a single browser context that is reused
6952
+ * between tests, instead of getting a brand new context per test. Defaults to `false`.
6953
+ *
6954
+ * Between tests, Playwright resets the state that component tests typically touch: it clears cookies, cache, local
6955
+ * storage and IndexedDB of visited origins, unregisters service workers, closes extra pages, removes routes, bindings
6956
+ * and init scripts, and re-applies the configured storage state, viewport and emulation options.
6957
+ *
6958
+ * This reset is best-effort, not a guarantee of isolation. State that is **not** reset includes:
6959
+ * - Permissions granted with
6960
+ * [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions)
6961
+ * during a test.
6962
+ * - Runtime changes made through
6963
+ * [browserContext.setGeolocation(geolocation)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-geolocation),
6964
+ * [browserContext.setOffline(offline)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-offline)
6965
+ * and
6966
+ * [browserContext.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-extra-http-headers).
6967
+ * - Browsing history, `window.name` and any browser-process-wide state.
6968
+ *
6969
+ * Additional restrictions:
6970
+ * - The option is ignored when
6971
+ * [testOptions.video](https://playwright.dev/docs/api/class-testoptions#test-options-video) recording is enabled.
6972
+ * - Only a few context options may differ between consecutive tests: `colorScheme`, `forcedColors`,
6973
+ * `reducedMotion`, `contrast`, `screen`, `userAgent`, `viewport` and `testIdAttribute`. Changing any other option
6974
+ * in [test.use(options)](https://playwright.dev/docs/api/class-test#test-use), for example `locale` or
6975
+ * `storageState`, silently forces a fresh context and negates the speedup.
6976
+ * - Do not combine with
6977
+ * [testOptions.connectOptions](https://playwright.dev/docs/api/class-testoptions#test-options-connect-options)
6978
+ * pointing multiple workers at a shared browser - workers would compete for the single reusable context.
6979
+ * - `recordHar` in
6980
+ * [testOptions.contextOptions](https://playwright.dev/docs/api/class-testoptions#test-options-context-options) is
6981
+ * not supported and produces no HAR file.
6982
+ *
6983
+ * **Usage**
6984
+ *
6985
+ * ```js
6986
+ * // playwright.config.ts
6987
+ * import { defineConfig } from '@playwright/test';
6988
+ *
6989
+ * export default defineConfig({
6990
+ * projects: [
6991
+ * {
6992
+ * name: 'components',
6993
+ * testDir: './tests/components',
6994
+ * use: { reuseContext: true },
6995
+ * },
6996
+ * ],
6997
+ * });
6998
+ * ```
6999
+ *
7000
+ */
7001
+ reuseContext: boolean;
6921
7002
  /**
6922
7003
  * Whether to automatically capture a screenshot after each test. Defaults to `'off'`.
6923
7004
  * - `'off'`: Do not capture screenshots.
@@ -7017,7 +7098,7 @@ export interface PlaywrightWorkerOptions {
7017
7098
  *
7018
7099
  * Learn more about [recording video](https://playwright.dev/docs/test-use-options#recording-options).
7019
7100
  */
7020
- video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize, show?: { actions?: { duration?: number, position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number }, test?: { level?: 'file' | 'title' | 'step', position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number } } };
7101
+ video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize, show?: { actions?: { duration?: number, position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number, cursor?: 'none' | 'pointer' }, test?: { level?: 'file' | 'title' | 'step', position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number } } };
7021
7102
  }
7022
7103
 
7023
7104
  export type ScreenshotMode = 'off' | 'on' | 'only-on-failure' | 'on-first-failure';
@@ -7693,6 +7774,12 @@ export interface PlaywrightWorkerArgs {
7693
7774
  browser: Browser;
7694
7775
  }
7695
7776
 
7777
+ type StoryProps<Story> =
7778
+ Story extends (props: infer Props) => any ? Props :
7779
+ Story extends new (...args: any[]) => { $props: infer Props } ? Props :
7780
+ Story extends new (props: infer Props, ...args: any[]) => any ? Props :
7781
+ Story;
7782
+
7696
7783
  /**
7697
7784
  * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to
7698
7785
  * establish environment for each test, giving the test everything it needs and nothing else.
@@ -7784,6 +7871,48 @@ export interface PlaywrightTestArgs {
7784
7871
  *
7785
7872
  */
7786
7873
  request: APIRequestContext;
7874
+ /**
7875
+ * Mounts a component story and returns a [Locator](https://playwright.dev/docs/api/class-locator) pointing to the
7876
+ * root element the story was rendered into. Scope your queries from the returned locator:
7877
+ * `component.getByRole('button')`, not `page.getByRole('button')`.
7878
+ *
7879
+ * A **story** is a small wrapper component that embeds the component under test in one specific scenario: hard-coded
7880
+ * props, mock data, providers, recorded callbacks. Stories are rendered by a **gallery** page that you implement and
7881
+ * serve at [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). The
7882
+ * gallery exposes `window.mount(params)` and `window.unmount()` functions that render a story into its root element.
7883
+ * Each call to [fixtures.mount(storyId[, props])](https://playwright.dev/docs/api/class-fixtures#fixtures-mount)
7884
+ * navigates to [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) and
7885
+ * calls `window.mount()` with the story id and props, so tests are fully isolated from each other.
7886
+ *
7887
+ * **Usage**
7888
+ *
7889
+ * ```js
7890
+ * test('click should expand', async ({ mount }) => {
7891
+ * const component = await mount('components/Expandable/Stateful');
7892
+ * await component.getByRole('button').click();
7893
+ * await expect(component.getByTestId('expanded')).toHaveValue('true');
7894
+ * });
7895
+ * ```
7896
+ *
7897
+ * Pass the story type as a template argument to type-check the props:
7898
+ *
7899
+ * ```js
7900
+ * import type { WithTitle } from './Button.story';
7901
+ *
7902
+ * test('renders the title', async ({ mount }) => {
7903
+ * const component = await mount<typeof WithTitle>('Button/WithTitle', { title: 'Hello' });
7904
+ * await expect(component).toContainText('Hello');
7905
+ * });
7906
+ * ```
7907
+ *
7908
+ * The returned locator is augmented with two methods:
7909
+ * - `update(props)` - re-renders the same story with new props without remounting, preserving component state;
7910
+ * - `unmount()` - unmounts the story.
7911
+ * @param storyId Identifier of the story to mount, as resolved by the gallery page. Conventionally, the story file path plus the
7912
+ * exported story name, for example `'components/Button/Primary'`.
7913
+ * @param props Optional plain, serializable props passed to the story.
7914
+ */
7915
+ mount: <Story = Record<string, any>>(storyId: string, props?: StoryProps<Story>) => Promise<Locator & { update(props?: StoryProps<Story>): Promise<void>, unmount(): Promise<void> }>;
7787
7916
  }
7788
7917
 
7789
7918
  type ExcludeProps<A, B> = {
@@ -8647,7 +8776,6 @@ export function mergeExpects<List extends any[]>(...expects: List): MergedExpect
8647
8776
  export { };
8648
8777
 
8649
8778
 
8650
-
8651
8779
  /**
8652
8780
  * The [APIResponseAssertions](https://playwright.dev/docs/api/class-apiresponseassertions) class provides assertion
8653
8781
  * methods that can be used to make assertions about the
@@ -8724,6 +8852,13 @@ interface LocatorAssertions {
8724
8852
  toBeAttached(options?: {
8725
8853
  attached?: boolean;
8726
8854
 
8855
+ /**
8856
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
8857
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
8858
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
8859
+ */
8860
+ signal?: AbortSignal;
8861
+
8727
8862
  /**
8728
8863
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8729
8864
  */
@@ -8758,6 +8893,13 @@ interface LocatorAssertions {
8758
8893
  */
8759
8894
  indeterminate?: boolean;
8760
8895
 
8896
+ /**
8897
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
8898
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
8899
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
8900
+ */
8901
+ signal?: AbortSignal;
8902
+
8761
8903
  /**
8762
8904
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8763
8905
  */
@@ -8781,6 +8923,13 @@ interface LocatorAssertions {
8781
8923
  * @param options
8782
8924
  */
8783
8925
  toBeDisabled(options?: {
8926
+ /**
8927
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
8928
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
8929
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
8930
+ */
8931
+ signal?: AbortSignal;
8932
+
8784
8933
  /**
8785
8934
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8786
8935
  */
@@ -8802,6 +8951,13 @@ interface LocatorAssertions {
8802
8951
  toBeEditable(options?: {
8803
8952
  editable?: boolean;
8804
8953
 
8954
+ /**
8955
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
8956
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
8957
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
8958
+ */
8959
+ signal?: AbortSignal;
8960
+
8805
8961
  /**
8806
8962
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8807
8963
  */
@@ -8822,6 +8978,13 @@ interface LocatorAssertions {
8822
8978
  * @param options
8823
8979
  */
8824
8980
  toBeEmpty(options?: {
8981
+ /**
8982
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
8983
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
8984
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
8985
+ */
8986
+ signal?: AbortSignal;
8987
+
8825
8988
  /**
8826
8989
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8827
8990
  */
@@ -8843,6 +9006,13 @@ interface LocatorAssertions {
8843
9006
  toBeEnabled(options?: {
8844
9007
  enabled?: boolean;
8845
9008
 
9009
+ /**
9010
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9011
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9012
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9013
+ */
9014
+ signal?: AbortSignal;
9015
+
8846
9016
  /**
8847
9017
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8848
9018
  */
@@ -8862,6 +9032,13 @@ interface LocatorAssertions {
8862
9032
  * @param options
8863
9033
  */
8864
9034
  toBeFocused(options?: {
9035
+ /**
9036
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9037
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9038
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9039
+ */
9040
+ signal?: AbortSignal;
9041
+
8865
9042
  /**
8866
9043
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8867
9044
  */
@@ -8882,6 +9059,13 @@ interface LocatorAssertions {
8882
9059
  * @param options
8883
9060
  */
8884
9061
  toBeHidden(options?: {
9062
+ /**
9063
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9064
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9065
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9066
+ */
9067
+ signal?: AbortSignal;
9068
+
8885
9069
  /**
8886
9070
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8887
9071
  */
@@ -8914,6 +9098,13 @@ interface LocatorAssertions {
8914
9098
  */
8915
9099
  ratio?: number;
8916
9100
 
9101
+ /**
9102
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9103
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9104
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9105
+ */
9106
+ signal?: AbortSignal;
9107
+
8917
9108
  /**
8918
9109
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8919
9110
  */
@@ -8947,6 +9138,13 @@ interface LocatorAssertions {
8947
9138
  * @param options
8948
9139
  */
8949
9140
  toBeVisible(options?: {
9141
+ /**
9142
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9143
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9144
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9145
+ */
9146
+ signal?: AbortSignal;
9147
+
8950
9148
  /**
8951
9149
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8952
9150
  */
@@ -8994,6 +9192,13 @@ interface LocatorAssertions {
8994
9192
  * @param options
8995
9193
  */
8996
9194
  toContainClass(expected: string|ReadonlyArray<string>, options?: {
9195
+ /**
9196
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9197
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9198
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9199
+ */
9200
+ signal?: AbortSignal;
9201
+
8997
9202
  /**
8998
9203
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
8999
9204
  */
@@ -9061,6 +9266,13 @@ interface LocatorAssertions {
9061
9266
  */
9062
9267
  ignoreCase?: boolean;
9063
9268
 
9269
+ /**
9270
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9271
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9272
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9273
+ */
9274
+ signal?: AbortSignal;
9275
+
9064
9276
  /**
9065
9277
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9066
9278
  */
@@ -9094,6 +9306,13 @@ interface LocatorAssertions {
9094
9306
  */
9095
9307
  ignoreCase?: boolean;
9096
9308
 
9309
+ /**
9310
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9311
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9312
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9313
+ */
9314
+ signal?: AbortSignal;
9315
+
9097
9316
  /**
9098
9317
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9099
9318
  */
@@ -9122,6 +9341,13 @@ interface LocatorAssertions {
9122
9341
  */
9123
9342
  ignoreCase?: boolean;
9124
9343
 
9344
+ /**
9345
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9346
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9347
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9348
+ */
9349
+ signal?: AbortSignal;
9350
+
9125
9351
  /**
9126
9352
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9127
9353
  */
@@ -9150,6 +9376,13 @@ interface LocatorAssertions {
9150
9376
  */
9151
9377
  ignoreCase?: boolean;
9152
9378
 
9379
+ /**
9380
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9381
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9382
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9383
+ */
9384
+ signal?: AbortSignal;
9385
+
9153
9386
  /**
9154
9387
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9155
9388
  */
@@ -9178,6 +9411,13 @@ interface LocatorAssertions {
9178
9411
  */
9179
9412
  ignoreCase?: boolean;
9180
9413
 
9414
+ /**
9415
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9416
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9417
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9418
+ */
9419
+ signal?: AbortSignal;
9420
+
9181
9421
  /**
9182
9422
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9183
9423
  */
@@ -9199,6 +9439,13 @@ interface LocatorAssertions {
9199
9439
  * @param options
9200
9440
  */
9201
9441
  toHaveAttribute(name: string, options?: {
9442
+ /**
9443
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9444
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9445
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9446
+ */
9447
+ signal?: AbortSignal;
9448
+
9202
9449
  /**
9203
9450
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9204
9451
  */
@@ -9235,6 +9482,13 @@ interface LocatorAssertions {
9235
9482
  * @param options
9236
9483
  */
9237
9484
  toHaveClass(expected: string|RegExp|ReadonlyArray<string|RegExp>, options?: {
9485
+ /**
9486
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9487
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9488
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9489
+ */
9490
+ signal?: AbortSignal;
9491
+
9238
9492
  /**
9239
9493
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9240
9494
  */
@@ -9255,6 +9509,13 @@ interface LocatorAssertions {
9255
9509
  * @param options
9256
9510
  */
9257
9511
  toHaveCount(count: number, options?: {
9512
+ /**
9513
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9514
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9515
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9516
+ */
9517
+ signal?: AbortSignal;
9518
+
9258
9519
  /**
9259
9520
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9260
9521
  */
@@ -9282,6 +9543,13 @@ interface LocatorAssertions {
9282
9543
  */
9283
9544
  pseudo?: "before"|"after";
9284
9545
 
9546
+ /**
9547
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9548
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9549
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9550
+ */
9551
+ signal?: AbortSignal;
9552
+
9285
9553
  /**
9286
9554
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9287
9555
  */
@@ -9303,6 +9571,13 @@ interface LocatorAssertions {
9303
9571
  * @param options
9304
9572
  */
9305
9573
  toHaveId(id: string|RegExp, options?: {
9574
+ /**
9575
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9576
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9577
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9578
+ */
9579
+ signal?: AbortSignal;
9580
+
9306
9581
  /**
9307
9582
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9308
9583
  */
@@ -9325,6 +9600,13 @@ interface LocatorAssertions {
9325
9600
  * @param options
9326
9601
  */
9327
9602
  toHaveJSProperty(name: string, value: any, options?: {
9603
+ /**
9604
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9605
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9606
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9607
+ */
9608
+ signal?: AbortSignal;
9609
+
9328
9610
  /**
9329
9611
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9330
9612
  */
@@ -9349,6 +9631,13 @@ interface LocatorAssertions {
9349
9631
  * @param options
9350
9632
  */
9351
9633
  toHaveRole(role: "alert"|"alertdialog"|"application"|"article"|"banner"|"blockquote"|"button"|"caption"|"cell"|"checkbox"|"code"|"columnheader"|"combobox"|"complementary"|"contentinfo"|"definition"|"deletion"|"dialog"|"directory"|"document"|"emphasis"|"feed"|"figure"|"form"|"generic"|"grid"|"gridcell"|"group"|"heading"|"img"|"insertion"|"link"|"list"|"listbox"|"listitem"|"log"|"main"|"marquee"|"math"|"meter"|"menu"|"menubar"|"menuitem"|"menuitemcheckbox"|"menuitemradio"|"navigation"|"none"|"note"|"option"|"paragraph"|"presentation"|"progressbar"|"radio"|"radiogroup"|"region"|"row"|"rowgroup"|"rowheader"|"scrollbar"|"search"|"searchbox"|"separator"|"slider"|"spinbutton"|"status"|"strong"|"subscript"|"superscript"|"switch"|"tab"|"table"|"tablist"|"tabpanel"|"term"|"textbox"|"time"|"timer"|"toolbar"|"tooltip"|"tree"|"treegrid"|"treeitem", options?: {
9634
+ /**
9635
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9636
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9637
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9638
+ */
9639
+ signal?: AbortSignal;
9640
+
9352
9641
  /**
9353
9642
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9354
9643
  */
@@ -9364,10 +9653,14 @@ interface LocatorAssertions {
9364
9653
  * ```js
9365
9654
  * const locator = page.getByRole('button');
9366
9655
  * await expect(locator).toHaveScreenshot('image.png');
9656
+ *
9657
+ * // Store the snapshot in the WebP format.
9658
+ * await expect(locator).toHaveScreenshot('image.webp');
9367
9659
  * ```
9368
9660
  *
9369
9661
  * Note that screenshot assertions only work with Playwright test runner.
9370
- * @param name Snapshot name.
9662
+ * @param name Snapshot name. Must have a `.png` or `.webp` extension, the screenshot is captured in the corresponding format.
9663
+ * Both formats are lossless.
9371
9664
  * @param options
9372
9665
  */
9373
9666
  toHaveScreenshot(name: string|ReadonlyArray<string>, options?: {
@@ -9429,6 +9722,13 @@ interface LocatorAssertions {
9429
9722
  */
9430
9723
  scale?: "css"|"device";
9431
9724
 
9725
+ /**
9726
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9727
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9728
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9729
+ */
9730
+ signal?: AbortSignal;
9731
+
9432
9732
  /**
9433
9733
  * File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic
9434
9734
  * elements, make elements invisible or change their properties to help you creating repeatable screenshots. This
@@ -9453,6 +9753,9 @@ interface LocatorAssertions {
9453
9753
  * This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
9454
9754
  * screenshot with the expectation.
9455
9755
  *
9756
+ * The snapshot is stored in the PNG format. To store it in the WebP format instead, pass a snapshot name with the
9757
+ * `.webp` extension.
9758
+ *
9456
9759
  * **Usage**
9457
9760
  *
9458
9761
  * ```js
@@ -9522,6 +9825,13 @@ interface LocatorAssertions {
9522
9825
  */
9523
9826
  scale?: "css"|"device";
9524
9827
 
9828
+ /**
9829
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9830
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9831
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9832
+ */
9833
+ signal?: AbortSignal;
9834
+
9525
9835
  /**
9526
9836
  * File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic
9527
9837
  * elements, make elements invisible or change their properties to help you creating repeatable screenshots. This
@@ -9602,6 +9912,13 @@ interface LocatorAssertions {
9602
9912
  */
9603
9913
  ignoreCase?: boolean;
9604
9914
 
9915
+ /**
9916
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9917
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9918
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9919
+ */
9920
+ signal?: AbortSignal;
9921
+
9605
9922
  /**
9606
9923
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9607
9924
  */
@@ -9628,6 +9945,13 @@ interface LocatorAssertions {
9628
9945
  * @param options
9629
9946
  */
9630
9947
  toHaveValue(value: string|RegExp, options?: {
9948
+ /**
9949
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9950
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9951
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9952
+ */
9953
+ signal?: AbortSignal;
9954
+
9631
9955
  /**
9632
9956
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9633
9957
  */
@@ -9660,6 +9984,13 @@ interface LocatorAssertions {
9660
9984
  * @param options
9661
9985
  */
9662
9986
  toHaveValues(values: ReadonlyArray<string|RegExp>, options?: {
9987
+ /**
9988
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
9989
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
9990
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
9991
+ */
9992
+ signal?: AbortSignal;
9993
+
9663
9994
  /**
9664
9995
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9665
9996
  */
@@ -9683,6 +10014,13 @@ interface LocatorAssertions {
9683
10014
  * @param options
9684
10015
  */
9685
10016
  toMatchAriaSnapshot(expected: string, options?: {
10017
+ /**
10018
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10019
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10020
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10021
+ */
10022
+ signal?: AbortSignal;
10023
+
9686
10024
  /**
9687
10025
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9688
10026
  */
@@ -9711,6 +10049,13 @@ interface LocatorAssertions {
9711
10049
  */
9712
10050
  name?: string;
9713
10051
 
10052
+ /**
10053
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10054
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10055
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10056
+ */
10057
+ signal?: AbortSignal;
10058
+
9714
10059
  /**
9715
10060
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9716
10061
  */
@@ -9756,10 +10101,14 @@ interface PageAssertions {
9756
10101
  *
9757
10102
  * ```js
9758
10103
  * await expect(page).toHaveScreenshot('image.png');
10104
+ *
10105
+ * // Store the snapshot in the WebP format.
10106
+ * await expect(page).toHaveScreenshot('image.webp');
9759
10107
  * ```
9760
10108
  *
9761
10109
  * Note that screenshot assertions only work with Playwright test runner.
9762
- * @param name Snapshot name.
10110
+ * @param name Snapshot name. Must have a `.png` or `.webp` extension, the screenshot is captured in the corresponding format.
10111
+ * Both formats are lossless.
9763
10112
  * @param options
9764
10113
  */
9765
10114
  toHaveScreenshot(name: string|ReadonlyArray<string>, options?: PageAssertionsToHaveScreenshotOptions): Promise<void>;
@@ -9768,6 +10117,9 @@ interface PageAssertions {
9768
10117
  * This function will wait until two consecutive page screenshots yield the same result, and then compare the last
9769
10118
  * screenshot with the expectation.
9770
10119
  *
10120
+ * The snapshot is stored in the PNG format. To store it in the WebP format instead, pass a snapshot name with the
10121
+ * `.webp` extension.
10122
+ *
9771
10123
  * **Usage**
9772
10124
  *
9773
10125
  * ```js
@@ -9792,6 +10144,13 @@ interface PageAssertions {
9792
10144
  * @param options
9793
10145
  */
9794
10146
  toHaveTitle(titleOrRegExp: string|RegExp, options?: {
10147
+ /**
10148
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10149
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10150
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10151
+ */
10152
+ signal?: AbortSignal;
10153
+
9795
10154
  /**
9796
10155
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9797
10156
  */
@@ -9837,6 +10196,13 @@ interface PageAssertions {
9837
10196
  */
9838
10197
  ignoreCase?: boolean;
9839
10198
 
10199
+ /**
10200
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10201
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10202
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10203
+ */
10204
+ signal?: AbortSignal;
10205
+
9840
10206
  /**
9841
10207
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9842
10208
  */
@@ -9860,6 +10226,13 @@ interface PageAssertions {
9860
10226
  * @param options
9861
10227
  */
9862
10228
  toMatchAriaSnapshot(expected: string, options?: {
10229
+ /**
10230
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10231
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10232
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10233
+ */
10234
+ signal?: AbortSignal;
10235
+
9863
10236
  /**
9864
10237
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9865
10238
  */
@@ -9888,6 +10261,13 @@ interface PageAssertions {
9888
10261
  */
9889
10262
  name?: string;
9890
10263
 
10264
+ /**
10265
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10266
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10267
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10268
+ */
10269
+ signal?: AbortSignal;
10270
+
9891
10271
  /**
9892
10272
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
9893
10273
  */
@@ -10343,6 +10723,13 @@ export interface PageAssertionsToHaveScreenshotOptions {
10343
10723
  */
10344
10724
  scale?: "css"|"device";
10345
10725
 
10726
+ /**
10727
+ * An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that can cancel the
10728
+ * assertion. Aborting the signal fails the assertion like a timeout: if the signal is aborted while the assertion is
10729
+ * retrying, or is already aborted before the assertion starts, the assertion fails without retrying further.
10730
+ */
10731
+ signal?: AbortSignal;
10732
+
10346
10733
  /**
10347
10734
  * File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic
10348
10735
  * elements, make elements invisible or change their properties to help you creating repeatable screenshots. This