venetian 0.2.2-aarch64-linux → 0.3.0-aarch64-linux

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -2
  3. data/exe/aarch64-linux/LICENSE +2 -2
  4. data/exe/aarch64-linux/node +2 -2
  5. data/exe/aarch64-linux/package/browsers.json +9 -32
  6. data/exe/aarch64-linux/package/lib/coreBundle.js +5402 -4419
  7. data/exe/aarch64-linux/package/lib/server/electron/loader.js +0 -2
  8. data/exe/aarch64-linux/package/lib/serverRegistry.js +1674 -7082
  9. data/exe/aarch64-linux/package/lib/serverRegistry.js.LICENSE +8 -297
  10. data/exe/aarch64-linux/package/lib/tools/cli-client/help.json +19 -6
  11. data/exe/aarch64-linux/package/lib/tools/cli-client/minimist.js +1 -1
  12. data/exe/aarch64-linux/package/lib/tools/cli-client/output.js +9 -1
  13. data/exe/aarch64-linux/package/lib/tools/cli-client/program.js +17 -3
  14. data/exe/aarch64-linux/package/lib/tools/cli-client/registry.js +9 -5
  15. data/exe/aarch64-linux/package/lib/tools/cli-client/session.js +2 -1
  16. data/exe/aarch64-linux/package/lib/tools/skills/playwright-cli/SKILL.md +5 -0
  17. data/exe/aarch64-linux/package/lib/tools/skills/playwright-cli/references/tracing.md +1 -1
  18. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/SKILL.md +4 -11
  19. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/migration.md +6 -2
  20. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/react.md +2 -0
  21. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  22. data/exe/aarch64-linux/package/lib/tools/skills/playwright-component-testing/references/vue.md +2 -0
  23. data/exe/aarch64-linux/package/lib/tools/skills/playwright-trace/SKILL.md +6 -3
  24. data/exe/aarch64-linux/package/lib/tools/utils/extension.js +13 -2
  25. data/exe/aarch64-linux/package/lib/utilsBundle.js +1934 -7341
  26. data/exe/aarch64-linux/package/lib/utilsBundle.js.LICENSE +8 -297
  27. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  28. data/exe/aarch64-linux/package/lib/vite/{recorder/assets/codeMirrorModule-CwYYHbcZ.js → dashboard/assets/codeMirrorModule-CQ8RZGBm.js} +1 -1
  29. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  30. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  31. data/exe/aarch64-linux/package/lib/vite/dashboard/index.html +2 -2
  32. data/exe/aarch64-linux/package/lib/vite/htmlReport/report.css +1 -1
  33. data/exe/aarch64-linux/package/lib/vite/htmlReport/report.js +4 -4
  34. data/exe/aarch64-linux/package/lib/vite/recorder/assets/codeMirrorModule-CVQWJZAA.js +32 -0
  35. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  36. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-hrlLqLtq.js +129 -0
  37. data/exe/aarch64-linux/package/lib/vite/recorder/index.html +2 -2
  38. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/{codeMirrorModule-rXmQmLUY.js → codeMirrorModule-BbkfBe3n.js} +1 -1
  39. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +182 -0
  40. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/{xtermModule-BuZfJS5v.js → xtermModule-DywYcAf8.js} +1 -1
  41. data/exe/aarch64-linux/package/lib/vite/traceViewer/defaultSettingsView.Bqk9acqE.css +1 -0
  42. data/exe/aarch64-linux/package/lib/vite/traceViewer/index.B4cLoZK3.js +1 -0
  43. data/exe/aarch64-linux/package/lib/vite/traceViewer/index.html +3 -3
  44. data/exe/aarch64-linux/package/lib/vite/traceViewer/sw.bundle.js +3 -3
  45. data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.CU5KtEkS.js +5 -0
  46. data/exe/aarch64-linux/package/lib/vite/traceViewer/{uiMode.C7UW1sC9.css → uiMode.CyMfwkXJ.css} +1 -1
  47. data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.html +4 -4
  48. data/exe/aarch64-linux/package/package.json +1 -1
  49. data/exe/aarch64-linux/package/types/protocol.d.ts +201 -398
  50. data/exe/aarch64-linux/package/types/types.d.ts +771 -327
  51. data/exe/playwright +1 -1
  52. data/lib/tasks/venetian.rake +1 -1
  53. data/lib/venetian/browser_installer.rb +42 -11
  54. data/lib/venetian/browser_runner_extensions.rb +9 -2
  55. data/lib/venetian/core.rb +25 -0
  56. data/lib/venetian/executable.rb +27 -0
  57. data/lib/venetian/gemspec.rb +2 -0
  58. data/lib/venetian/playwright.rb +14 -0
  59. data/lib/venetian/playwright_create_extensions.rb +4 -1
  60. data/lib/venetian/system_test_case_extension.rb +3 -1
  61. data/lib/venetian/upstream.rb +1 -1
  62. data/lib/venetian/version.rb +2 -2
  63. data/lib/venetian.rb +4 -19
  64. metadata +23 -18
  65. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-CyWAfh-p.js +0 -11
  66. data/exe/aarch64-linux/package/lib/vite/dashboard/assets/index-DhC616m4.css +0 -1
  67. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-DYjdXIbE.js +0 -129
  68. data/exe/aarch64-linux/package/lib/vite/recorder/assets/index-l_lX622x.css +0 -1
  69. data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-B-dXF5JN.js +0 -181
  70. data/exe/aarch64-linux/package/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +0 -1
  71. data/exe/aarch64-linux/package/lib/vite/traceViewer/index.KZ4wOW1K.js +0 -1
  72. data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Dzuouizj.js +0 -5
@@ -1046,6 +1046,14 @@ export interface Page {
1046
1046
  */
1047
1047
  on(event: 'dialog', listener: (dialog: Dialog) => any): this;
1048
1048
 
1049
+ /**
1050
+ * Emitted when a JavaScript dialog has been closed, either by
1051
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
1052
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
1053
+ * headed browser.
1054
+ */
1055
+ on(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
1056
+
1049
1057
  /**
1050
1058
  * Emitted when the JavaScript
1051
1059
  * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
@@ -1207,6 +1215,11 @@ export interface Page {
1207
1215
  */
1208
1216
  once(event: 'dialog', listener: (dialog: Dialog) => any): this;
1209
1217
 
1218
+ /**
1219
+ * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
1220
+ */
1221
+ once(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
1222
+
1210
1223
  /**
1211
1224
  * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
1212
1225
  */
@@ -1348,6 +1361,14 @@ export interface Page {
1348
1361
  */
1349
1362
  addListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
1350
1363
 
1364
+ /**
1365
+ * Emitted when a JavaScript dialog has been closed, either by
1366
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
1367
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
1368
+ * headed browser.
1369
+ */
1370
+ addListener(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
1371
+
1351
1372
  /**
1352
1373
  * Emitted when the JavaScript
1353
1374
  * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
@@ -1509,6 +1530,11 @@ export interface Page {
1509
1530
  */
1510
1531
  removeListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
1511
1532
 
1533
+ /**
1534
+ * Removes an event listener added by `on` or `addListener`.
1535
+ */
1536
+ removeListener(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
1537
+
1512
1538
  /**
1513
1539
  * Removes an event listener added by `on` or `addListener`.
1514
1540
  */
@@ -1604,6 +1630,11 @@ export interface Page {
1604
1630
  */
1605
1631
  off(event: 'dialog', listener: (dialog: Dialog) => any): this;
1606
1632
 
1633
+ /**
1634
+ * Removes an event listener added by `on` or `addListener`.
1635
+ */
1636
+ off(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
1637
+
1607
1638
  /**
1608
1639
  * Removes an event listener added by `on` or `addListener`.
1609
1640
  */
@@ -1745,6 +1776,14 @@ export interface Page {
1745
1776
  */
1746
1777
  prependListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
1747
1778
 
1779
+ /**
1780
+ * Emitted when a JavaScript dialog has been closed, either by
1781
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
1782
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
1783
+ * headed browser.
1784
+ */
1785
+ prependListener(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
1786
+
1748
1787
  /**
1749
1788
  * Emitted when the JavaScript
1750
1789
  * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
@@ -2099,6 +2138,54 @@ export interface Page {
2099
2138
  timeout?: number;
2100
2139
  }): Promise<string>;
2101
2140
 
2141
+ /**
2142
+ * Captures the aria snapshot of the page as a free form JSON object. Returns the same tree as
2143
+ * [page.ariaSnapshot([options])](https://playwright.dev/docs/api/class-page#page-aria-snapshot), serialized as a JSON
2144
+ * value instead of YAML markup. See
2145
+ * [locator.ariaSnapshotJSON([options])](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot-json) for
2146
+ * the details of the format.
2147
+ * @param options
2148
+ */
2149
+ ariaSnapshotJSON(options?: {
2150
+ /**
2151
+ * When `true`, includes each element's bounding box as a `box` property with `x`, `y`, `width` and `height`.
2152
+ * Coordinates are relative to the viewport, in CSS pixels, as returned by
2153
+ * [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
2154
+ * Defaults to `false`.
2155
+ */
2156
+ boxes?: boolean;
2157
+
2158
+ /**
2159
+ * When specified, limits the depth of the snapshot.
2160
+ */
2161
+ depth?: number;
2162
+
2163
+ /**
2164
+ * When set to `"ai"`, returns a snapshot optimized for AI consumption: including element references like `[ref=e2]`
2165
+ * and snapshots of `<iframe>`s. Defaults to `"default"`.
2166
+ */
2167
+ mode?: "ai"|"default";
2168
+
2169
+ /**
2170
+ * Allows to cancel the operation using an
2171
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
2172
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
2173
+ * which can be changed using
2174
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
2175
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
2176
+ * `timeout: 0` to disable the timeout entirely.
2177
+ */
2178
+ signal?: AbortSignal;
2179
+
2180
+ /**
2181
+ * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
2182
+ * option in the config, or by using the
2183
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
2184
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
2185
+ */
2186
+ timeout?: number;
2187
+ }): Promise<Serializable>;
2188
+
2102
2189
  /**
2103
2190
  * Brings page to front (activates tab).
2104
2191
  */
@@ -2905,6 +2992,11 @@ export interface Page {
2905
2992
  * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
2906
2993
  * in that iframe.
2907
2994
  *
2995
+ * When called without [`selector`](https://playwright.dev/docs/api/class-page#page-frame-locator-option-selector),
2996
+ * the search starts in any frame on the page - the main frame or any of the iframes - so that you don't need to
2997
+ * locate each iframe first. Note that the rest of the locator is resolved inside a single frame, just like any other
2998
+ * locator. If it matches elements inside multiple frames, an error is thrown.
2999
+ *
2908
3000
  * **Usage**
2909
3001
  *
2910
3002
  * Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe
@@ -2915,9 +3007,16 @@ export interface Page {
2915
3007
  * await locator.click();
2916
3008
  * ```
2917
3009
  *
2918
- * @param selector A selector to use when resolving DOM element.
3010
+ * Following snippet locates a button, either in the main frame or in one of the iframes:
3011
+ *
3012
+ * ```js
3013
+ * const locator = page.frameLocator().getByRole('button');
3014
+ * await locator.click();
3015
+ * ```
3016
+ *
3017
+ * @param selector A selector that matches the frame element. When not specified, locator is matched in any frame on the page.
2919
3018
  */
2920
- frameLocator(selector: string): FrameLocator;
3019
+ frameLocator(selector?: string): FrameLocator;
2921
3020
 
2922
3021
  /**
2923
3022
  * An array of all frames attached to the page.
@@ -3293,7 +3392,7 @@ export interface Page {
3293
3392
  *
3294
3393
  * Navigate to the previous page in history.
3295
3394
  *
3296
- * **NOTE** **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright disables the
3395
+ * **NOTE** **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright disables the
3297
3396
  * Back/Forward Cache across all browsers. Even if explicitly enabled, Playwright's internal state relies on
3298
3397
  * network-level navigation events. Because BFCache restores unfreeze the DOM without firing these events, using
3299
3398
  * `page.goBack()` or `page.goForward()` to trigger a BFCache restore will result in timeouts and a desynchronized
@@ -3341,7 +3440,7 @@ export interface Page {
3341
3440
  *
3342
3441
  * Navigate to the next page in history.
3343
3442
  *
3344
- * **NOTE** **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright disables the
3443
+ * **NOTE** **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright disables the
3345
3444
  * Back/Forward Cache across all browsers. Even if explicitly enabled, Playwright's internal state relies on
3346
3445
  * network-level navigation events. Because BFCache restores unfreeze the DOM without firing these events, using
3347
3446
  * `page.goBack()` or `page.goForward()` to trigger a BFCache restore will result in timeouts and a desynchronized
@@ -5267,6 +5366,14 @@ export interface Page {
5267
5366
  */
5268
5367
  waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;
5269
5368
 
5369
+ /**
5370
+ * Emitted when a JavaScript dialog has been closed, either by
5371
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
5372
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
5373
+ * headed browser.
5374
+ */
5375
+ waitForEvent(event: 'dialogclosed', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;
5376
+
5270
5377
  /**
5271
5378
  * Emitted when the JavaScript
5272
5379
  * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
@@ -7224,6 +7331,11 @@ export interface Frame {
7224
7331
  * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
7225
7332
  * in that iframe.
7226
7333
  *
7334
+ * When called without [`selector`](https://playwright.dev/docs/api/class-frame#frame-frame-locator-option-selector),
7335
+ * the search starts in this frame or in any of the iframes inside it, so that you don't need to locate each iframe
7336
+ * first. Note that the rest of the locator is resolved inside a single frame, just like any other locator. If it
7337
+ * matches elements inside multiple frames, an error is thrown.
7338
+ *
7227
7339
  * **Usage**
7228
7340
  *
7229
7341
  * Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe
@@ -7234,9 +7346,17 @@ export interface Frame {
7234
7346
  * await locator.click();
7235
7347
  * ```
7236
7348
  *
7237
- * @param selector A selector to use when resolving DOM element.
7349
+ * Following snippet locates a button, either in the frame or in one of the iframes inside it:
7350
+ *
7351
+ * ```js
7352
+ * const locator = frame.frameLocator().getByRole('button');
7353
+ * await locator.click();
7354
+ * ```
7355
+ *
7356
+ * @param selector A selector that matches the frame element. When not specified, locator is matched in this frame or in any of the
7357
+ * iframes inside it.
7238
7358
  */
7239
- frameLocator(selector: string): FrameLocator;
7359
+ frameLocator(selector?: string): FrameLocator;
7240
7360
 
7241
7361
  /**
7242
7362
  * **NOTE** Use locator-based
@@ -9182,6 +9302,14 @@ export interface BrowserContext {
9182
9302
  */
9183
9303
  on(event: 'dialog', listener: (dialog: Dialog) => any): this;
9184
9304
 
9305
+ /**
9306
+ * Emitted when a JavaScript dialog in any page belonging to this context has been closed, either by
9307
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
9308
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
9309
+ * headed browser.
9310
+ */
9311
+ on(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
9312
+
9185
9313
  /**
9186
9314
  * Emitted when attachment download started in any page belonging to this context. User can access basic file
9187
9315
  * operations on downloaded content via the passed [Download](https://playwright.dev/docs/api/class-download)
@@ -9327,6 +9455,11 @@ export interface BrowserContext {
9327
9455
  */
9328
9456
  once(event: 'dialog', listener: (dialog: Dialog) => any): this;
9329
9457
 
9458
+ /**
9459
+ * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
9460
+ */
9461
+ once(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
9462
+
9330
9463
  /**
9331
9464
  * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
9332
9465
  */
@@ -9448,6 +9581,14 @@ export interface BrowserContext {
9448
9581
  */
9449
9582
  addListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
9450
9583
 
9584
+ /**
9585
+ * Emitted when a JavaScript dialog in any page belonging to this context has been closed, either by
9586
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
9587
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
9588
+ * headed browser.
9589
+ */
9590
+ addListener(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
9591
+
9451
9592
  /**
9452
9593
  * Emitted when attachment download started in any page belonging to this context. User can access basic file
9453
9594
  * operations on downloaded content via the passed [Download](https://playwright.dev/docs/api/class-download)
@@ -9593,6 +9734,11 @@ export interface BrowserContext {
9593
9734
  */
9594
9735
  removeListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
9595
9736
 
9737
+ /**
9738
+ * Removes an event listener added by `on` or `addListener`.
9739
+ */
9740
+ removeListener(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
9741
+
9596
9742
  /**
9597
9743
  * Removes an event listener added by `on` or `addListener`.
9598
9744
  */
@@ -9678,6 +9824,11 @@ export interface BrowserContext {
9678
9824
  */
9679
9825
  off(event: 'dialog', listener: (dialog: Dialog) => any): this;
9680
9826
 
9827
+ /**
9828
+ * Removes an event listener added by `on` or `addListener`.
9829
+ */
9830
+ off(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
9831
+
9681
9832
  /**
9682
9833
  * Removes an event listener added by `on` or `addListener`.
9683
9834
  */
@@ -9799,6 +9950,14 @@ export interface BrowserContext {
9799
9950
  */
9800
9951
  prependListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
9801
9952
 
9953
+ /**
9954
+ * Emitted when a JavaScript dialog in any page belonging to this context has been closed, either by
9955
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
9956
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
9957
+ * headed browser.
9958
+ */
9959
+ prependListener(event: 'dialogclosed', listener: (dialog: Dialog) => any): this;
9960
+
9802
9961
  /**
9803
9962
  * Emitted when attachment download started in any page belonging to this context. User can access basic file
9804
9963
  * operations on downloaded content via the passed [Download](https://playwright.dev/docs/api/class-download)
@@ -10412,14 +10571,33 @@ export interface BrowserContext {
10412
10571
  }): Promise<void>;
10413
10572
 
10414
10573
  /**
10415
- * @deprecated Browsers may cache credentials after successful authentication. Create a new browser context instead.
10416
- * @param httpCredentials
10574
+ * Sets the credentials for HTTP authentication for this browser context.
10575
+ *
10576
+ * **NOTE** Browsers may cache credentials per origin after a successful authentication, so changing credentials for
10577
+ * an origin that has already been authenticated may have no effect.
10578
+ *
10579
+ * @param httpCredentials Pass an array to use different credentials for different origins. The first entry that matches the request origin
10580
+ * is used, and entries with no origin match any request.
10417
10581
  */
10418
10582
  setHTTPCredentials(httpCredentials: null|{
10419
10583
  username: string;
10420
10584
 
10421
10585
  password: string;
10422
- }): Promise<void>;
10586
+
10587
+ /**
10588
+ * Restrain sending http credentials on specific origin (scheme://host:port).
10589
+ */
10590
+ origin?: string;
10591
+ }|ReadonlyArray<{
10592
+ username: string;
10593
+
10594
+ password: string;
10595
+
10596
+ /**
10597
+ * Restrain sending http credentials on specific origin (scheme://host:port).
10598
+ */
10599
+ origin?: string;
10600
+ }>): Promise<void>;
10423
10601
 
10424
10602
  /**
10425
10603
  * @param offline Whether to emulate network being offline for the browser context.
@@ -10427,10 +10605,11 @@ export interface BrowserContext {
10427
10605
  setOffline(offline: boolean): Promise<void>;
10428
10606
 
10429
10607
  /**
10430
- * Clears the existing cookies, local storage, IndexedDB entries and virtual WebAuthn credentials, and sets the new
10431
- * storage state. When the storage state contains credentials, the virtual WebAuthn authenticator is installed
10432
- * (equivalent to [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install)),
10433
- * preventing all real authenticators from working in this context.
10608
+ * Clears the existing cookies, local storage, IndexedDB entries, origin private file system entries and virtual
10609
+ * WebAuthn credentials, and sets the new storage state. When the storage state contains credentials, the virtual
10610
+ * WebAuthn authenticator is installed (equivalent to
10611
+ * [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install)), preventing all
10612
+ * real authenticators from working in this context.
10434
10613
  *
10435
10614
  * **Usage**
10436
10615
  *
@@ -10496,7 +10675,7 @@ export interface BrowserContext {
10496
10675
 
10497
10676
  /**
10498
10677
  * Returns storage state for this browser context, contains current cookies, local storage snapshot, IndexedDB
10499
- * snapshot and virtual WebAuthn credentials.
10678
+ * snapshot, origin private file system snapshot and virtual WebAuthn credentials.
10500
10679
  * @param options
10501
10680
  */
10502
10681
  storageState(options?: {
@@ -10520,6 +10699,16 @@ export interface BrowserContext {
10520
10699
  */
10521
10700
  indexedDB?: boolean;
10522
10701
 
10702
+ /**
10703
+ * Set to `true` to include the
10704
+ * [origin private file system](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system)
10705
+ * in the storage state snapshot.
10706
+ *
10707
+ * **NOTE** OPFS is currently not supported in ephemeral WebKit contexts.
10708
+ *
10709
+ */
10710
+ opfs?: boolean;
10711
+
10523
10712
  /**
10524
10713
  * The file path to save the storage state to. If
10525
10714
  * [`path`](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state-option-path) is a
@@ -10648,6 +10837,14 @@ export interface BrowserContext {
10648
10837
  */
10649
10838
  waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;
10650
10839
 
10840
+ /**
10841
+ * Emitted when a JavaScript dialog in any page belonging to this context has been closed, either by
10842
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept), by
10843
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss), or manually by the user in the
10844
+ * headed browser.
10845
+ */
10846
+ waitForEvent(event: 'dialogclosed', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;
10847
+
10651
10848
  /**
10652
10849
  * Emitted when attachment download started in any page belonging to this context. User can access basic file
10653
10850
  * operations on downloaded content via the passed [Download](https://playwright.dev/docs/api/class-download)
@@ -11189,6 +11386,9 @@ export interface Browser {
11189
11386
  /**
11190
11387
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
11191
11388
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
11389
+ *
11390
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
11391
+ * is used, and entries with no origin match any request.
11192
11392
  */
11193
11393
  httpCredentials?: {
11194
11394
  username: string;
@@ -11208,7 +11408,25 @@ export interface Browser {
11208
11408
  * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
11209
11409
  */
11210
11410
  send?: "unauthorized"|"always";
11211
- };
11411
+ }|Array<{
11412
+ username: string;
11413
+
11414
+ password: string;
11415
+
11416
+ /**
11417
+ * Restrain sending http credentials on specific origin (scheme://host:port).
11418
+ */
11419
+ origin?: string;
11420
+
11421
+ /**
11422
+ * This option only applies to the requests sent from corresponding
11423
+ * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from
11424
+ * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each
11425
+ * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with
11426
+ * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
11427
+ */
11428
+ send?: "unauthorized"|"always";
11429
+ }>;
11212
11430
 
11213
11431
  /**
11214
11432
  * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
@@ -11912,118 +12130,297 @@ export interface JSHandle<T = any> {
11912
12130
  }
11913
12131
 
11914
12132
  /**
11915
- * - extends: [JSHandle](https://playwright.dev/docs/api/class-jshandle)
11916
- *
11917
- * ElementHandle represents an in-page DOM element. ElementHandles can be created with the
11918
- * [page.$(selector[, options])](https://playwright.dev/docs/api/class-page#page-query-selector) method.
11919
- *
11920
- * **NOTE** The use of ElementHandle is discouraged, use [Locator](https://playwright.dev/docs/api/class-locator)
11921
- * objects and web-first assertions instead.
11922
- *
11923
- * ```js
11924
- * const hrefElement = await page.$('a');
11925
- * await hrefElement.click();
11926
- * ```
11927
- *
11928
- * ElementHandle prevents DOM element from garbage collection unless the handle is disposed with
11929
- * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). ElementHandles are
11930
- * auto-disposed when their origin frame gets navigated.
11931
- *
11932
- * ElementHandle instances can be used as an argument in
11933
- * [page.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-eval-on-selector)
11934
- * and [page.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-evaluate)
11935
- * methods.
11936
- *
11937
- * The difference between the [Locator](https://playwright.dev/docs/api/class-locator) and ElementHandle is that the
11938
- * ElementHandle points to a particular element, while [Locator](https://playwright.dev/docs/api/class-locator)
11939
- * captures the logic of how to retrieve an element.
11940
- *
11941
- * In the example below, handle points to a particular DOM element on page. If that element changes text or is used by
11942
- * React to render an entirely different component, handle is still pointing to that very DOM element. This can lead
11943
- * to unexpected behaviors.
11944
- *
11945
- * ```js
11946
- * const handle = await page.$('text=Submit');
11947
- * // ...
11948
- * await handle.hover();
11949
- * await handle.click();
11950
- * ```
11951
- *
11952
- * With the locator, every time the `element` is used, up-to-date DOM element is located in the page using the
11953
- * selector. So in the snippet below, underlying DOM element is going to be located twice.
11954
- *
11955
- * ```js
11956
- * const locator = page.getByText('Submit');
11957
- * // ...
11958
- * await locator.hover();
11959
- * await locator.click();
11960
- * ```
11961
- *
12133
+ * [APIResponse](https://playwright.dev/docs/api/class-apiresponse) class represents responses returned by
12134
+ * [apiRequestContext.get(url[, options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get)
12135
+ * and similar methods.
11962
12136
  */
11963
- export interface ElementHandle<T=Node> extends JSHandle<T> {
12137
+ export interface APIResponse<T = any> {
11964
12138
  /**
11965
- * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
11966
- * instead. Read more about [locators](https://playwright.dev/docs/locators).
12139
+ * Returns the JSON representation of response body.
11967
12140
  *
11968
- * The method finds an element matching the specified selector in the `ElementHandle`'s subtree. If no elements match
11969
- * the selector, returns `null`.
11970
- * @param selector A selector to query for.
12141
+ * This method will throw if the response body is not parsable via `JSON.parse`.
11971
12142
  */
11972
- $<K extends keyof HTMLElementTagNameMap>(selector: K, options?: { strict: boolean }): Promise<ElementHandleForTag<K> | null>;
12143
+ json(): Promise<T>;
11973
12144
  /**
11974
- * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
11975
- * instead. Read more about [locators](https://playwright.dev/docs/locators).
11976
- *
11977
- * The method finds an element matching the specified selector in the `ElementHandle`'s subtree. If no elements match
11978
- * the selector, returns `null`.
11979
- * @param selector A selector to query for.
12145
+ * Returns the buffer with response body.
11980
12146
  */
11981
- $(selector: string, options?: { strict: boolean }): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
12147
+ body(): Promise<Buffer>;
11982
12148
 
11983
12149
  /**
11984
- * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
11985
- * instead. Read more about [locators](https://playwright.dev/docs/locators).
11986
- *
11987
- * The method finds all elements matching the specified selector in the `ElementHandle`s subtree. If no elements match
11988
- * the selector, returns empty array.
11989
- * @param selector A selector to query for.
12150
+ * Disposes the body of this response. If not called then the body will stay in memory until the context closes.
11990
12151
  */
11991
- $$<K extends keyof HTMLElementTagNameMap>(selector: K): Promise<ElementHandleForTag<K>[]>;
12152
+ dispose(): Promise<void>;
12153
+
11992
12154
  /**
11993
- * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
11994
- * instead. Read more about [locators](https://playwright.dev/docs/locators).
11995
- *
11996
- * The method finds all elements matching the specified selector in the `ElementHandle`s subtree. If no elements match
11997
- * the selector, returns empty array.
11998
- * @param selector A selector to query for.
12155
+ * An object with all the response HTTP headers associated with this response.
11999
12156
  */
12000
- $$(selector: string): Promise<ElementHandle<SVGElement | HTMLElement>[]>;
12157
+ headers(): { [key: string]: string; };
12001
12158
 
12002
12159
  /**
12003
- * **NOTE** This method does not wait for the element to pass actionability checks and therefore can lead to the flaky tests.
12004
- * Use
12005
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
12006
- * other [Locator](https://playwright.dev/docs/api/class-locator) helper methods or web-first assertions instead.
12007
- *
12008
- * Returns the return value of
12009
- * [`pageFunction`](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-option-expression).
12010
- *
12011
- * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a
12012
- * first argument to
12013
- * [`pageFunction`](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-option-expression).
12014
- * If no elements match the selector, the method throws an error.
12015
- *
12016
- * If
12017
- * [`pageFunction`](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-option-expression)
12018
- * returns a [Promise], then
12019
- * [elementHandle.$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector)
12020
- * would wait for the promise to resolve and return its value.
12021
- *
12022
- * **Usage**
12023
- *
12024
- * ```js
12025
- * const tweetHandle = await page.$('.tweet');
12026
- * expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');
12160
+ * An array with all the response HTTP headers associated with this response. Header names are not lower-cased.
12161
+ * Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
12162
+ */
12163
+ headersArray(): Array<{
12164
+ /**
12165
+ * Name of the header.
12166
+ */
12167
+ name: string;
12168
+
12169
+ /**
12170
+ * Value of the header.
12171
+ */
12172
+ value: string;
12173
+ }>;
12174
+
12175
+ /**
12176
+ * Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
12177
+ */
12178
+ ok(): boolean;
12179
+
12180
+ /**
12181
+ * Returns SSL and other security information. Resolves to `null` for non-HTTPS responses. For redirected requests,
12182
+ * returns the information for the last request in the redirect chain.
12183
+ */
12184
+ securityDetails(): Promise<null|{
12185
+ /**
12186
+ * Common Name component of the Issuer field. from the certificate. This should only be used for informational
12187
+ * purposes. Optional.
12188
+ */
12189
+ issuer?: string;
12190
+
12191
+ /**
12192
+ * The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.
12193
+ */
12194
+ protocol?: string;
12195
+
12196
+ /**
12197
+ * Common Name component of the Subject field from the certificate. This should only be used for informational
12198
+ * purposes. Optional.
12199
+ */
12200
+ subjectName?: string;
12201
+
12202
+ /**
12203
+ * Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.
12204
+ */
12205
+ validFrom?: number;
12206
+
12207
+ /**
12208
+ * Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.
12209
+ */
12210
+ validTo?: number;
12211
+ }>;
12212
+
12213
+ /**
12214
+ * Returns the IP address and port of the server. Resolves to `null` if the server address is not available. For
12215
+ * redirected requests, returns the information for the last request in the redirect chain.
12216
+ */
12217
+ serverAddr(): Promise<null|{
12218
+ /**
12219
+ * IPv4 or IPV6 address of the server.
12220
+ */
12221
+ ipAddress: string;
12222
+
12223
+ port: number;
12224
+ }>;
12225
+
12226
+ /**
12227
+ * Contains the status code of the response (e.g., 200 for a success).
12228
+ */
12229
+ status(): number;
12230
+
12231
+ /**
12232
+ * Contains the status text of the response (e.g. usually an "OK" for a success).
12233
+ */
12234
+ statusText(): string;
12235
+
12236
+ /**
12237
+ * Returns the text representation of response body.
12238
+ */
12239
+ text(): Promise<string>;
12240
+
12241
+ /**
12242
+ * Returns resource timing information for given response. For redirected requests, returns the information for the
12243
+ * last request in the redirect chain. When the response is served [from the HAR file](https://playwright.dev/docs/mock#replaying-from-har),
12244
+ * timing information is not available and all the values are -1. Find more information at
12245
+ * [Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).
12246
+ */
12247
+ timing(): {
12248
+ /**
12249
+ * Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
12250
+ */
12251
+ startTime: number;
12252
+
12253
+ /**
12254
+ * Time immediately before the client starts the domain name lookup for the resource. The value is given in
12255
+ * milliseconds relative to `startTime`, -1 if not available.
12256
+ */
12257
+ domainLookupStart: number;
12258
+
12259
+ /**
12260
+ * Time immediately after the client ends the domain name lookup for the resource. The value is given in milliseconds
12261
+ * relative to `startTime`, -1 if not available.
12262
+ */
12263
+ domainLookupEnd: number;
12264
+
12265
+ /**
12266
+ * Time immediately before the client starts establishing the connection to the server to retrieve the resource. The
12267
+ * value is given in milliseconds relative to `startTime`, -1 if not available.
12268
+ */
12269
+ connectStart: number;
12270
+
12271
+ /**
12272
+ * Time immediately before the client starts the handshake process to secure the current connection. The value is
12273
+ * given in milliseconds relative to `startTime`, -1 if not available.
12274
+ */
12275
+ secureConnectionStart: number;
12276
+
12277
+ /**
12278
+ * Time immediately after the client establishes the connection to the server to retrieve the resource. The value is
12279
+ * given in milliseconds relative to `startTime`, -1 if not available.
12280
+ */
12281
+ connectEnd: number;
12282
+
12283
+ /**
12284
+ * Time immediately before the client starts requesting the resource from the server, cache, or local resource. The
12285
+ * value is given in milliseconds relative to `startTime`, -1 if not available.
12286
+ */
12287
+ requestStart: number;
12288
+
12289
+ /**
12290
+ * Time immediately after the client receives the first byte of the response from the server, cache, or local
12291
+ * resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
12292
+ */
12293
+ responseStart: number;
12294
+
12295
+ /**
12296
+ * Time immediately after the client receives the last byte of the resource or immediately before the transport
12297
+ * connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not
12298
+ * available.
12299
+ */
12300
+ responseEnd: number;
12301
+ };
12302
+
12303
+ /**
12304
+ * Contains the URL of the response.
12305
+ */
12306
+ url(): string;
12307
+
12308
+ [Symbol.asyncDispose](): Promise<void>;
12309
+ }
12310
+
12311
+ /**
12312
+ * - extends: [JSHandle](https://playwright.dev/docs/api/class-jshandle)
12313
+ *
12314
+ * ElementHandle represents an in-page DOM element. ElementHandles can be created with the
12315
+ * [page.$(selector[, options])](https://playwright.dev/docs/api/class-page#page-query-selector) method.
12316
+ *
12317
+ * **NOTE** The use of ElementHandle is discouraged, use [Locator](https://playwright.dev/docs/api/class-locator)
12318
+ * objects and web-first assertions instead.
12319
+ *
12320
+ * ```js
12321
+ * const hrefElement = await page.$('a');
12322
+ * await hrefElement.click();
12323
+ * ```
12324
+ *
12325
+ * ElementHandle prevents DOM element from garbage collection unless the handle is disposed with
12326
+ * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). ElementHandles are
12327
+ * auto-disposed when their origin frame gets navigated.
12328
+ *
12329
+ * ElementHandle instances can be used as an argument in
12330
+ * [page.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-eval-on-selector)
12331
+ * and [page.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-evaluate)
12332
+ * methods.
12333
+ *
12334
+ * The difference between the [Locator](https://playwright.dev/docs/api/class-locator) and ElementHandle is that the
12335
+ * ElementHandle points to a particular element, while [Locator](https://playwright.dev/docs/api/class-locator)
12336
+ * captures the logic of how to retrieve an element.
12337
+ *
12338
+ * In the example below, handle points to a particular DOM element on page. If that element changes text or is used by
12339
+ * React to render an entirely different component, handle is still pointing to that very DOM element. This can lead
12340
+ * to unexpected behaviors.
12341
+ *
12342
+ * ```js
12343
+ * const handle = await page.$('text=Submit');
12344
+ * // ...
12345
+ * await handle.hover();
12346
+ * await handle.click();
12347
+ * ```
12348
+ *
12349
+ * With the locator, every time the `element` is used, up-to-date DOM element is located in the page using the
12350
+ * selector. So in the snippet below, underlying DOM element is going to be located twice.
12351
+ *
12352
+ * ```js
12353
+ * const locator = page.getByText('Submit');
12354
+ * // ...
12355
+ * await locator.hover();
12356
+ * await locator.click();
12357
+ * ```
12358
+ *
12359
+ */
12360
+ export interface ElementHandle<T=Node> extends JSHandle<T> {
12361
+ /**
12362
+ * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
12363
+ * instead. Read more about [locators](https://playwright.dev/docs/locators).
12364
+ *
12365
+ * The method finds an element matching the specified selector in the `ElementHandle`'s subtree. If no elements match
12366
+ * the selector, returns `null`.
12367
+ * @param selector A selector to query for.
12368
+ */
12369
+ $<K extends keyof HTMLElementTagNameMap>(selector: K, options?: { strict: boolean }): Promise<ElementHandleForTag<K> | null>;
12370
+ /**
12371
+ * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
12372
+ * instead. Read more about [locators](https://playwright.dev/docs/locators).
12373
+ *
12374
+ * The method finds an element matching the specified selector in the `ElementHandle`'s subtree. If no elements match
12375
+ * the selector, returns `null`.
12376
+ * @param selector A selector to query for.
12377
+ */
12378
+ $(selector: string, options?: { strict: boolean }): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
12379
+
12380
+ /**
12381
+ * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
12382
+ * instead. Read more about [locators](https://playwright.dev/docs/locators).
12383
+ *
12384
+ * The method finds all elements matching the specified selector in the `ElementHandle`s subtree. If no elements match
12385
+ * the selector, returns empty array.
12386
+ * @param selector A selector to query for.
12387
+ */
12388
+ $$<K extends keyof HTMLElementTagNameMap>(selector: K): Promise<ElementHandleForTag<K>[]>;
12389
+ /**
12390
+ * **NOTE** Use locator-based [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator)
12391
+ * instead. Read more about [locators](https://playwright.dev/docs/locators).
12392
+ *
12393
+ * The method finds all elements matching the specified selector in the `ElementHandle`s subtree. If no elements match
12394
+ * the selector, returns empty array.
12395
+ * @param selector A selector to query for.
12396
+ */
12397
+ $$(selector: string): Promise<ElementHandle<SVGElement | HTMLElement>[]>;
12398
+
12399
+ /**
12400
+ * **NOTE** This method does not wait for the element to pass actionability checks and therefore can lead to the flaky tests.
12401
+ * Use
12402
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
12403
+ * other [Locator](https://playwright.dev/docs/api/class-locator) helper methods or web-first assertions instead.
12404
+ *
12405
+ * Returns the return value of
12406
+ * [`pageFunction`](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-option-expression).
12407
+ *
12408
+ * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a
12409
+ * first argument to
12410
+ * [`pageFunction`](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-option-expression).
12411
+ * If no elements match the selector, the method throws an error.
12412
+ *
12413
+ * If
12414
+ * [`pageFunction`](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-option-expression)
12415
+ * returns a [Promise], then
12416
+ * [elementHandle.$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector)
12417
+ * would wait for the promise to resolve and return its value.
12418
+ *
12419
+ * **Usage**
12420
+ *
12421
+ * ```js
12422
+ * const tweetHandle = await page.$('.tweet');
12423
+ * expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');
12027
12424
  * expect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');
12028
12425
  * ```
12029
12426
  *
@@ -14157,6 +14554,74 @@ export interface Locator {
14157
14554
  timeout?: number;
14158
14555
  }): Promise<string>;
14159
14556
 
14557
+ /**
14558
+ * Captures the aria snapshot of the given element as a free form JSON object.
14559
+ *
14560
+ * **Usage**
14561
+ *
14562
+ * ```js
14563
+ * await page.getByRole('list').ariaSnapshotJSON();
14564
+ * ```
14565
+ *
14566
+ * **Details**
14567
+ *
14568
+ * This method returns the same tree as
14569
+ * [locator.ariaSnapshot([options])](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot), serialized
14570
+ * as a JSON value instead of YAML markup. The result is a list of nodes, each node being an object with the following
14571
+ * properties:
14572
+ * - `role` Aria role of the element, or `"text"` for a static text fragment.
14573
+ * - `name` Accessible name of the element, if any.
14574
+ * - `text` Text content of the element when it is the only child, or the content of a static text fragment.
14575
+ * - `children` Child nodes and text fragments.
14576
+ * - Boolean and value properties for element state flags: `checked`, `disabled`, `expanded`, `active`, `invalid`,
14577
+ * `level`, `pressed` and `selected`.
14578
+ * - Additional element properties, for example `url` for links and `placeholder` for text boxes.
14579
+ * - `ref` Element reference for AI-optimized snapshots.
14580
+ * - `cursor` Set to `"pointer"` for clickable elements in AI-optimized snapshots.
14581
+ * - `box` Bounding box of the element when
14582
+ * [`boxes`](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot-json-option-boxes) is set.
14583
+ * @param options
14584
+ */
14585
+ ariaSnapshotJSON(options?: {
14586
+ /**
14587
+ * When `true`, includes each element's bounding box as a `box` property with `x`, `y`, `width` and `height`.
14588
+ * Coordinates are relative to the viewport, in CSS pixels, as returned by
14589
+ * [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
14590
+ * Defaults to `false`.
14591
+ */
14592
+ boxes?: boolean;
14593
+
14594
+ /**
14595
+ * When specified, limits the depth of the snapshot.
14596
+ */
14597
+ depth?: number;
14598
+
14599
+ /**
14600
+ * When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to `"default"`. See details in
14601
+ * [locator.ariaSnapshot([options])](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot).
14602
+ */
14603
+ mode?: "ai"|"default";
14604
+
14605
+ /**
14606
+ * Allows to cancel the operation using an
14607
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
14608
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
14609
+ * which can be changed using
14610
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
14611
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
14612
+ * `timeout: 0` to disable the timeout entirely.
14613
+ */
14614
+ signal?: AbortSignal;
14615
+
14616
+ /**
14617
+ * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
14618
+ * option in the config, or by using the
14619
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
14620
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
14621
+ */
14622
+ timeout?: number;
14623
+ }): Promise<Serializable>;
14624
+
14160
14625
  /**
14161
14626
  * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) on the element.
14162
14627
  * @param options
@@ -15078,7 +15543,9 @@ export interface Locator {
15078
15543
  hasText?: string|RegExp;
15079
15544
 
15080
15545
  /**
15081
- * Only matches visible or invisible elements.
15546
+ * Only matches visible or invisible elements. Prefer the
15547
+ * [locator.visible()](https://playwright.dev/docs/api/class-locator#locator-visible) shortcut when matching only
15548
+ * visible elements.
15082
15549
  */
15083
15550
  visible?: boolean;
15084
15551
  }): Locator;
@@ -16751,6 +17218,34 @@ export interface Locator {
16751
17218
  trial?: boolean;
16752
17219
  }): Promise<void>;
16753
17220
 
17221
+ /**
17222
+ * Returns a locator that matches only [visible](https://playwright.dev/docs/actionability#visible) elements, ignoring the invisible ones.
17223
+ * This is the recommended way to distinguish elements by visibility, as opposed to the `:visible` CSS pseudo-class.
17224
+ *
17225
+ * Note that visibility is checked every time the locator is used, and not at the moment of the
17226
+ * [locator.visible()](https://playwright.dev/docs/api/class-locator#locator-visible) call.
17227
+ *
17228
+ * **Usage**
17229
+ *
17230
+ * Consider a page with two buttons, the first invisible and the second visible.
17231
+ *
17232
+ * ```html
17233
+ * <button style='display: none'>Invisible</button>
17234
+ * <button>Visible</button>
17235
+ * ```
17236
+ *
17237
+ * This will only find the second button, because it is visible, and then click it.
17238
+ *
17239
+ * ```js
17240
+ * await page.locator('button').visible().click();
17241
+ * ```
17242
+ *
17243
+ * To match invisible elements instead, use
17244
+ * [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) with the
17245
+ * [`visible`](https://playwright.dev/docs/api/class-locator#locator-filter-option-visible) option set to `false`.
17246
+ */
17247
+ visible(): Locator;
17248
+
16754
17249
  /**
16755
17250
  * Returns when element specified by locator satisfies the
16756
17251
  * [`state`](https://playwright.dev/docs/api/class-locator#locator-wait-for-option-state) option.
@@ -17230,6 +17725,9 @@ export interface BrowserType<Unused = {}> {
17230
17725
  /**
17231
17726
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
17232
17727
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
17728
+ *
17729
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
17730
+ * is used, and entries with no origin match any request.
17233
17731
  */
17234
17732
  httpCredentials?: {
17235
17733
  username: string;
@@ -17249,7 +17747,25 @@ export interface BrowserType<Unused = {}> {
17249
17747
  * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
17250
17748
  */
17251
17749
  send?: "unauthorized"|"always";
17252
- };
17750
+ }|Array<{
17751
+ username: string;
17752
+
17753
+ password: string;
17754
+
17755
+ /**
17756
+ * Restrain sending http credentials on specific origin (scheme://host:port).
17757
+ */
17758
+ origin?: string;
17759
+
17760
+ /**
17761
+ * This option only applies to the requests sent from corresponding
17762
+ * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from
17763
+ * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each
17764
+ * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with
17765
+ * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
17766
+ */
17767
+ send?: "unauthorized"|"always";
17768
+ }>;
17253
17769
 
17254
17770
  /**
17255
17771
  * If `true`, Playwright does not pass its own configurations args and only uses the ones from
@@ -18140,11 +18656,6 @@ export interface Screencast {
18140
18656
  height: number;
18141
18657
  };
18142
18658
  quality?: number;
18143
- annotate?: {
18144
- duration?: number;
18145
- position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right';
18146
- fontSize?: number;
18147
- };
18148
18659
  }): Promise<Disposable>;
18149
18660
  /**
18150
18661
  * Removes action decorations.
@@ -18845,6 +19356,9 @@ export interface APIRequest {
18845
19356
  /**
18846
19357
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
18847
19358
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
19359
+ *
19360
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
19361
+ * is used, and entries with no origin match any request.
18848
19362
  */
18849
19363
  httpCredentials?: {
18850
19364
  username: string;
@@ -18864,7 +19378,25 @@ export interface APIRequest {
18864
19378
  * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
18865
19379
  */
18866
19380
  send?: "unauthorized"|"always";
18867
- };
19381
+ }|Array<{
19382
+ username: string;
19383
+
19384
+ password: string;
19385
+
19386
+ /**
19387
+ * Restrain sending http credentials on specific origin (scheme://host:port).
19388
+ */
19389
+ origin?: string;
19390
+
19391
+ /**
19392
+ * This option only applies to the requests sent from corresponding
19393
+ * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from
19394
+ * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each
19395
+ * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with
19396
+ * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
19397
+ */
19398
+ send?: "unauthorized"|"always";
19399
+ }>;
18868
19400
 
18869
19401
  /**
18870
19402
  * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
@@ -18995,7 +19527,7 @@ export interface APIRequestContext {
18995
19527
  * @param url Target URL.
18996
19528
  * @param options
18997
19529
  */
18998
- delete(url: string, options?: {
19530
+ delete<T = any>(url: string, options?: {
18999
19531
  /**
19000
19532
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19001
19533
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19083,7 +19615,7 @@ export interface APIRequestContext {
19083
19615
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19084
19616
  */
19085
19617
  timeout?: number;
19086
- }): Promise<APIResponse>;
19618
+ }): Promise<APIResponse<T>>;
19087
19619
 
19088
19620
  /**
19089
19621
  * All responses returned by
@@ -19137,7 +19669,7 @@ export interface APIRequestContext {
19137
19669
  * @param urlOrRequest Target URL or Request to get all parameters from.
19138
19670
  * @param options
19139
19671
  */
19140
- fetch(urlOrRequest: string|Request, options?: {
19672
+ fetch<T = any>(urlOrRequest: string|Request, options?: {
19141
19673
  /**
19142
19674
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19143
19675
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19231,7 +19763,7 @@ export interface APIRequestContext {
19231
19763
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19232
19764
  */
19233
19765
  timeout?: number;
19234
- }): Promise<APIResponse>;
19766
+ }): Promise<APIResponse<T>>;
19235
19767
 
19236
19768
  /**
19237
19769
  * Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its
@@ -19266,7 +19798,7 @@ export interface APIRequestContext {
19266
19798
  * @param url Target URL.
19267
19799
  * @param options
19268
19800
  */
19269
- get(url: string, options?: {
19801
+ get<T = any>(url: string, options?: {
19270
19802
  /**
19271
19803
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19272
19804
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19354,7 +19886,7 @@ export interface APIRequestContext {
19354
19886
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19355
19887
  */
19356
19888
  timeout?: number;
19357
- }): Promise<APIResponse>;
19889
+ }): Promise<APIResponse<T>>;
19358
19890
 
19359
19891
  /**
19360
19892
  * Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its
@@ -19363,7 +19895,7 @@ export interface APIRequestContext {
19363
19895
  * @param url Target URL.
19364
19896
  * @param options
19365
19897
  */
19366
- head(url: string, options?: {
19898
+ head<T = any>(url: string, options?: {
19367
19899
  /**
19368
19900
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19369
19901
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19451,7 +19983,7 @@ export interface APIRequestContext {
19451
19983
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19452
19984
  */
19453
19985
  timeout?: number;
19454
- }): Promise<APIResponse>;
19986
+ }): Promise<APIResponse<T>>;
19455
19987
 
19456
19988
  /**
19457
19989
  * Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its
@@ -19460,7 +19992,7 @@ export interface APIRequestContext {
19460
19992
  * @param url Target URL.
19461
19993
  * @param options
19462
19994
  */
19463
- patch(url: string, options?: {
19995
+ patch<T = any>(url: string, options?: {
19464
19996
  /**
19465
19997
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19466
19998
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19548,7 +20080,7 @@ export interface APIRequestContext {
19548
20080
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19549
20081
  */
19550
20082
  timeout?: number;
19551
- }): Promise<APIResponse>;
20083
+ }): Promise<APIResponse<T>>;
19552
20084
 
19553
20085
  /**
19554
20086
  * Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its
@@ -19599,7 +20131,7 @@ export interface APIRequestContext {
19599
20131
  * @param url Target URL.
19600
20132
  * @param options
19601
20133
  */
19602
- post(url: string, options?: {
20134
+ post<T = any>(url: string, options?: {
19603
20135
  /**
19604
20136
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19605
20137
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19687,7 +20219,7 @@ export interface APIRequestContext {
19687
20219
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19688
20220
  */
19689
20221
  timeout?: number;
19690
- }): Promise<APIResponse>;
20222
+ }): Promise<APIResponse<T>>;
19691
20223
 
19692
20224
  /**
19693
20225
  * Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its
@@ -19696,7 +20228,7 @@ export interface APIRequestContext {
19696
20228
  * @param url Target URL.
19697
20229
  * @param options
19698
20230
  */
19699
- put(url: string, options?: {
20231
+ put<T = any>(url: string, options?: {
19700
20232
  /**
19701
20233
  * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
19702
20234
  * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
@@ -19784,7 +20316,7 @@ export interface APIRequestContext {
19784
20316
  * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
19785
20317
  */
19786
20318
  timeout?: number;
19787
- }): Promise<APIResponse>;
20319
+ }): Promise<APIResponse<T>>;
19788
20320
 
19789
20321
  /**
19790
20322
  * Returns storage state for this request context, contains current cookies and local storage snapshot if it was
@@ -19797,6 +20329,11 @@ export interface APIRequestContext {
19797
20329
  */
19798
20330
  indexedDB?: boolean;
19799
20331
 
20332
+ /**
20333
+ * Set to `true` to include the origin private file system in the storage state snapshot.
20334
+ */
20335
+ opfs?: boolean;
20336
+
19800
20337
  /**
19801
20338
  * The file path to save the storage state to. If
19802
20339
  * [`path`](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-storage-state-option-path) is
@@ -19837,187 +20374,10 @@ export interface APIRequestContext {
19837
20374
  }>;
19838
20375
  }>;
19839
20376
 
19840
- tracing: Tracing;
19841
-
19842
- [Symbol.asyncDispose](): Promise<void>;
19843
- }
19844
-
19845
- /**
19846
- * [APIResponse](https://playwright.dev/docs/api/class-apiresponse) class represents responses returned by
19847
- * [apiRequestContext.get(url[, options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get)
19848
- * and similar methods.
19849
- */
19850
- export interface APIResponse {
19851
- /**
19852
- * Returns the buffer with response body.
19853
- */
19854
- body(): Promise<Buffer>;
19855
-
19856
- /**
19857
- * Disposes the body of this response. If not called then the body will stay in memory until the context closes.
19858
- */
19859
- dispose(): Promise<void>;
19860
-
19861
- /**
19862
- * An object with all the response HTTP headers associated with this response.
19863
- */
19864
- headers(): { [key: string]: string; };
19865
-
19866
- /**
19867
- * An array with all the response HTTP headers associated with this response. Header names are not lower-cased.
19868
- * Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
19869
- */
19870
- headersArray(): Array<{
19871
- /**
19872
- * Name of the header.
19873
- */
19874
- name: string;
19875
-
19876
- /**
19877
- * Value of the header.
19878
- */
19879
- value: string;
19880
- }>;
19881
-
19882
- /**
19883
- * Returns the JSON representation of response body.
19884
- *
19885
- * This method will throw if the response body is not parsable via `JSON.parse`.
19886
- */
19887
- json(): Promise<Serializable>;
19888
-
19889
- /**
19890
- * Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
19891
- */
19892
- ok(): boolean;
19893
-
19894
- /**
19895
- * Returns SSL and other security information. Resolves to `null` for non-HTTPS responses. For redirected requests,
19896
- * returns the information for the last request in the redirect chain.
19897
- */
19898
- securityDetails(): Promise<null|{
19899
- /**
19900
- * Common Name component of the Issuer field. from the certificate. This should only be used for informational
19901
- * purposes. Optional.
19902
- */
19903
- issuer?: string;
19904
-
19905
- /**
19906
- * The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.
19907
- */
19908
- protocol?: string;
19909
-
19910
- /**
19911
- * Common Name component of the Subject field from the certificate. This should only be used for informational
19912
- * purposes. Optional.
19913
- */
19914
- subjectName?: string;
19915
-
19916
- /**
19917
- * Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.
19918
- */
19919
- validFrom?: number;
19920
-
19921
- /**
19922
- * Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.
19923
- */
19924
- validTo?: number;
19925
- }>;
19926
-
19927
- /**
19928
- * Returns the IP address and port of the server. Resolves to `null` if the server address is not available. For
19929
- * redirected requests, returns the information for the last request in the redirect chain.
19930
- */
19931
- serverAddr(): Promise<null|{
19932
- /**
19933
- * IPv4 or IPV6 address of the server.
19934
- */
19935
- ipAddress: string;
19936
-
19937
- port: number;
19938
- }>;
19939
-
19940
- /**
19941
- * Contains the status code of the response (e.g., 200 for a success).
19942
- */
19943
- status(): number;
19944
-
19945
- /**
19946
- * Contains the status text of the response (e.g. usually an "OK" for a success).
19947
- */
19948
- statusText(): string;
19949
-
19950
- /**
19951
- * Returns the text representation of response body.
19952
- */
19953
- text(): Promise<string>;
19954
-
19955
- /**
19956
- * Returns resource timing information for given response. For redirected requests, returns the information for the
19957
- * last request in the redirect chain. When the response is served [from the HAR file](https://playwright.dev/docs/mock#replaying-from-har),
19958
- * timing information is not available and all the values are -1. Find more information at
19959
- * [Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).
19960
- */
19961
- timing(): {
19962
- /**
19963
- * Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
19964
- */
19965
- startTime: number;
19966
-
19967
- /**
19968
- * Time immediately before the client starts the domain name lookup for the resource. The value is given in
19969
- * milliseconds relative to `startTime`, -1 if not available.
19970
- */
19971
- domainLookupStart: number;
19972
-
19973
- /**
19974
- * Time immediately after the client ends the domain name lookup for the resource. The value is given in milliseconds
19975
- * relative to `startTime`, -1 if not available.
19976
- */
19977
- domainLookupEnd: number;
19978
-
19979
- /**
19980
- * Time immediately before the client starts establishing the connection to the server to retrieve the resource. The
19981
- * value is given in milliseconds relative to `startTime`, -1 if not available.
19982
- */
19983
- connectStart: number;
19984
-
19985
- /**
19986
- * Time immediately before the client starts the handshake process to secure the current connection. The value is
19987
- * given in milliseconds relative to `startTime`, -1 if not available.
19988
- */
19989
- secureConnectionStart: number;
19990
-
19991
- /**
19992
- * Time immediately after the client establishes the connection to the server to retrieve the resource. The value is
19993
- * given in milliseconds relative to `startTime`, -1 if not available.
19994
- */
19995
- connectEnd: number;
19996
-
19997
- /**
19998
- * Time immediately before the client starts requesting the resource from the server, cache, or local resource. The
19999
- * value is given in milliseconds relative to `startTime`, -1 if not available.
20000
- */
20001
- requestStart: number;
20002
-
20003
- /**
20004
- * Time immediately after the client receives the first byte of the response from the server, cache, or local
20005
- * resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
20006
- */
20007
- responseStart: number;
20008
-
20009
- /**
20010
- * Time immediately after the client receives the last byte of the resource or immediately before the transport
20011
- * connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not
20012
- * available.
20013
- */
20014
- responseEnd: number;
20015
- };
20016
-
20017
20377
  /**
20018
- * Contains the URL of the response.
20378
+ * Tracing recorder for requests made through this API request context.
20019
20379
  */
20020
- url(): string;
20380
+ tracing: Tracing;
20021
20381
 
20022
20382
  [Symbol.asyncDispose](): Promise<void>;
20023
20383
  }
@@ -20988,7 +21348,7 @@ export interface FileChooser {
20988
21348
  * FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the
20989
21349
  * `iframe` and locate elements in that iframe. FrameLocator can be created with either
20990
21350
  * [locator.contentFrame()](https://playwright.dev/docs/api/class-locator#locator-content-frame),
20991
- * [page.frameLocator(selector)](https://playwright.dev/docs/api/class-page#page-frame-locator) or
21351
+ * [page.frameLocator([selector])](https://playwright.dev/docs/api/class-page#page-frame-locator) or
20992
21352
  * [locator.frameLocator(selector)](https://playwright.dev/docs/api/class-locator#locator-frame-locator) method.
20993
21353
  *
20994
21354
  * ```js
@@ -21009,6 +21369,32 @@ export interface FileChooser {
21009
21369
  * await page.locator('.result-frame').contentFrame().first().getByRole('button').click();
21010
21370
  * ```
21011
21371
  *
21372
+ * **Any frame**
21373
+ *
21374
+ * Calling [page.frameLocator([selector])](https://playwright.dev/docs/api/class-page#page-frame-locator) or
21375
+ * [frame.frameLocator([selector])](https://playwright.dev/docs/api/class-frame#frame-frame-locator) without a
21376
+ * selector creates a frame locator that starts the search in any frame of the subtree - so that you don't need to
21377
+ * locate the iframe first.
21378
+ *
21379
+ * ```js
21380
+ * // Finds the button in any frame on the page:
21381
+ * await page.frameLocator().getByRole('button').click();
21382
+ *
21383
+ * // Finds the iframe with id "my-frame" anywhere on the page, and clicks the button inside it:
21384
+ * await page.frameLocator().locator('#my-frame').contentFrame().getByRole('button').click();
21385
+ * ```
21386
+ *
21387
+ * Only the start of the search is affected - the rest of the locator is resolved inside a single frame, just like any
21388
+ * other locator. Following the strictness rules above, an error is thrown when elements are matched in multiple
21389
+ * frames.
21390
+ *
21391
+ * Such a frame locator does not point to a particular `iframe`, so
21392
+ * [frameLocator.owner()](https://playwright.dev/docs/api/class-framelocator#frame-locator-owner),
21393
+ * [frameLocator.first()](https://playwright.dev/docs/api/class-framelocator#frame-locator-first),
21394
+ * [frameLocator.last()](https://playwright.dev/docs/api/class-framelocator#frame-locator-last) and
21395
+ * [frameLocator.nth(index)](https://playwright.dev/docs/api/class-framelocator#frame-locator-nth) are not supported
21396
+ * on it.
21397
+ *
21012
21398
  * **Converting Locator to FrameLocator**
21013
21399
  *
21014
21400
  * If you have a [Locator](https://playwright.dev/docs/api/class-locator) object pointing to an `iframe` it can be
@@ -22521,7 +22907,7 @@ export interface Route {
22521
22907
  * instead.
22522
22908
  * @param options
22523
22909
  */
22524
- fetch(options?: {
22910
+ fetch<T = any>(options?: {
22525
22911
  /**
22526
22912
  * If set changes the request HTTP headers. Header values will be converted to a string.
22527
22913
  */
@@ -22571,7 +22957,7 @@ export interface Route {
22571
22957
  * If set changes the request URL. New URL must have same protocol as original one.
22572
22958
  */
22573
22959
  url?: string;
22574
- }): Promise<APIResponse>;
22960
+ }): Promise<APIResponse<T>>;
22575
22961
 
22576
22962
  /**
22577
22963
  * Fulfills route's request with given response.
@@ -22861,11 +23247,24 @@ export interface Tracing {
22861
23247
  screenshots?: boolean;
22862
23248
 
22863
23249
  /**
22864
- * If this option is true tracing will
22865
- * - capture DOM snapshot on every action
22866
- * - record network activity
23250
+ * Which snapshots to capture on every action. Passing `true` is a shortcut for `{ dom: true }`.
22867
23251
  */
22868
- snapshots?: boolean;
23252
+ snapshots?: boolean|{
23253
+ /**
23254
+ * Capture DOM snapshot on every action and record network activity. Optional.
23255
+ */
23256
+ dom?: boolean;
23257
+
23258
+ /**
23259
+ * Capture aria snapshot of the page on every action. Optional.
23260
+ */
23261
+ aria?: boolean;
23262
+
23263
+ /**
23264
+ * Capture a screenshot of the page on every action. Optional.
23265
+ */
23266
+ screen?: boolean;
23267
+ };
22869
23268
 
22870
23269
  /**
22871
23270
  * Whether to include source files for trace actions.
@@ -22928,8 +23327,8 @@ export interface Tracing {
22928
23327
  * [tracing.stopHar()](https://playwright.dev/docs/api/class-tracing#tracing-stop-har) is called, or when the returned
22929
23328
  * [Disposable](https://playwright.dev/docs/api/class-disposable) is disposed.
22930
23329
  *
22931
- * Only one HAR recording can be active at a time per
22932
- * [BrowserContext](https://playwright.dev/docs/api/class-browsercontext).
23330
+ * Only one HAR recording can be active at a time per [Tracing](https://playwright.dev/docs/api/class-tracing)
23331
+ * instance.
22933
23332
  *
22934
23333
  * **Usage**
22935
23334
  *
@@ -23548,6 +23947,9 @@ export interface Electron {
23548
23947
  /**
23549
23948
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
23550
23949
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
23950
+ *
23951
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
23952
+ * is used, and entries with no origin match any request.
23551
23953
  */
23552
23954
  httpCredentials?: {
23553
23955
  username: string;
@@ -23567,7 +23969,25 @@ export interface Electron {
23567
23969
  * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
23568
23970
  */
23569
23971
  send?: "unauthorized"|"always";
23570
- };
23972
+ }|Array<{
23973
+ username: string;
23974
+
23975
+ password: string;
23976
+
23977
+ /**
23978
+ * Restrain sending http credentials on specific origin (scheme://host:port).
23979
+ */
23980
+ origin?: string;
23981
+
23982
+ /**
23983
+ * This option only applies to the requests sent from corresponding
23984
+ * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from
23985
+ * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each
23986
+ * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with
23987
+ * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
23988
+ */
23989
+ send?: "unauthorized"|"always";
23990
+ }>;
23571
23991
 
23572
23992
  /**
23573
23993
  * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
@@ -24185,6 +24605,9 @@ export interface AndroidDevice {
24185
24605
  /**
24186
24606
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
24187
24607
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
24608
+ *
24609
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
24610
+ * is used, and entries with no origin match any request.
24188
24611
  */
24189
24612
  httpCredentials?: {
24190
24613
  username: string;
@@ -24204,7 +24627,25 @@ export interface AndroidDevice {
24204
24627
  * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
24205
24628
  */
24206
24629
  send?: "unauthorized"|"always";
24207
- };
24630
+ }|Array<{
24631
+ username: string;
24632
+
24633
+ password: string;
24634
+
24635
+ /**
24636
+ * Restrain sending http credentials on specific origin (scheme://host:port).
24637
+ */
24638
+ origin?: string;
24639
+
24640
+ /**
24641
+ * This option only applies to the requests sent from corresponding
24642
+ * [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) and does not affect requests sent from
24643
+ * the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each
24644
+ * API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with
24645
+ * `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
24646
+ */
24647
+ send?: "unauthorized"|"always";
24648
+ }>;
24208
24649
 
24209
24650
  /**
24210
24651
  * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
@@ -25417,8 +25858,11 @@ export interface BrowserContextOptions {
25417
25858
  /**
25418
25859
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
25419
25860
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
25861
+ *
25862
+ * Pass an array to use different credentials for different origins. The first entry that matches the request origin
25863
+ * is used, and entries with no origin match any request.
25420
25864
  */
25421
- httpCredentials?: HTTPCredentials;
25865
+ httpCredentials?: HTTPCredentials|Array<HTTPCredentials>;
25422
25866
 
25423
25867
  /**
25424
25868
  * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.