patchright-core 1.56.0 → 1.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ThirdPartyNotices.txt +40 -381
- package/bin/install_webkit_wsl.ps1 +1 -3
- package/browsers.json +13 -13
- package/lib/cli/program.js +14 -57
- package/lib/client/api.js +0 -3
- package/lib/client/browserContext.js +22 -4
- package/lib/client/consoleMessage.js +5 -1
- package/lib/client/electron.js +1 -1
- package/lib/client/events.js +2 -1
- package/lib/client/locator.js +4 -1
- package/lib/client/page.js +2 -5
- package/lib/client/playwright.js +1 -5
- package/lib/client/tracing.js +6 -4
- package/lib/client/worker.js +22 -0
- package/lib/generated/clockSource.js +1 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/pollingRecorderSource.js +1 -1
- package/lib/inProcessFactory.js +0 -2
- package/lib/protocol/validator.js +24 -46
- package/lib/server/android/android.js +1 -1
- package/lib/server/bidi/bidiBrowser.js +26 -11
- package/lib/server/bidi/bidiChromium.js +1 -1
- package/lib/server/bidi/bidiFirefox.js +1 -1
- package/lib/server/bidi/bidiPage.js +25 -5
- package/lib/server/browserContext.js +9 -10
- package/lib/server/chromium/chromium.js +12 -1
- package/lib/server/chromium/chromiumSwitches.js +10 -1
- package/lib/server/chromium/crBrowser.js +10 -1
- package/lib/server/chromium/crNetworkManager.js +15 -6
- package/lib/server/chromium/crPage.js +7 -9
- package/lib/server/chromium/crServiceWorker.js +14 -1
- package/lib/server/chromium/videoRecorder.js +14 -12
- package/lib/server/console.js +5 -1
- package/lib/server/deviceDescriptorsSource.json +56 -56
- package/lib/server/dispatchers/browserContextDispatcher.js +23 -6
- package/lib/server/dispatchers/pageDispatcher.js +10 -22
- package/lib/server/dispatchers/playwrightDispatcher.js +0 -4
- package/lib/server/electron/electron.js +1 -1
- package/lib/server/firefox/ffPage.js +3 -6
- package/lib/server/firefox/firefox.js +12 -1
- package/lib/server/frameSelectors.js +2 -4
- package/lib/server/frames.js +6 -1
- package/lib/server/input.js +7 -3
- package/lib/server/localUtils.js +4 -8
- package/lib/server/page.js +54 -38
- package/lib/server/playwright.js +2 -4
- package/lib/server/recorder/recorderApp.js +1 -1
- package/lib/server/recorder.js +3 -2
- package/lib/server/registry/index.js +114 -48
- package/lib/server/registry/oopDownloadBrowserMain.js +6 -2
- package/lib/server/socksClientCertificatesInterceptor.js +1 -1
- package/lib/server/trace/recorder/tracing.js +2 -0
- package/lib/server/trace/viewer/traceViewer.js +37 -36
- package/lib/server/utils/comparators.js +3 -25
- package/lib/server/utils/hostPlatform.js +15 -3
- package/lib/server/utils/imageUtils.js +141 -0
- package/lib/server/utils/network.js +22 -16
- package/lib/server/webkit/webkit.js +1 -10
- package/lib/server/webkit/wkPage.js +1 -5
- package/lib/server/webkit/wkWorkers.js +2 -1
- package/lib/utils/isomorphic/ariaSnapshot.js +5 -0
- package/lib/utils/isomorphic/locatorGenerators.js +24 -8
- package/lib/utils/isomorphic/mimeType.js +1 -1
- package/lib/utils/isomorphic/protocolFormatter.js +3 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +2 -1
- package/lib/utils/isomorphic/urlMatch.js +19 -5
- package/lib/utils.js +2 -0
- package/lib/utilsBundle.js +6 -3
- package/lib/utilsBundleImpl/index.js +171 -171
- package/lib/vite/htmlReport/index.html +18 -18
- package/lib/vite/recorder/assets/codeMirrorModule-CBbSe-ZI.js +25 -0
- package/lib/vite/recorder/assets/{index-Y-X2TGJv.js → index-CpZVd2nA.js} +32 -32
- package/lib/vite/recorder/index.html +1 -1
- package/lib/vite/traceViewer/assets/codeMirrorModule-DHz0wP2C.js +25 -0
- package/lib/vite/traceViewer/assets/defaultSettingsView-WsZP88O6.js +266 -0
- package/lib/vite/traceViewer/defaultSettingsView.ConWv5KN.css +1 -0
- package/lib/vite/traceViewer/index.C4Y3Aw8n.css +1 -0
- package/lib/vite/traceViewer/index.C8xAeo93.js +2 -0
- package/lib/vite/traceViewer/index.html +6 -6
- package/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/lib/vite/traceViewer/snapshot.html +3 -3
- package/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/lib/vite/traceViewer/{uiMode.B_CpmIpF.js → uiMode.BltraIJB.js} +3 -3
- package/lib/vite/traceViewer/uiMode.html +3 -3
- package/package.json +1 -1
- package/types/protocol.d.ts +213 -98
- package/types/types.d.ts +122 -118
- package/lib/client/accessibility.js +0 -49
- package/lib/server/accessibility.js +0 -69
- package/lib/server/chromium/crAccessibility.js +0 -263
- package/lib/server/firefox/ffAccessibility.js +0 -238
- package/lib/server/webkit/wkAccessibility.js +0 -237
- package/lib/server/webkit/wsl/webkit-wsl-transport-client.js +0 -74
- package/lib/server/webkit/wsl/webkit-wsl-transport-server.js +0 -113
- package/lib/vite/recorder/assets/codeMirrorModule-RJCXzfmE.js +0 -24
- package/lib/vite/traceViewer/assets/codeMirrorModule-rbQPefq7.js +0 -24
- package/lib/vite/traceViewer/assets/defaultSettingsView-CLbol9XR.js +0 -265
- package/lib/vite/traceViewer/defaultSettingsView.TQ8_7ybu.css +0 -1
- package/lib/vite/traceViewer/index.I8N9v4jT.css +0 -1
- package/lib/vite/traceViewer/index.zIVi6mN9.js +0 -2
package/types/types.d.ts
CHANGED
|
@@ -2496,6 +2496,12 @@ export interface Page {
|
|
|
2496
2496
|
y: number;
|
|
2497
2497
|
};
|
|
2498
2498
|
|
|
2499
|
+
/**
|
|
2500
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup`
|
|
2501
|
+
* of the drag. When set to 1, emits a single `mousemove` event at the destination location.
|
|
2502
|
+
*/
|
|
2503
|
+
steps?: number;
|
|
2504
|
+
|
|
2499
2505
|
/**
|
|
2500
2506
|
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
|
|
2501
2507
|
* element, the call throws an exception.
|
|
@@ -5167,13 +5173,6 @@ export interface Page {
|
|
|
5167
5173
|
*/
|
|
5168
5174
|
workers(): Array<Worker>;
|
|
5169
5175
|
|
|
5170
|
-
/**
|
|
5171
|
-
* @deprecated This property is discouraged. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to
|
|
5172
|
-
* test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration
|
|
5173
|
-
* with Axe.
|
|
5174
|
-
*/
|
|
5175
|
-
accessibility: Accessibility;
|
|
5176
|
-
|
|
5177
5176
|
/**
|
|
5178
5177
|
* Playwright has ability to mock clock and passage of time.
|
|
5179
5178
|
*/
|
|
@@ -6407,6 +6406,12 @@ export interface Frame {
|
|
|
6407
6406
|
y: number;
|
|
6408
6407
|
};
|
|
6409
6408
|
|
|
6409
|
+
/**
|
|
6410
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup`
|
|
6411
|
+
* of the drag. When set to 1, emits a single `mousemove` event at the destination location.
|
|
6412
|
+
*/
|
|
6413
|
+
steps?: number;
|
|
6414
|
+
|
|
6410
6415
|
/**
|
|
6411
6416
|
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
|
|
6412
6417
|
* element, the call throws an exception.
|
|
@@ -8802,18 +8807,18 @@ export interface BrowserContext {
|
|
|
8802
8807
|
value: string;
|
|
8803
8808
|
|
|
8804
8809
|
/**
|
|
8805
|
-
* Either url or domain
|
|
8810
|
+
* Either `url` or both `domain` and `path` are required. Optional.
|
|
8806
8811
|
*/
|
|
8807
8812
|
url?: string;
|
|
8808
8813
|
|
|
8809
8814
|
/**
|
|
8810
|
-
* For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either
|
|
8811
|
-
* or domain
|
|
8815
|
+
* For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either
|
|
8816
|
+
* `url` or both `domain` and `path` are required. Optional.
|
|
8812
8817
|
*/
|
|
8813
8818
|
domain?: string;
|
|
8814
8819
|
|
|
8815
8820
|
/**
|
|
8816
|
-
* Either url or domain
|
|
8821
|
+
* Either `url` or both `domain` and `path` are required. Optional.
|
|
8817
8822
|
*/
|
|
8818
8823
|
path?: string;
|
|
8819
8824
|
|
|
@@ -8991,6 +8996,8 @@ export interface BrowserContext {
|
|
|
8991
8996
|
* - `'clipboard-write'`
|
|
8992
8997
|
* - `'geolocation'`
|
|
8993
8998
|
* - `'gyroscope'`
|
|
8999
|
+
* - `'local-fonts'`
|
|
9000
|
+
* - `'local-network-access'`
|
|
8994
9001
|
* - `'magnetometer'`
|
|
8995
9002
|
* - `'microphone'`
|
|
8996
9003
|
* - `'midi-sysex'` (system-exclusive midi)
|
|
@@ -8998,7 +9005,6 @@ export interface BrowserContext {
|
|
|
8998
9005
|
* - `'notifications'`
|
|
8999
9006
|
* - `'payment-handler'`
|
|
9000
9007
|
* - `'storage-access'`
|
|
9001
|
-
* - `'local-fonts'`
|
|
9002
9008
|
* @param options
|
|
9003
9009
|
*/
|
|
9004
9010
|
grantPermissions(permissions: ReadonlyArray<string>, options?: {
|
|
@@ -10324,34 +10330,76 @@ export interface Worker {
|
|
|
10324
10330
|
*/
|
|
10325
10331
|
on(event: 'close', listener: (worker: Worker) => any): this;
|
|
10326
10332
|
|
|
10333
|
+
/**
|
|
10334
|
+
* Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.
|
|
10335
|
+
*/
|
|
10336
|
+
on(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
10337
|
+
|
|
10327
10338
|
/**
|
|
10328
10339
|
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
|
|
10329
10340
|
*/
|
|
10330
10341
|
once(event: 'close', listener: (worker: Worker) => any): this;
|
|
10331
10342
|
|
|
10343
|
+
/**
|
|
10344
|
+
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
|
|
10345
|
+
*/
|
|
10346
|
+
once(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
10347
|
+
|
|
10332
10348
|
/**
|
|
10333
10349
|
* Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is
|
|
10334
10350
|
* terminated.
|
|
10335
10351
|
*/
|
|
10336
10352
|
addListener(event: 'close', listener: (worker: Worker) => any): this;
|
|
10337
10353
|
|
|
10354
|
+
/**
|
|
10355
|
+
* Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.
|
|
10356
|
+
*/
|
|
10357
|
+
addListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
10358
|
+
|
|
10338
10359
|
/**
|
|
10339
10360
|
* Removes an event listener added by `on` or `addListener`.
|
|
10340
10361
|
*/
|
|
10341
10362
|
removeListener(event: 'close', listener: (worker: Worker) => any): this;
|
|
10342
10363
|
|
|
10364
|
+
/**
|
|
10365
|
+
* Removes an event listener added by `on` or `addListener`.
|
|
10366
|
+
*/
|
|
10367
|
+
removeListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
10368
|
+
|
|
10343
10369
|
/**
|
|
10344
10370
|
* Removes an event listener added by `on` or `addListener`.
|
|
10345
10371
|
*/
|
|
10346
10372
|
off(event: 'close', listener: (worker: Worker) => any): this;
|
|
10347
10373
|
|
|
10374
|
+
/**
|
|
10375
|
+
* Removes an event listener added by `on` or `addListener`.
|
|
10376
|
+
*/
|
|
10377
|
+
off(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
10378
|
+
|
|
10348
10379
|
/**
|
|
10349
10380
|
* Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is
|
|
10350
10381
|
* terminated.
|
|
10351
10382
|
*/
|
|
10352
10383
|
prependListener(event: 'close', listener: (worker: Worker) => any): this;
|
|
10353
10384
|
|
|
10385
|
+
/**
|
|
10386
|
+
* Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.
|
|
10387
|
+
*/
|
|
10388
|
+
prependListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
10389
|
+
|
|
10354
10390
|
url(): string;
|
|
10391
|
+
|
|
10392
|
+
/**
|
|
10393
|
+
* Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is
|
|
10394
|
+
* terminated.
|
|
10395
|
+
*/
|
|
10396
|
+
waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;
|
|
10397
|
+
|
|
10398
|
+
/**
|
|
10399
|
+
* Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.
|
|
10400
|
+
*/
|
|
10401
|
+
waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;
|
|
10402
|
+
|
|
10355
10403
|
}
|
|
10356
10404
|
|
|
10357
10405
|
/**
|
|
@@ -11210,6 +11258,12 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
|
|
|
11210
11258
|
y: number;
|
|
11211
11259
|
};
|
|
11212
11260
|
|
|
11261
|
+
/**
|
|
11262
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
|
|
11263
|
+
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
|
|
11264
|
+
*/
|
|
11265
|
+
steps?: number;
|
|
11266
|
+
|
|
11213
11267
|
/**
|
|
11214
11268
|
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
|
|
11215
11269
|
* option in the config, or by using the
|
|
@@ -11293,6 +11347,12 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
|
|
|
11293
11347
|
y: number;
|
|
11294
11348
|
};
|
|
11295
11349
|
|
|
11350
|
+
/**
|
|
11351
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
|
|
11352
|
+
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
|
|
11353
|
+
*/
|
|
11354
|
+
steps?: number;
|
|
11355
|
+
|
|
11296
11356
|
/**
|
|
11297
11357
|
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
|
|
11298
11358
|
* option in the config, or by using the
|
|
@@ -12787,6 +12847,12 @@ export interface Locator {
|
|
|
12787
12847
|
y: number;
|
|
12788
12848
|
};
|
|
12789
12849
|
|
|
12850
|
+
/**
|
|
12851
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
|
|
12852
|
+
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
|
|
12853
|
+
*/
|
|
12854
|
+
steps?: number;
|
|
12855
|
+
|
|
12790
12856
|
/**
|
|
12791
12857
|
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
|
|
12792
12858
|
* option in the config, or by using the
|
|
@@ -12904,6 +12970,12 @@ export interface Locator {
|
|
|
12904
12970
|
y: number;
|
|
12905
12971
|
};
|
|
12906
12972
|
|
|
12973
|
+
/**
|
|
12974
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
|
|
12975
|
+
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
|
|
12976
|
+
*/
|
|
12977
|
+
steps?: number;
|
|
12978
|
+
|
|
12907
12979
|
/**
|
|
12908
12980
|
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
|
|
12909
12981
|
* option in the config, or by using the
|
|
@@ -12936,6 +13008,25 @@ export interface Locator {
|
|
|
12936
13008
|
*/
|
|
12937
13009
|
describe(description: string): Locator;
|
|
12938
13010
|
|
|
13011
|
+
/**
|
|
13012
|
+
* Returns locator description previously set with
|
|
13013
|
+
* [locator.describe(description)](https://playwright.dev/docs/api/class-locator#locator-describe). Returns `null` if
|
|
13014
|
+
* no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the
|
|
13015
|
+
* description when available.
|
|
13016
|
+
*
|
|
13017
|
+
* **Usage**
|
|
13018
|
+
*
|
|
13019
|
+
* ```js
|
|
13020
|
+
* const button = page.getByRole('button').describe('Subscribe button');
|
|
13021
|
+
* console.log(button.description()); // "Subscribe button"
|
|
13022
|
+
*
|
|
13023
|
+
* const input = page.getByRole('textbox');
|
|
13024
|
+
* console.log(input.description()); // null
|
|
13025
|
+
* ```
|
|
13026
|
+
*
|
|
13027
|
+
*/
|
|
13028
|
+
description(): null|string;
|
|
13029
|
+
|
|
12939
13030
|
/**
|
|
12940
13031
|
* Programmatically dispatch an event on the matching element.
|
|
12941
13032
|
*
|
|
@@ -13038,6 +13129,12 @@ export interface Locator {
|
|
|
13038
13129
|
y: number;
|
|
13039
13130
|
};
|
|
13040
13131
|
|
|
13132
|
+
/**
|
|
13133
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup`
|
|
13134
|
+
* of the drag. When set to 1, emits a single `mousemove` event at the destination location.
|
|
13135
|
+
*/
|
|
13136
|
+
steps?: number;
|
|
13137
|
+
|
|
13041
13138
|
/**
|
|
13042
13139
|
* Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
|
|
13043
13140
|
* specified, some visible point of the element is used.
|
|
@@ -15730,97 +15827,6 @@ class TimeoutError extends Error {
|
|
|
15730
15827
|
|
|
15731
15828
|
}
|
|
15732
15829
|
|
|
15733
|
-
/**
|
|
15734
|
-
* The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is
|
|
15735
|
-
* used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
|
|
15736
|
-
* [switches](https://en.wikipedia.org/wiki/Switch_access).
|
|
15737
|
-
*
|
|
15738
|
-
* Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that
|
|
15739
|
-
* might have wildly different output.
|
|
15740
|
-
*
|
|
15741
|
-
* Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated
|
|
15742
|
-
* into different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
|
|
15743
|
-
*
|
|
15744
|
-
* Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific
|
|
15745
|
-
* AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering,
|
|
15746
|
-
* exposing only the "interesting" nodes of the tree.
|
|
15747
|
-
*/
|
|
15748
|
-
export interface Accessibility {
|
|
15749
|
-
/**
|
|
15750
|
-
* Captures the current state of the accessibility tree. The returned object represents the root accessible node of
|
|
15751
|
-
* the page.
|
|
15752
|
-
*
|
|
15753
|
-
* **NOTE** The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen
|
|
15754
|
-
* readers. Playwright will discard them as well for an easier to process tree, unless
|
|
15755
|
-
* [`interestingOnly`](https://playwright.dev/docs/api/class-accessibility#accessibility-snapshot-option-interesting-only)
|
|
15756
|
-
* is set to `false`.
|
|
15757
|
-
*
|
|
15758
|
-
* **Usage**
|
|
15759
|
-
*
|
|
15760
|
-
* An example of dumping the entire accessibility tree:
|
|
15761
|
-
*
|
|
15762
|
-
* ```js
|
|
15763
|
-
* const snapshot = await page.accessibility.snapshot();
|
|
15764
|
-
* console.log(snapshot);
|
|
15765
|
-
* ```
|
|
15766
|
-
*
|
|
15767
|
-
* An example of logging the focused node's name:
|
|
15768
|
-
*
|
|
15769
|
-
* ```js
|
|
15770
|
-
* const snapshot = await page.accessibility.snapshot();
|
|
15771
|
-
* const node = findFocusedNode(snapshot);
|
|
15772
|
-
* console.log(node && node.name);
|
|
15773
|
-
*
|
|
15774
|
-
* function findFocusedNode(node) {
|
|
15775
|
-
* if (node.focused)
|
|
15776
|
-
* return node;
|
|
15777
|
-
* for (const child of node.children || []) {
|
|
15778
|
-
* const foundNode = findFocusedNode(child);
|
|
15779
|
-
* if (foundNode)
|
|
15780
|
-
* return foundNode;
|
|
15781
|
-
* }
|
|
15782
|
-
* return null;
|
|
15783
|
-
* }
|
|
15784
|
-
* ```
|
|
15785
|
-
*
|
|
15786
|
-
* @deprecated This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test
|
|
15787
|
-
* page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with
|
|
15788
|
-
* Axe.
|
|
15789
|
-
* @param options
|
|
15790
|
-
*/
|
|
15791
|
-
snapshot(options?: AccessibilitySnapshotOptions): Promise<null|AccessibilityNode>;
|
|
15792
|
-
|
|
15793
|
-
}
|
|
15794
|
-
|
|
15795
|
-
type AccessibilityNode = {
|
|
15796
|
-
role: string;
|
|
15797
|
-
name: string;
|
|
15798
|
-
value?: string|number;
|
|
15799
|
-
description?: string;
|
|
15800
|
-
keyshortcuts?: string;
|
|
15801
|
-
roledescription?: string;
|
|
15802
|
-
valuetext?: string;
|
|
15803
|
-
disabled?: boolean;
|
|
15804
|
-
expanded?: boolean;
|
|
15805
|
-
focused?: boolean;
|
|
15806
|
-
modal?: boolean;
|
|
15807
|
-
multiline?: boolean;
|
|
15808
|
-
multiselectable?: boolean;
|
|
15809
|
-
readonly?: boolean;
|
|
15810
|
-
required?: boolean;
|
|
15811
|
-
selected?: boolean;
|
|
15812
|
-
checked?: boolean|"mixed";
|
|
15813
|
-
pressed?: boolean|"mixed";
|
|
15814
|
-
level?: number;
|
|
15815
|
-
valuemin?: number;
|
|
15816
|
-
valuemax?: number;
|
|
15817
|
-
autocomplete?: string;
|
|
15818
|
-
haspopup?: string;
|
|
15819
|
-
invalid?: string;
|
|
15820
|
-
orientation?: string;
|
|
15821
|
-
children?: AccessibilityNode[];
|
|
15822
|
-
}
|
|
15823
|
-
|
|
15824
15830
|
export const devices: Devices;
|
|
15825
15831
|
|
|
15826
15832
|
//@ts-ignore this will be any if electron is not installed
|
|
@@ -16290,8 +16296,6 @@ export type AndroidKey =
|
|
|
16290
16296
|
|
|
16291
16297
|
export const _electron: Electron;
|
|
16292
16298
|
export const _android: Android;
|
|
16293
|
-
export const _bidiChromium: BrowserType;
|
|
16294
|
-
export const _bidiFirefox: BrowserType;
|
|
16295
16299
|
|
|
16296
16300
|
// This is required to not export everything by default. See https://github.com/Microsoft/TypeScript/issues/19545#issuecomment-340490459
|
|
16297
16301
|
export {};
|
|
@@ -18878,6 +18882,13 @@ export interface ConsoleMessage {
|
|
|
18878
18882
|
text(): string;
|
|
18879
18883
|
|
|
18880
18884
|
type(): "log"|"debug"|"info"|"error"|"warning"|"dir"|"dirxml"|"table"|"trace"|"clear"|"startGroup"|"startGroupCollapsed"|"endGroup"|"assert"|"profile"|"profileEnd"|"count"|"timeEnd";
|
|
18885
|
+
|
|
18886
|
+
/**
|
|
18887
|
+
* The web worker or service worker that produced this console message, if any. Note that console messages from web
|
|
18888
|
+
* workers also have non-null
|
|
18889
|
+
* [consoleMessage.page()](https://playwright.dev/docs/api/class-consolemessage#console-message-page).
|
|
18890
|
+
*/
|
|
18891
|
+
worker(): null|Worker;
|
|
18881
18892
|
}
|
|
18882
18893
|
|
|
18883
18894
|
/**
|
|
@@ -19108,6 +19119,10 @@ export interface Download {
|
|
|
19108
19119
|
|
|
19109
19120
|
/**
|
|
19110
19121
|
* Returns a readable stream for a successful download, or throws for a failed/canceled download.
|
|
19122
|
+
*
|
|
19123
|
+
* **NOTE** If you don't need a readable stream, it's usually simpler to read the file from disk after the download
|
|
19124
|
+
* completed. See [download.path()](https://playwright.dev/docs/api/class-download#download-path).
|
|
19125
|
+
*
|
|
19111
19126
|
*/
|
|
19112
19127
|
createReadStream(): Promise<Readable>;
|
|
19113
19128
|
|
|
@@ -20273,7 +20288,8 @@ export interface Mouse {
|
|
|
20273
20288
|
*/
|
|
20274
20289
|
move(x: number, y: number, options?: {
|
|
20275
20290
|
/**
|
|
20276
|
-
* Defaults to 1. Sends
|
|
20291
|
+
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
|
|
20292
|
+
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
|
|
20277
20293
|
*/
|
|
20278
20294
|
steps?: number;
|
|
20279
20295
|
}): Promise<void>;
|
|
@@ -21723,18 +21739,6 @@ export interface WebSocket {
|
|
|
21723
21739
|
|
|
21724
21740
|
}
|
|
21725
21741
|
|
|
21726
|
-
interface AccessibilitySnapshotOptions {
|
|
21727
|
-
/**
|
|
21728
|
-
* Prune uninteresting nodes from the tree. Defaults to `true`.
|
|
21729
|
-
*/
|
|
21730
|
-
interestingOnly?: boolean;
|
|
21731
|
-
|
|
21732
|
-
/**
|
|
21733
|
-
* The root DOM element for the snapshot. Defaults to the whole page.
|
|
21734
|
-
*/
|
|
21735
|
-
root?: ElementHandle;
|
|
21736
|
-
}
|
|
21737
|
-
|
|
21738
21742
|
export interface LaunchOptions {
|
|
21739
21743
|
/**
|
|
21740
21744
|
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var accessibility_exports = {};
|
|
20
|
-
__export(accessibility_exports, {
|
|
21
|
-
Accessibility: () => Accessibility
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(accessibility_exports);
|
|
24
|
-
function axNodeFromProtocol(axNode) {
|
|
25
|
-
const result = {
|
|
26
|
-
...axNode,
|
|
27
|
-
value: axNode.valueNumber !== void 0 ? axNode.valueNumber : axNode.valueString,
|
|
28
|
-
checked: axNode.checked === "checked" ? true : axNode.checked === "unchecked" ? false : axNode.checked,
|
|
29
|
-
pressed: axNode.pressed === "pressed" ? true : axNode.pressed === "released" ? false : axNode.pressed,
|
|
30
|
-
children: axNode.children ? axNode.children.map(axNodeFromProtocol) : void 0
|
|
31
|
-
};
|
|
32
|
-
delete result.valueNumber;
|
|
33
|
-
delete result.valueString;
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
class Accessibility {
|
|
37
|
-
constructor(channel) {
|
|
38
|
-
this._channel = channel;
|
|
39
|
-
}
|
|
40
|
-
async snapshot(options = {}) {
|
|
41
|
-
const root = options.root ? options.root._elementChannel : void 0;
|
|
42
|
-
const result = await this._channel.accessibilitySnapshot({ interestingOnly: options.interestingOnly, root });
|
|
43
|
-
return result.rootAXNode ? axNodeFromProtocol(result.rootAXNode) : null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
Accessibility
|
|
49
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var accessibility_exports = {};
|
|
20
|
-
__export(accessibility_exports, {
|
|
21
|
-
Accessibility: () => Accessibility
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(accessibility_exports);
|
|
24
|
-
class Accessibility {
|
|
25
|
-
constructor(getAXTree) {
|
|
26
|
-
this._getAXTree = getAXTree;
|
|
27
|
-
}
|
|
28
|
-
async snapshot(options = {}) {
|
|
29
|
-
const {
|
|
30
|
-
interestingOnly = true,
|
|
31
|
-
root = null
|
|
32
|
-
} = options;
|
|
33
|
-
const { tree, needle } = await this._getAXTree(root || void 0);
|
|
34
|
-
if (!interestingOnly) {
|
|
35
|
-
if (root)
|
|
36
|
-
return needle && serializeTree(needle)[0];
|
|
37
|
-
return serializeTree(tree)[0];
|
|
38
|
-
}
|
|
39
|
-
const interestingNodes = /* @__PURE__ */ new Set();
|
|
40
|
-
collectInterestingNodes(interestingNodes, tree, false);
|
|
41
|
-
if (root && (!needle || !interestingNodes.has(needle)))
|
|
42
|
-
return null;
|
|
43
|
-
return serializeTree(needle || tree, interestingNodes)[0];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function collectInterestingNodes(collection, node, insideControl) {
|
|
47
|
-
if (node.isInteresting(insideControl))
|
|
48
|
-
collection.add(node);
|
|
49
|
-
if (node.isLeafNode())
|
|
50
|
-
return;
|
|
51
|
-
insideControl = insideControl || node.isControl();
|
|
52
|
-
for (const child of node.children())
|
|
53
|
-
collectInterestingNodes(collection, child, insideControl);
|
|
54
|
-
}
|
|
55
|
-
function serializeTree(node, whitelistedNodes) {
|
|
56
|
-
const children = [];
|
|
57
|
-
for (const child of node.children())
|
|
58
|
-
children.push(...serializeTree(child, whitelistedNodes));
|
|
59
|
-
if (whitelistedNodes && !whitelistedNodes.has(node))
|
|
60
|
-
return children;
|
|
61
|
-
const serializedNode = node.serialize();
|
|
62
|
-
if (children.length)
|
|
63
|
-
serializedNode.children = children;
|
|
64
|
-
return [serializedNode];
|
|
65
|
-
}
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
Accessibility
|
|
69
|
-
});
|