venetian 0.1.3-aarch64-linux → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +70 -1
- data/exe/aarch64-linux/node +0 -0
- data/exe/aarch64-linux/package/api.json +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_beta_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_chrome_stable_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_beta_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_dev_mac.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_linux.sh +1 -1
- data/exe/aarch64-linux/package/bin/reinstall_msedge_stable_mac.sh +1 -1
- data/exe/aarch64-linux/package/browsers.json +14 -14
- data/exe/aarch64-linux/package/index.js +1 -16
- data/exe/aarch64-linux/package/lib/bootstrap.js +11 -0
- data/exe/aarch64-linux/package/lib/coreBundle.js +26319 -22732
- data/exe/aarch64-linux/package/lib/server/deviceDescriptorsSource.json +1142 -182
- data/exe/aarch64-linux/package/lib/serverRegistry.js +1 -1
- data/exe/aarch64-linux/package/lib/tools/cli-client/help.json +17 -3
- data/exe/aarch64-linux/package/lib/tools/cli-client/output.js +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/program.js +29 -5
- data/exe/aarch64-linux/package/lib/tools/cli-client/registry.js +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/session.js +6 -17
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/SKILL.md +16 -0
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/spec-driven-testing.md +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/storage-state.md +2 -2
- data/exe/aarch64-linux/package/lib/tools/cli-client/skill/references/video-recording.md +1 -1
- data/exe/aarch64-linux/package/lib/utilsBundle.js +2825 -1507
- data/exe/aarch64-linux/package/lib/utilsBundle.js.LICENSE +61 -7
- data/exe/aarch64-linux/package/lib/vite/dashboard/assets/{index-DpEq2p62.js → index-C_5TMfeg.js} +1 -1
- data/exe/aarch64-linux/package/lib/vite/dashboard/index.html +1 -1
- data/exe/aarch64-linux/package/lib/vite/htmlReport/report.js +3 -3
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/{codeMirrorModule-BHYmBp6h.js → codeMirrorModule-DeBYQozu.js} +1 -1
- data/exe/aarch64-linux/package/lib/vite/recorder/assets/{index-DA10QRaq.js → index-Bq-mQf8S.js} +91 -91
- data/exe/aarch64-linux/package/lib/vite/recorder/index.html +1 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/{codeMirrorModule-Ds_H_9Yq.js → codeMirrorModule-LEHpjmcn.js} +1 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-BNmKHKpQ.js +264 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/{defaultSettingsView.BDKsFU3c.css → defaultSettingsView.CjdS-WJx.css} +1 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.DMMX1gXU.js +2 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.html +3 -3
- data/exe/aarch64-linux/package/lib/vite/traceViewer/sw.bundle.js +2 -2
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.BZQ54Kgt.css +1 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Ut8wwJNp.js +6 -0
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.html +4 -4
- data/exe/aarch64-linux/package/package.json +1 -1
- data/exe/aarch64-linux/package/protocol.yml +153 -46
- data/exe/aarch64-linux/package/types/protocol.d.ts +95 -31
- data/exe/aarch64-linux/package/types/types.d.ts +478 -551
- data/lib/venetian/browser_installer.rb +20 -1
- data/lib/venetian/executable.rb +28 -11
- data/lib/venetian/railtie.rb +7 -0
- data/lib/venetian/system_test_case_extension.rb +43 -0
- data/lib/venetian/version.rb +2 -2
- data/lib/venetian.rb +4 -3
- metadata +14 -13
- data/exe/aarch64-linux/package/lib/vite/traceViewer/assets/defaultSettingsView-D31xz8zv.js +0 -262
- data/exe/aarch64-linux/package/lib/vite/traceViewer/index.BCnMPevh.js +0 -2
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.Btcz36p_.css +0 -1
- data/exe/aarch64-linux/package/lib/vite/traceViewer/uiMode.C2Efnu2P.js +0 -6
|
@@ -121,7 +121,7 @@ export interface Page {
|
|
|
121
121
|
* [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate):
|
|
122
122
|
*
|
|
123
123
|
* ```js
|
|
124
|
-
* const bodyHandle = await page.
|
|
124
|
+
* const bodyHandle = await page.evaluateHandle('document.body');
|
|
125
125
|
* const html = await page.evaluate<string, HTMLElement>(([body, suffix]) =>
|
|
126
126
|
* body.innerHTML + suffix, [bodyHandle, 'hello']
|
|
127
127
|
* );
|
|
@@ -172,7 +172,7 @@ export interface Page {
|
|
|
172
172
|
* [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate):
|
|
173
173
|
*
|
|
174
174
|
* ```js
|
|
175
|
-
* const bodyHandle = await page.
|
|
175
|
+
* const bodyHandle = await page.evaluateHandle('document.body');
|
|
176
176
|
* const html = await page.evaluate<string, HTMLElement>(([body, suffix]) =>
|
|
177
177
|
* body.innerHTML + suffix, [bodyHandle, 'hello']
|
|
178
178
|
* );
|
|
@@ -4530,8 +4530,8 @@ export interface Page {
|
|
|
4530
4530
|
* [`timeout`](https://playwright.dev/docs/api/class-page#page-tap-option-timeout), this method throws a
|
|
4531
4531
|
* [TimeoutError](https://playwright.dev/docs/api/class-timeouterror). Passing zero timeout disables this.
|
|
4532
4532
|
*
|
|
4533
|
-
* **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap)
|
|
4534
|
-
*
|
|
4533
|
+
* **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) will throw if the
|
|
4534
|
+
* [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the
|
|
4535
4535
|
* browser context is false.
|
|
4536
4536
|
*
|
|
4537
4537
|
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be
|
|
@@ -5244,6 +5244,18 @@ export interface Page {
|
|
|
5244
5244
|
|
|
5245
5245
|
keyboard: Keyboard;
|
|
5246
5246
|
|
|
5247
|
+
/**
|
|
5248
|
+
* Provides access to the page's `localStorage` for the current origin. See
|
|
5249
|
+
* [WebStorage](https://playwright.dev/docs/api/class-webstorage).
|
|
5250
|
+
*
|
|
5251
|
+
* ```js
|
|
5252
|
+
* await page.localStorage.setItem('token', 'abc');
|
|
5253
|
+
* const token = await page.localStorage.getItem('token');
|
|
5254
|
+
* ```
|
|
5255
|
+
*
|
|
5256
|
+
*/
|
|
5257
|
+
localStorage: WebStorage;
|
|
5258
|
+
|
|
5247
5259
|
mouse: Mouse;
|
|
5248
5260
|
|
|
5249
5261
|
/**
|
|
@@ -5272,6 +5284,18 @@ export interface Page {
|
|
|
5272
5284
|
*/
|
|
5273
5285
|
screencast: Screencast;
|
|
5274
5286
|
|
|
5287
|
+
/**
|
|
5288
|
+
* Provides access to the page's `sessionStorage` for the current origin. See
|
|
5289
|
+
* [WebStorage](https://playwright.dev/docs/api/class-webstorage).
|
|
5290
|
+
*
|
|
5291
|
+
* ```js
|
|
5292
|
+
* await page.sessionStorage.setItem('flag', '1');
|
|
5293
|
+
* const flag = await page.sessionStorage.getItem('flag');
|
|
5294
|
+
* ```
|
|
5295
|
+
*
|
|
5296
|
+
*/
|
|
5297
|
+
sessionStorage: WebStorage;
|
|
5298
|
+
|
|
5275
5299
|
touchscreen: Touchscreen;
|
|
5276
5300
|
|
|
5277
5301
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -5348,7 +5372,7 @@ export interface Frame {
|
|
|
5348
5372
|
* [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate):
|
|
5349
5373
|
*
|
|
5350
5374
|
* ```js
|
|
5351
|
-
* const bodyHandle = await frame.
|
|
5375
|
+
* const bodyHandle = await frame.evaluateHandle('document.body');
|
|
5352
5376
|
* const html = await frame.evaluate(([body, suffix]) =>
|
|
5353
5377
|
* body.innerHTML + suffix, [bodyHandle, 'hello'],
|
|
5354
5378
|
* );
|
|
@@ -5395,7 +5419,7 @@ export interface Frame {
|
|
|
5395
5419
|
* [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate):
|
|
5396
5420
|
*
|
|
5397
5421
|
* ```js
|
|
5398
|
-
* const bodyHandle = await frame.
|
|
5422
|
+
* const bodyHandle = await frame.evaluateHandle('document.body');
|
|
5399
5423
|
* const html = await frame.evaluate(([body, suffix]) =>
|
|
5400
5424
|
* body.innerHTML + suffix, [bodyHandle, 'hello'],
|
|
5401
5425
|
* );
|
|
@@ -9883,6 +9907,12 @@ export interface BrowserContext {
|
|
|
9883
9907
|
*/
|
|
9884
9908
|
clock: Clock;
|
|
9885
9909
|
|
|
9910
|
+
/**
|
|
9911
|
+
* Virtual WebAuthn authenticator for this context. Lets tests seed credentials and intercept
|
|
9912
|
+
* `navigator.credentials.create()` / `navigator.credentials.get()` ceremonies.
|
|
9913
|
+
*/
|
|
9914
|
+
credentials: Credentials;
|
|
9915
|
+
|
|
9886
9916
|
/**
|
|
9887
9917
|
* Debugger allows to pause and resume the execution.
|
|
9888
9918
|
*/
|
|
@@ -15334,6 +15364,32 @@ export interface BrowserType<Unused = {}> {
|
|
|
15334
15364
|
* @param options
|
|
15335
15365
|
*/
|
|
15336
15366
|
connectOverCDP(endpointURL: string, options?: ConnectOverCDPOptions): Promise<Browser>;
|
|
15367
|
+
/**
|
|
15368
|
+
* This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol.
|
|
15369
|
+
*
|
|
15370
|
+
* The default browser context is accessible via
|
|
15371
|
+
* [browser.contexts()](https://playwright.dev/docs/api/class-browser#browser-contexts).
|
|
15372
|
+
*
|
|
15373
|
+
* **NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
|
|
15374
|
+
*
|
|
15375
|
+
* **NOTE** This connection is significantly lower fidelity than the Playwright protocol connection via
|
|
15376
|
+
* [browserType.connect(endpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
|
|
15377
|
+
* If you are experiencing issues or attempting to use advanced functionality, you probably want to use
|
|
15378
|
+
* [browserType.connect(endpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
|
|
15379
|
+
*
|
|
15380
|
+
* **Usage**
|
|
15381
|
+
*
|
|
15382
|
+
* ```js
|
|
15383
|
+
* const browser = await playwright.chromium.connectOverCDP('http://localhost:9222');
|
|
15384
|
+
* const defaultContext = browser.contexts()[0];
|
|
15385
|
+
* const page = defaultContext.pages()[0];
|
|
15386
|
+
* ```
|
|
15387
|
+
*
|
|
15388
|
+
* @param endpointURL A CDP websocket endpoint or http url to connect to. For example `http://localhost:9222/` or
|
|
15389
|
+
* `ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4`.
|
|
15390
|
+
* @param options
|
|
15391
|
+
*/
|
|
15392
|
+
connectOverCDP(transport: ConnectOverCDPTransport, options?: ConnectOverCDPOptions): Promise<Browser>;
|
|
15337
15393
|
/**
|
|
15338
15394
|
* Option `wsEndpoint` is deprecated. Instead use `endpointURL`.
|
|
15339
15395
|
* @deprecated
|
|
@@ -15364,6 +15420,7 @@ export interface BrowserType<Unused = {}> {
|
|
|
15364
15420
|
* @param options
|
|
15365
15421
|
*/
|
|
15366
15422
|
connectOverCDP(options: ConnectOverCDPOptions & { wsEndpoint?: string }): Promise<Browser>;
|
|
15423
|
+
|
|
15367
15424
|
/**
|
|
15368
15425
|
* This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
|
|
15369
15426
|
*
|
|
@@ -16144,6 +16201,14 @@ export interface BrowserType<Unused = {}> {
|
|
|
16144
16201
|
name(): string;
|
|
16145
16202
|
}
|
|
16146
16203
|
|
|
16204
|
+
export interface ConnectOverCDPTransport {
|
|
16205
|
+
open?(): void;
|
|
16206
|
+
send(message: object): void;
|
|
16207
|
+
close(): void;
|
|
16208
|
+
onmessage?: (message: object) => void;
|
|
16209
|
+
onclose?: (reason?: string) => void;
|
|
16210
|
+
}
|
|
16211
|
+
|
|
16147
16212
|
/**
|
|
16148
16213
|
* The `CDPSession` instances are used to talk raw Chrome Devtools Protocol:
|
|
16149
16214
|
* - protocol methods can be called with `session.send` method.
|
|
@@ -16557,8 +16622,8 @@ export interface Screencast {
|
|
|
16557
16622
|
* ```js
|
|
16558
16623
|
* // Capture frames
|
|
16559
16624
|
* await page.screencast.start({
|
|
16560
|
-
* onFrame: ({ data, viewportWidth, viewportHeight }) => {
|
|
16561
|
-
* console.log(`frame size: ${data.length} (${viewportWidth}x${viewportHeight})`);
|
|
16625
|
+
* onFrame: ({ data, timestamp, viewportWidth, viewportHeight }) => {
|
|
16626
|
+
* console.log(`frame size: ${data.length} (${viewportWidth}x${viewportHeight}) at ${timestamp}`);
|
|
16562
16627
|
* },
|
|
16563
16628
|
* size: { width: 800, height: 600 },
|
|
16564
16629
|
* });
|
|
@@ -16569,7 +16634,7 @@ export interface Screencast {
|
|
|
16569
16634
|
* @param options
|
|
16570
16635
|
*/
|
|
16571
16636
|
start(options?: {
|
|
16572
|
-
onFrame?: (frame: { data: Buffer, viewportWidth: number, viewportHeight: number }) => Promise<any>|any;
|
|
16637
|
+
onFrame?: (frame: { data: Buffer, timestamp: number, viewportWidth: number, viewportHeight: number }) => Promise<any>|any;
|
|
16573
16638
|
path?: string;
|
|
16574
16639
|
size?: {
|
|
16575
16640
|
width: number;
|
|
@@ -16597,6 +16662,12 @@ export interface Screencast {
|
|
|
16597
16662
|
* @param options
|
|
16598
16663
|
*/
|
|
16599
16664
|
showActions(options?: {
|
|
16665
|
+
/**
|
|
16666
|
+
* Cursor decoration shown for pointer actions. `"pointer"` (the default) renders a mouse pointer that animates from
|
|
16667
|
+
* the previous action point to the next one. `"none"` disables the cursor decoration.
|
|
16668
|
+
*/
|
|
16669
|
+
cursor?: "none"|"pointer";
|
|
16670
|
+
|
|
16600
16671
|
/**
|
|
16601
16672
|
* How long each annotation is displayed in milliseconds. Defaults to `500`.
|
|
16602
16673
|
*/
|
|
@@ -16742,26 +16813,6 @@ type ElectronType = typeof import('electron');
|
|
|
16742
16813
|
*
|
|
16743
16814
|
*/
|
|
16744
16815
|
export interface ElectronApplication {
|
|
16745
|
-
/**
|
|
16746
|
-
* Returns the return value of
|
|
16747
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
16748
|
-
*
|
|
16749
|
-
* If the function passed to the
|
|
16750
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16751
|
-
* returns a [Promise], then
|
|
16752
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16753
|
-
* would wait for the promise to resolve and return its value.
|
|
16754
|
-
*
|
|
16755
|
-
* If the function passed to the
|
|
16756
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16757
|
-
* returns a non-[Serializable] value, then
|
|
16758
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16759
|
-
* returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
|
|
16760
|
-
* `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
|
16761
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
16762
|
-
* @param arg Optional argument to pass to
|
|
16763
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
16764
|
-
*/
|
|
16765
16816
|
/**
|
|
16766
16817
|
* Returns the return value of
|
|
16767
16818
|
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
@@ -16783,26 +16834,6 @@ export interface ElectronApplication {
|
|
|
16783
16834
|
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
16784
16835
|
*/
|
|
16785
16836
|
evaluate<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<R>;
|
|
16786
|
-
/**
|
|
16787
|
-
* Returns the return value of
|
|
16788
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
16789
|
-
*
|
|
16790
|
-
* If the function passed to the
|
|
16791
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16792
|
-
* returns a [Promise], then
|
|
16793
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16794
|
-
* would wait for the promise to resolve and return its value.
|
|
16795
|
-
*
|
|
16796
|
-
* If the function passed to the
|
|
16797
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16798
|
-
* returns a non-[Serializable] value, then
|
|
16799
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16800
|
-
* returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
|
|
16801
|
-
* `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
|
16802
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
16803
|
-
* @param arg Optional argument to pass to
|
|
16804
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
16805
|
-
*/
|
|
16806
16837
|
/**
|
|
16807
16838
|
* Returns the return value of
|
|
16808
16839
|
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
@@ -16825,28 +16856,6 @@ export interface ElectronApplication {
|
|
|
16825
16856
|
*/
|
|
16826
16857
|
evaluate<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<R>;
|
|
16827
16858
|
|
|
16828
|
-
/**
|
|
16829
|
-
* Returns the return value of
|
|
16830
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
16831
|
-
* as a [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
16832
|
-
*
|
|
16833
|
-
* The only difference between
|
|
16834
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16835
|
-
* and
|
|
16836
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16837
|
-
* is that
|
|
16838
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16839
|
-
* returns [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
16840
|
-
*
|
|
16841
|
-
* If the function passed to the
|
|
16842
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16843
|
-
* returns a [Promise], then
|
|
16844
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16845
|
-
* would wait for the promise to resolve and return its value.
|
|
16846
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
16847
|
-
* @param arg Optional argument to pass to
|
|
16848
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
16849
|
-
*/
|
|
16850
16859
|
/**
|
|
16851
16860
|
* Returns the return value of
|
|
16852
16861
|
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
@@ -16870,28 +16879,6 @@ export interface ElectronApplication {
|
|
|
16870
16879
|
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
16871
16880
|
*/
|
|
16872
16881
|
evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
|
|
16873
|
-
/**
|
|
16874
|
-
* Returns the return value of
|
|
16875
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
16876
|
-
* as a [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
16877
|
-
*
|
|
16878
|
-
* The only difference between
|
|
16879
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
16880
|
-
* and
|
|
16881
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16882
|
-
* is that
|
|
16883
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16884
|
-
* returns [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
16885
|
-
*
|
|
16886
|
-
* If the function passed to the
|
|
16887
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16888
|
-
* returns a [Promise], then
|
|
16889
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
16890
|
-
* would wait for the promise to resolve and return its value.
|
|
16891
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
16892
|
-
* @param arg Optional argument to pass to
|
|
16893
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
16894
|
-
*/
|
|
16895
16882
|
/**
|
|
16896
16883
|
* Returns the return value of
|
|
16897
16884
|
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
@@ -17254,465 +17241,21 @@ export type AndroidKey =
|
|
|
17254
17241
|
export const _electron: Electron;
|
|
17255
17242
|
export const _android: Android;
|
|
17256
17243
|
|
|
17257
|
-
|
|
17258
|
-
|
|
17244
|
+
// This is required to not export everything by default. See https://github.com/Microsoft/TypeScript/issues/19545#issuecomment-340490459
|
|
17245
|
+
export {};
|
|
17246
|
+
|
|
17259
17247
|
|
|
17260
17248
|
/**
|
|
17261
|
-
*
|
|
17262
|
-
* [
|
|
17263
|
-
*
|
|
17264
|
-
*
|
|
17265
|
-
*
|
|
17266
|
-
* const { _electron: electron } = require('playwright');
|
|
17267
|
-
*
|
|
17268
|
-
* (async () => {
|
|
17269
|
-
* // Launch Electron app.
|
|
17270
|
-
* const electronApp = await electron.launch({ args: ['main.js'] });
|
|
17271
|
-
*
|
|
17272
|
-
* // Evaluation expression in the Electron context.
|
|
17273
|
-
* const appPath = await electronApp.evaluate(async ({ app }) => {
|
|
17274
|
-
* // This runs in the main Electron process, parameter here is always
|
|
17275
|
-
* // the result of the require('electron') in the main app script.
|
|
17276
|
-
* return app.getAppPath();
|
|
17277
|
-
* });
|
|
17278
|
-
* console.log(appPath);
|
|
17279
|
-
*
|
|
17280
|
-
* // Get the first window that the app opens, wait if necessary.
|
|
17281
|
-
* const window = await electronApp.firstWindow();
|
|
17282
|
-
* // Print the title.
|
|
17283
|
-
* console.log(await window.title());
|
|
17284
|
-
* // Capture a screenshot.
|
|
17285
|
-
* await window.screenshot({ path: 'intro.png' });
|
|
17286
|
-
* // Direct Electron console to Node terminal.
|
|
17287
|
-
* window.on('console', console.log);
|
|
17288
|
-
* // Click button.
|
|
17289
|
-
* await window.click('text=Click me');
|
|
17290
|
-
* // Exit app.
|
|
17291
|
-
* await electronApp.close();
|
|
17292
|
-
* })();
|
|
17293
|
-
* ```
|
|
17294
|
-
*
|
|
17249
|
+
* Exposes API that can be used for the Web API testing. This class is used for creating
|
|
17250
|
+
* [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) instance which in turn can be used for
|
|
17251
|
+
* sending web requests. An instance of this class can be obtained via
|
|
17252
|
+
* [playwright.request](https://playwright.dev/docs/api/class-playwright#playwright-request). For more information see
|
|
17253
|
+
* [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext).
|
|
17295
17254
|
*/
|
|
17296
|
-
export interface
|
|
17297
|
-
/**
|
|
17298
|
-
* Returns the return value of
|
|
17299
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17300
|
-
*
|
|
17301
|
-
* If the function passed to the
|
|
17302
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17303
|
-
* returns a [Promise], then
|
|
17304
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17305
|
-
* would wait for the promise to resolve and return its value.
|
|
17306
|
-
*
|
|
17307
|
-
* If the function passed to the
|
|
17308
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17309
|
-
* returns a non-[Serializable] value, then
|
|
17310
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17311
|
-
* returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
|
|
17312
|
-
* `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
|
17313
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17314
|
-
* @param arg Optional argument to pass to
|
|
17315
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17316
|
-
*/
|
|
17317
|
-
/**
|
|
17318
|
-
* Returns the return value of
|
|
17319
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17320
|
-
*
|
|
17321
|
-
* If the function passed to the
|
|
17322
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17323
|
-
* returns a [Promise], then
|
|
17324
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17325
|
-
* would wait for the promise to resolve and return its value.
|
|
17326
|
-
*
|
|
17327
|
-
* If the function passed to the
|
|
17328
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17329
|
-
* returns a non-[Serializable] value, then
|
|
17330
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17331
|
-
* returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
|
|
17332
|
-
* `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
|
17333
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17334
|
-
* @param arg Optional argument to pass to
|
|
17335
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17336
|
-
*/
|
|
17337
|
-
evaluate<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<R>;
|
|
17255
|
+
export interface APIRequest {
|
|
17338
17256
|
/**
|
|
17339
|
-
*
|
|
17340
|
-
*
|
|
17341
|
-
*
|
|
17342
|
-
* If the function passed to the
|
|
17343
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17344
|
-
* returns a [Promise], then
|
|
17345
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17346
|
-
* would wait for the promise to resolve and return its value.
|
|
17347
|
-
*
|
|
17348
|
-
* If the function passed to the
|
|
17349
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17350
|
-
* returns a non-[Serializable] value, then
|
|
17351
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17352
|
-
* returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
|
|
17353
|
-
* `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
|
17354
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17355
|
-
* @param arg Optional argument to pass to
|
|
17356
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17357
|
-
*/
|
|
17358
|
-
/**
|
|
17359
|
-
* Returns the return value of
|
|
17360
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17361
|
-
*
|
|
17362
|
-
* If the function passed to the
|
|
17363
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17364
|
-
* returns a [Promise], then
|
|
17365
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17366
|
-
* would wait for the promise to resolve and return its value.
|
|
17367
|
-
*
|
|
17368
|
-
* If the function passed to the
|
|
17369
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17370
|
-
* returns a non-[Serializable] value, then
|
|
17371
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17372
|
-
* returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
|
|
17373
|
-
* `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
|
|
17374
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17375
|
-
* @param arg Optional argument to pass to
|
|
17376
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-option-expression).
|
|
17377
|
-
*/
|
|
17378
|
-
evaluate<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<R>;
|
|
17379
|
-
|
|
17380
|
-
/**
|
|
17381
|
-
* Returns the return value of
|
|
17382
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
17383
|
-
* as a [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17384
|
-
*
|
|
17385
|
-
* The only difference between
|
|
17386
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17387
|
-
* and
|
|
17388
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17389
|
-
* is that
|
|
17390
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17391
|
-
* returns [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17392
|
-
*
|
|
17393
|
-
* If the function passed to the
|
|
17394
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17395
|
-
* returns a [Promise], then
|
|
17396
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17397
|
-
* would wait for the promise to resolve and return its value.
|
|
17398
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17399
|
-
* @param arg Optional argument to pass to
|
|
17400
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
17401
|
-
*/
|
|
17402
|
-
/**
|
|
17403
|
-
* Returns the return value of
|
|
17404
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
17405
|
-
* as a [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17406
|
-
*
|
|
17407
|
-
* The only difference between
|
|
17408
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17409
|
-
* and
|
|
17410
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17411
|
-
* is that
|
|
17412
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17413
|
-
* returns [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17414
|
-
*
|
|
17415
|
-
* If the function passed to the
|
|
17416
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17417
|
-
* returns a [Promise], then
|
|
17418
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17419
|
-
* would wait for the promise to resolve and return its value.
|
|
17420
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17421
|
-
* @param arg Optional argument to pass to
|
|
17422
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
17423
|
-
*/
|
|
17424
|
-
evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
|
|
17425
|
-
/**
|
|
17426
|
-
* Returns the return value of
|
|
17427
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
17428
|
-
* as a [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17429
|
-
*
|
|
17430
|
-
* The only difference between
|
|
17431
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17432
|
-
* and
|
|
17433
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17434
|
-
* is that
|
|
17435
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17436
|
-
* returns [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17437
|
-
*
|
|
17438
|
-
* If the function passed to the
|
|
17439
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17440
|
-
* returns a [Promise], then
|
|
17441
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17442
|
-
* would wait for the promise to resolve and return its value.
|
|
17443
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17444
|
-
* @param arg Optional argument to pass to
|
|
17445
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
17446
|
-
*/
|
|
17447
|
-
/**
|
|
17448
|
-
* Returns the return value of
|
|
17449
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression)
|
|
17450
|
-
* as a [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17451
|
-
*
|
|
17452
|
-
* The only difference between
|
|
17453
|
-
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
17454
|
-
* and
|
|
17455
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17456
|
-
* is that
|
|
17457
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17458
|
-
* returns [JSHandle](https://playwright.dev/docs/api/class-jshandle).
|
|
17459
|
-
*
|
|
17460
|
-
* If the function passed to the
|
|
17461
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17462
|
-
* returns a [Promise], then
|
|
17463
|
-
* [electronApplication.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle)
|
|
17464
|
-
* would wait for the promise to resolve and return its value.
|
|
17465
|
-
* @param pageFunction Function to be evaluated in the main Electron process.
|
|
17466
|
-
* @param arg Optional argument to pass to
|
|
17467
|
-
* [`pageFunction`](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate-handle-option-expression).
|
|
17468
|
-
*/
|
|
17469
|
-
evaluateHandle<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<SmartHandle<R>>;
|
|
17470
|
-
/**
|
|
17471
|
-
* This event is issued when the application process has been terminated.
|
|
17472
|
-
*/
|
|
17473
|
-
on(event: 'close', listener: () => any): this;
|
|
17474
|
-
|
|
17475
|
-
/**
|
|
17476
|
-
* Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
|
|
17477
|
-
* `console.dir`.
|
|
17478
|
-
*
|
|
17479
|
-
* The arguments passed into `console.log` are available on the
|
|
17480
|
-
* [ConsoleMessage](https://playwright.dev/docs/api/class-consolemessage) event handler argument.
|
|
17481
|
-
*
|
|
17482
|
-
* **Usage**
|
|
17483
|
-
*
|
|
17484
|
-
* ```js
|
|
17485
|
-
* electronApp.on('console', async msg => {
|
|
17486
|
-
* const values = [];
|
|
17487
|
-
* for (const arg of msg.args())
|
|
17488
|
-
* values.push(await arg.jsonValue());
|
|
17489
|
-
* console.log(...values);
|
|
17490
|
-
* });
|
|
17491
|
-
* await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
|
|
17492
|
-
* ```
|
|
17493
|
-
*
|
|
17494
|
-
*/
|
|
17495
|
-
on(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
17496
|
-
|
|
17497
|
-
/**
|
|
17498
|
-
* This event is issued for every window that is created **and loaded** in Electron. It contains a
|
|
17499
|
-
* [Page](https://playwright.dev/docs/api/class-page) that can be used for Playwright automation.
|
|
17500
|
-
*/
|
|
17501
|
-
on(event: 'window', listener: (page: Page) => any): this;
|
|
17502
|
-
|
|
17503
|
-
/**
|
|
17504
|
-
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
|
|
17505
|
-
*/
|
|
17506
|
-
once(event: 'close', listener: () => any): this;
|
|
17507
|
-
|
|
17508
|
-
/**
|
|
17509
|
-
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
|
|
17510
|
-
*/
|
|
17511
|
-
once(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
17512
|
-
|
|
17513
|
-
/**
|
|
17514
|
-
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
|
|
17515
|
-
*/
|
|
17516
|
-
once(event: 'window', listener: (page: Page) => any): this;
|
|
17517
|
-
|
|
17518
|
-
/**
|
|
17519
|
-
* This event is issued when the application process has been terminated.
|
|
17520
|
-
*/
|
|
17521
|
-
addListener(event: 'close', listener: () => any): this;
|
|
17522
|
-
|
|
17523
|
-
/**
|
|
17524
|
-
* Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
|
|
17525
|
-
* `console.dir`.
|
|
17526
|
-
*
|
|
17527
|
-
* The arguments passed into `console.log` are available on the
|
|
17528
|
-
* [ConsoleMessage](https://playwright.dev/docs/api/class-consolemessage) event handler argument.
|
|
17529
|
-
*
|
|
17530
|
-
* **Usage**
|
|
17531
|
-
*
|
|
17532
|
-
* ```js
|
|
17533
|
-
* electronApp.on('console', async msg => {
|
|
17534
|
-
* const values = [];
|
|
17535
|
-
* for (const arg of msg.args())
|
|
17536
|
-
* values.push(await arg.jsonValue());
|
|
17537
|
-
* console.log(...values);
|
|
17538
|
-
* });
|
|
17539
|
-
* await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
|
|
17540
|
-
* ```
|
|
17541
|
-
*
|
|
17542
|
-
*/
|
|
17543
|
-
addListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
17544
|
-
|
|
17545
|
-
/**
|
|
17546
|
-
* This event is issued for every window that is created **and loaded** in Electron. It contains a
|
|
17547
|
-
* [Page](https://playwright.dev/docs/api/class-page) that can be used for Playwright automation.
|
|
17548
|
-
*/
|
|
17549
|
-
addListener(event: 'window', listener: (page: Page) => any): this;
|
|
17550
|
-
|
|
17551
|
-
/**
|
|
17552
|
-
* Removes an event listener added by `on` or `addListener`.
|
|
17553
|
-
*/
|
|
17554
|
-
removeListener(event: 'close', listener: () => any): this;
|
|
17555
|
-
|
|
17556
|
-
/**
|
|
17557
|
-
* Removes an event listener added by `on` or `addListener`.
|
|
17558
|
-
*/
|
|
17559
|
-
removeListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
17560
|
-
|
|
17561
|
-
/**
|
|
17562
|
-
* Removes an event listener added by `on` or `addListener`.
|
|
17563
|
-
*/
|
|
17564
|
-
removeListener(event: 'window', listener: (page: Page) => any): this;
|
|
17565
|
-
|
|
17566
|
-
/**
|
|
17567
|
-
* Removes an event listener added by `on` or `addListener`.
|
|
17568
|
-
*/
|
|
17569
|
-
off(event: 'close', listener: () => any): this;
|
|
17570
|
-
|
|
17571
|
-
/**
|
|
17572
|
-
* Removes an event listener added by `on` or `addListener`.
|
|
17573
|
-
*/
|
|
17574
|
-
off(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
17575
|
-
|
|
17576
|
-
/**
|
|
17577
|
-
* Removes an event listener added by `on` or `addListener`.
|
|
17578
|
-
*/
|
|
17579
|
-
off(event: 'window', listener: (page: Page) => any): this;
|
|
17580
|
-
|
|
17581
|
-
/**
|
|
17582
|
-
* This event is issued when the application process has been terminated.
|
|
17583
|
-
*/
|
|
17584
|
-
prependListener(event: 'close', listener: () => any): this;
|
|
17585
|
-
|
|
17586
|
-
/**
|
|
17587
|
-
* Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
|
|
17588
|
-
* `console.dir`.
|
|
17589
|
-
*
|
|
17590
|
-
* The arguments passed into `console.log` are available on the
|
|
17591
|
-
* [ConsoleMessage](https://playwright.dev/docs/api/class-consolemessage) event handler argument.
|
|
17592
|
-
*
|
|
17593
|
-
* **Usage**
|
|
17594
|
-
*
|
|
17595
|
-
* ```js
|
|
17596
|
-
* electronApp.on('console', async msg => {
|
|
17597
|
-
* const values = [];
|
|
17598
|
-
* for (const arg of msg.args())
|
|
17599
|
-
* values.push(await arg.jsonValue());
|
|
17600
|
-
* console.log(...values);
|
|
17601
|
-
* });
|
|
17602
|
-
* await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
|
|
17603
|
-
* ```
|
|
17604
|
-
*
|
|
17605
|
-
*/
|
|
17606
|
-
prependListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this;
|
|
17607
|
-
|
|
17608
|
-
/**
|
|
17609
|
-
* This event is issued for every window that is created **and loaded** in Electron. It contains a
|
|
17610
|
-
* [Page](https://playwright.dev/docs/api/class-page) that can be used for Playwright automation.
|
|
17611
|
-
*/
|
|
17612
|
-
prependListener(event: 'window', listener: (page: Page) => any): this;
|
|
17613
|
-
|
|
17614
|
-
/**
|
|
17615
|
-
* Returns the BrowserWindow object that corresponds to the given Playwright page.
|
|
17616
|
-
* @param page Page to retrieve the window for.
|
|
17617
|
-
*/
|
|
17618
|
-
browserWindow(page: Page): Promise<JSHandle>;
|
|
17619
|
-
|
|
17620
|
-
/**
|
|
17621
|
-
* Closes Electron application.
|
|
17622
|
-
*/
|
|
17623
|
-
close(): Promise<void>;
|
|
17624
|
-
|
|
17625
|
-
/**
|
|
17626
|
-
* This method returns browser context that can be used for setting up context-wide routing, etc.
|
|
17627
|
-
*/
|
|
17628
|
-
context(): BrowserContext;
|
|
17629
|
-
|
|
17630
|
-
/**
|
|
17631
|
-
* Convenience method that waits for the first application window to be opened.
|
|
17632
|
-
*
|
|
17633
|
-
* **Usage**
|
|
17634
|
-
*
|
|
17635
|
-
* ```js
|
|
17636
|
-
* const electronApp = await electron.launch({
|
|
17637
|
-
* args: ['main.js']
|
|
17638
|
-
* });
|
|
17639
|
-
* const window = await electronApp.firstWindow();
|
|
17640
|
-
* // ...
|
|
17641
|
-
* ```
|
|
17642
|
-
*
|
|
17643
|
-
* @param options
|
|
17644
|
-
*/
|
|
17645
|
-
firstWindow(options?: {
|
|
17646
|
-
/**
|
|
17647
|
-
* Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
|
|
17648
|
-
* default value can be changed by using the
|
|
17649
|
-
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout).
|
|
17650
|
-
*/
|
|
17651
|
-
timeout?: number;
|
|
17652
|
-
}): Promise<Page>;
|
|
17653
|
-
|
|
17654
|
-
/**
|
|
17655
|
-
* Returns the main process for this Electron Application.
|
|
17656
|
-
*/
|
|
17657
|
-
process(): ChildProcess;
|
|
17658
|
-
|
|
17659
|
-
/**
|
|
17660
|
-
* This event is issued when the application process has been terminated.
|
|
17661
|
-
*/
|
|
17662
|
-
waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number } | (() => boolean | Promise<boolean>)): Promise<void>;
|
|
17663
|
-
|
|
17664
|
-
/**
|
|
17665
|
-
* Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
|
|
17666
|
-
* `console.dir`.
|
|
17667
|
-
*
|
|
17668
|
-
* The arguments passed into `console.log` are available on the
|
|
17669
|
-
* [ConsoleMessage](https://playwright.dev/docs/api/class-consolemessage) event handler argument.
|
|
17670
|
-
*
|
|
17671
|
-
* **Usage**
|
|
17672
|
-
*
|
|
17673
|
-
* ```js
|
|
17674
|
-
* electronApp.on('console', async msg => {
|
|
17675
|
-
* const values = [];
|
|
17676
|
-
* for (const arg of msg.args())
|
|
17677
|
-
* values.push(await arg.jsonValue());
|
|
17678
|
-
* console.log(...values);
|
|
17679
|
-
* });
|
|
17680
|
-
* await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
|
|
17681
|
-
* ```
|
|
17682
|
-
*
|
|
17683
|
-
*/
|
|
17684
|
-
waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;
|
|
17685
|
-
|
|
17686
|
-
/**
|
|
17687
|
-
* This event is issued for every window that is created **and loaded** in Electron. It contains a
|
|
17688
|
-
* [Page](https://playwright.dev/docs/api/class-page) that can be used for Playwright automation.
|
|
17689
|
-
*/
|
|
17690
|
-
waitForEvent(event: 'window', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;
|
|
17691
|
-
|
|
17692
|
-
|
|
17693
|
-
/**
|
|
17694
|
-
* Convenience method that returns all the opened windows.
|
|
17695
|
-
*/
|
|
17696
|
-
windows(): Array<Page>;
|
|
17697
|
-
|
|
17698
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
17699
|
-
}
|
|
17700
|
-
|
|
17701
|
-
// This is required to not export everything by default. See https://github.com/Microsoft/TypeScript/issues/19545#issuecomment-340490459
|
|
17702
|
-
export {};
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
/**
|
|
17706
|
-
* Exposes API that can be used for the Web API testing. This class is used for creating
|
|
17707
|
-
* [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) instance which in turn can be used for
|
|
17708
|
-
* sending web requests. An instance of this class can be obtained via
|
|
17709
|
-
* [playwright.request](https://playwright.dev/docs/api/class-playwright#playwright-request). For more information see
|
|
17710
|
-
* [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext).
|
|
17711
|
-
*/
|
|
17712
|
-
export interface APIRequest {
|
|
17713
|
-
/**
|
|
17714
|
-
* Creates new instances of [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext).
|
|
17715
|
-
* @param options
|
|
17257
|
+
* Creates new instances of [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext).
|
|
17258
|
+
* @param options
|
|
17716
17259
|
*/
|
|
17717
17260
|
newContext(options?: {
|
|
17718
17261
|
/**
|
|
@@ -18772,6 +18315,52 @@ export interface APIResponse {
|
|
|
18772
18315
|
*/
|
|
18773
18316
|
ok(): boolean;
|
|
18774
18317
|
|
|
18318
|
+
/**
|
|
18319
|
+
* Returns SSL and other security information. Resolves to `null` for non-HTTPS responses. For redirected requests,
|
|
18320
|
+
* returns the information for the last request in the redirect chain.
|
|
18321
|
+
*/
|
|
18322
|
+
securityDetails(): Promise<null|{
|
|
18323
|
+
/**
|
|
18324
|
+
* Common Name component of the Issuer field. from the certificate. This should only be used for informational
|
|
18325
|
+
* purposes. Optional.
|
|
18326
|
+
*/
|
|
18327
|
+
issuer?: string;
|
|
18328
|
+
|
|
18329
|
+
/**
|
|
18330
|
+
* The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.
|
|
18331
|
+
*/
|
|
18332
|
+
protocol?: string;
|
|
18333
|
+
|
|
18334
|
+
/**
|
|
18335
|
+
* Common Name component of the Subject field from the certificate. This should only be used for informational
|
|
18336
|
+
* purposes. Optional.
|
|
18337
|
+
*/
|
|
18338
|
+
subjectName?: string;
|
|
18339
|
+
|
|
18340
|
+
/**
|
|
18341
|
+
* Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.
|
|
18342
|
+
*/
|
|
18343
|
+
validFrom?: number;
|
|
18344
|
+
|
|
18345
|
+
/**
|
|
18346
|
+
* Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.
|
|
18347
|
+
*/
|
|
18348
|
+
validTo?: number;
|
|
18349
|
+
}>;
|
|
18350
|
+
|
|
18351
|
+
/**
|
|
18352
|
+
* Returns the IP address and port of the server. Resolves to `null` if the server address is not available. For
|
|
18353
|
+
* redirected requests, returns the information for the last request in the redirect chain.
|
|
18354
|
+
*/
|
|
18355
|
+
serverAddr(): Promise<null|{
|
|
18356
|
+
/**
|
|
18357
|
+
* IPv4 or IPV6 address of the server.
|
|
18358
|
+
*/
|
|
18359
|
+
ipAddress: string;
|
|
18360
|
+
|
|
18361
|
+
port: number;
|
|
18362
|
+
}>;
|
|
18363
|
+
|
|
18775
18364
|
/**
|
|
18776
18365
|
* Contains the status code of the response (e.g., 200 for a success).
|
|
18777
18366
|
*/
|
|
@@ -19217,6 +18806,188 @@ export interface Coverage {
|
|
|
19217
18806
|
}>>;
|
|
19218
18807
|
}
|
|
19219
18808
|
|
|
18809
|
+
/**
|
|
18810
|
+
* `Credentials` is a virtual WebAuthn authenticator scoped to a
|
|
18811
|
+
* [BrowserContext](https://playwright.dev/docs/api/class-browsercontext). It lets tests register passkeys and answer
|
|
18812
|
+
* `navigator.credentials.create()` / `navigator.credentials.get()` ceremonies in the page, without a real
|
|
18813
|
+
* authenticator or hardware security key.
|
|
18814
|
+
*
|
|
18815
|
+
* There are two common ways to use it:
|
|
18816
|
+
*
|
|
18817
|
+
* **Usage: seed a known credential**
|
|
18818
|
+
*
|
|
18819
|
+
* ```js
|
|
18820
|
+
* const context = await browser.newContext();
|
|
18821
|
+
*
|
|
18822
|
+
* // A passkey your backend already provisioned for a test user.
|
|
18823
|
+
* await context.credentials.create('example.com', {
|
|
18824
|
+
* id: knownCredentialId, // base64url
|
|
18825
|
+
* userHandle: knownUserHandle, // base64url
|
|
18826
|
+
* privateKey: knownPrivateKey, // base64url PKCS#8 (DER)
|
|
18827
|
+
* publicKey: knownPublicKey, // base64url SPKI (DER)
|
|
18828
|
+
* });
|
|
18829
|
+
* await context.credentials.install();
|
|
18830
|
+
*
|
|
18831
|
+
* const page = await context.newPage();
|
|
18832
|
+
* await page.goto('https://example.com/login');
|
|
18833
|
+
* // The page's navigator.credentials.get() is answered with the seeded passkey.
|
|
18834
|
+
* ```
|
|
18835
|
+
*
|
|
18836
|
+
* **Usage: capture a passkey, then reuse it**
|
|
18837
|
+
*
|
|
18838
|
+
* ```js
|
|
18839
|
+
* // setup test: let the app register a passkey, then save it.
|
|
18840
|
+
* const context = await browser.newContext();
|
|
18841
|
+
* await context.credentials.install();
|
|
18842
|
+
*
|
|
18843
|
+
* const page = await context.newPage();
|
|
18844
|
+
* await page.goto('https://example.com/register');
|
|
18845
|
+
* await page.getByRole('button', { name: 'Create a passkey' }).click();
|
|
18846
|
+
*
|
|
18847
|
+
* // Read back the passkey the page registered — it includes the private key.
|
|
18848
|
+
* const [credential] = await context.credentials.get({ rpId: 'example.com' });
|
|
18849
|
+
* fs.writeFileSync('playwright/.auth/passkey.json', JSON.stringify(credential));
|
|
18850
|
+
* ```
|
|
18851
|
+
*
|
|
18852
|
+
* ```js
|
|
18853
|
+
* // later test: seed the captured passkey so the app starts already enrolled.
|
|
18854
|
+
* const credential = JSON.parse(fs.readFileSync('playwright/.auth/passkey.json', 'utf8'));
|
|
18855
|
+
* const context = await browser.newContext();
|
|
18856
|
+
* await context.credentials.create(credential.rpId, credential);
|
|
18857
|
+
* await context.credentials.install();
|
|
18858
|
+
*
|
|
18859
|
+
* const page = await context.newPage();
|
|
18860
|
+
* await page.goto('https://example.com/login');
|
|
18861
|
+
* // navigator.credentials.get() resolves the captured passkey — already signed in.
|
|
18862
|
+
* ```
|
|
18863
|
+
*
|
|
18864
|
+
* **Defaults**
|
|
18865
|
+
*/
|
|
18866
|
+
export interface Credentials {
|
|
18867
|
+
/**
|
|
18868
|
+
* Seeds a virtual WebAuthn credential and returns it.
|
|
18869
|
+
*
|
|
18870
|
+
* With only [`rpId`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-rp-id), generates a
|
|
18871
|
+
* fresh **ECDSA P-256** keypair, credential id and user handle. The seeded credential is discoverable (resident), so
|
|
18872
|
+
* the page can resolve it from both username-then-passkey and usernameless passkey flows. The returned object carries
|
|
18873
|
+
* the private and public keys, so it can be persisted to disk and re-seeded in a later test.
|
|
18874
|
+
*
|
|
18875
|
+
* To **import a known credential**, supply all four of
|
|
18876
|
+
* [`id`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-id),
|
|
18877
|
+
* [`userHandle`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-user-handle),
|
|
18878
|
+
* [`privateKey`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-private-key) and
|
|
18879
|
+
* [`publicKey`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-public-key) together.
|
|
18880
|
+
*
|
|
18881
|
+
* Call [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) before
|
|
18882
|
+
* navigating to a page that uses WebAuthn.
|
|
18883
|
+
* @param rpId Relying party id (typically the site's effective domain).
|
|
18884
|
+
* @param options
|
|
18885
|
+
*/
|
|
18886
|
+
create(rpId: string, options?: {
|
|
18887
|
+
/**
|
|
18888
|
+
* Base64url-encoded credential id. Auto-generated if omitted.
|
|
18889
|
+
*/
|
|
18890
|
+
id?: string;
|
|
18891
|
+
|
|
18892
|
+
/**
|
|
18893
|
+
* Base64url-encoded PKCS#8 (DER) private key. Auto-generated if omitted.
|
|
18894
|
+
*/
|
|
18895
|
+
privateKey?: string;
|
|
18896
|
+
|
|
18897
|
+
/**
|
|
18898
|
+
* Base64url-encoded SPKI (DER) public key. Auto-generated if omitted.
|
|
18899
|
+
*/
|
|
18900
|
+
publicKey?: string;
|
|
18901
|
+
|
|
18902
|
+
/**
|
|
18903
|
+
* Base64url-encoded user handle. Auto-generated if omitted.
|
|
18904
|
+
*/
|
|
18905
|
+
userHandle?: string;
|
|
18906
|
+
}): Promise<{
|
|
18907
|
+
/**
|
|
18908
|
+
* Base64url-encoded credential id.
|
|
18909
|
+
*/
|
|
18910
|
+
id: string;
|
|
18911
|
+
|
|
18912
|
+
/**
|
|
18913
|
+
* Relying party id.
|
|
18914
|
+
*/
|
|
18915
|
+
rpId: string;
|
|
18916
|
+
|
|
18917
|
+
/**
|
|
18918
|
+
* Base64url-encoded user handle.
|
|
18919
|
+
*/
|
|
18920
|
+
userHandle: string;
|
|
18921
|
+
|
|
18922
|
+
/**
|
|
18923
|
+
* Base64url-encoded PKCS#8 (DER) private key.
|
|
18924
|
+
*/
|
|
18925
|
+
privateKey: string;
|
|
18926
|
+
|
|
18927
|
+
/**
|
|
18928
|
+
* Base64url-encoded SPKI (DER) public key.
|
|
18929
|
+
*/
|
|
18930
|
+
publicKey: string;
|
|
18931
|
+
}>;
|
|
18932
|
+
|
|
18933
|
+
/**
|
|
18934
|
+
* Removes a credential from the authenticator by its id. Works for any credential currently held — both those seeded
|
|
18935
|
+
* with [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create)
|
|
18936
|
+
* and those the page registered itself by calling `navigator.credentials.create()`.
|
|
18937
|
+
* @param id Base64url-encoded credential id.
|
|
18938
|
+
*/
|
|
18939
|
+
delete(id: string): Promise<void>;
|
|
18940
|
+
|
|
18941
|
+
/**
|
|
18942
|
+
* Returns every credential currently held by the authenticator, optionally filtered by
|
|
18943
|
+
* [`rpId`](https://playwright.dev/docs/api/class-credentials#credentials-get-option-rp-id) or
|
|
18944
|
+
* [`id`](https://playwright.dev/docs/api/class-credentials#credentials-get-option-id). This includes both credentials
|
|
18945
|
+
* seeded with
|
|
18946
|
+
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) and
|
|
18947
|
+
* credentials the page registered itself by calling `navigator.credentials.create()`.
|
|
18948
|
+
*
|
|
18949
|
+
* Each returned credential includes its private and public keys, so a passkey the app just registered can be saved
|
|
18950
|
+
* and re-seeded into a later test with
|
|
18951
|
+
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) — see
|
|
18952
|
+
* the second example in the class overview.
|
|
18953
|
+
* @param options
|
|
18954
|
+
*/
|
|
18955
|
+
get(options?: {
|
|
18956
|
+
/**
|
|
18957
|
+
* Only return the credential with this base64url-encoded id.
|
|
18958
|
+
*/
|
|
18959
|
+
id?: string;
|
|
18960
|
+
|
|
18961
|
+
/**
|
|
18962
|
+
* Only return credentials for this relying party id.
|
|
18963
|
+
*/
|
|
18964
|
+
rpId?: string;
|
|
18965
|
+
}): Promise<Array<{
|
|
18966
|
+
id: string;
|
|
18967
|
+
|
|
18968
|
+
rpId: string;
|
|
18969
|
+
|
|
18970
|
+
userHandle: string;
|
|
18971
|
+
|
|
18972
|
+
privateKey: string;
|
|
18973
|
+
|
|
18974
|
+
publicKey: string;
|
|
18975
|
+
}>>;
|
|
18976
|
+
|
|
18977
|
+
/**
|
|
18978
|
+
* Installs the virtual WebAuthn authenticator into the context, overriding `navigator.credentials.create()` and
|
|
18979
|
+
* `navigator.credentials.get()` in all current and future pages. Call this before the page first touches
|
|
18980
|
+
* `navigator.credentials`.
|
|
18981
|
+
*
|
|
18982
|
+
* Required: until [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) is
|
|
18983
|
+
* called, no interception is in place and the page sees the platform's native (or absent) WebAuthn behaviour. Seeding
|
|
18984
|
+
* credentials with
|
|
18985
|
+
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) without
|
|
18986
|
+
* installing populates the authenticator, but the page will never see those credentials.
|
|
18987
|
+
*/
|
|
18988
|
+
install(): Promise<void>;
|
|
18989
|
+
}
|
|
18990
|
+
|
|
19220
18991
|
/**
|
|
19221
18992
|
* API for controlling the Playwright debugger. The debugger allows pausing script execution and inspecting the page.
|
|
19222
18993
|
* Obtain the debugger instance via
|
|
@@ -21280,7 +21051,8 @@ export interface Selectors {
|
|
|
21280
21051
|
* Defines custom attribute name to be used in
|
|
21281
21052
|
* [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used
|
|
21282
21053
|
* by default.
|
|
21283
|
-
* @param attributeName Test id attribute name.
|
|
21054
|
+
* @param attributeName Test id attribute name. To match elements with any of several attributes, pass them as a comma-separated list, e.g.
|
|
21055
|
+
* `"data-pw,data-ti"`.
|
|
21284
21056
|
*/
|
|
21285
21057
|
setTestIdAttribute(attributeName: string): void;
|
|
21286
21058
|
}
|
|
@@ -21297,8 +21069,8 @@ export interface Touchscreen {
|
|
|
21297
21069
|
* Dispatches a `touchstart` and `touchend` event with a single touch at the position
|
|
21298
21070
|
* ([`x`](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap-option-x),[`y`](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap-option-y)).
|
|
21299
21071
|
*
|
|
21300
|
-
* **NOTE** [
|
|
21301
|
-
*
|
|
21072
|
+
* **NOTE** [touchscreen.tap(x, y)](https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap) will throw if
|
|
21073
|
+
* the [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the
|
|
21302
21074
|
* browser context is false.
|
|
21303
21075
|
*
|
|
21304
21076
|
* @param x X coordinate relative to the main frame's viewport in CSS pixels.
|
|
@@ -21888,6 +21660,63 @@ export interface WebSocket {
|
|
|
21888
21660
|
|
|
21889
21661
|
}
|
|
21890
21662
|
|
|
21663
|
+
/**
|
|
21664
|
+
* WebStorage exposes the page's `localStorage` or `sessionStorage` for the current origin via an async,
|
|
21665
|
+
* [browser-consistent](https://developer.mozilla.org/en-US/docs/Web/API/Storage) API.
|
|
21666
|
+
*
|
|
21667
|
+
* Instances are accessed through [page.localStorage](https://playwright.dev/docs/api/class-page#page-local-storage)
|
|
21668
|
+
* and [page.sessionStorage](https://playwright.dev/docs/api/class-page#page-session-storage).
|
|
21669
|
+
*
|
|
21670
|
+
* ```js
|
|
21671
|
+
* await page.goto('https://example.com');
|
|
21672
|
+
* await page.localStorage.setItem('token', 'abc');
|
|
21673
|
+
* const token = await page.localStorage.getItem('token');
|
|
21674
|
+
* const all = await page.localStorage.items();
|
|
21675
|
+
* await page.localStorage.removeItem('token');
|
|
21676
|
+
* await page.localStorage.clear();
|
|
21677
|
+
* ```
|
|
21678
|
+
*
|
|
21679
|
+
*/
|
|
21680
|
+
export interface WebStorage {
|
|
21681
|
+
/**
|
|
21682
|
+
* Removes all items from the storage.
|
|
21683
|
+
*/
|
|
21684
|
+
clear(): Promise<void>;
|
|
21685
|
+
|
|
21686
|
+
/**
|
|
21687
|
+
* Returns the value for the given
|
|
21688
|
+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-get-item-option-name) if present.
|
|
21689
|
+
* @param name Name of the item to retrieve.
|
|
21690
|
+
*/
|
|
21691
|
+
getItem(name: string): Promise<null|string>;
|
|
21692
|
+
|
|
21693
|
+
/**
|
|
21694
|
+
* Returns all items in the storage as name/value pairs.
|
|
21695
|
+
*/
|
|
21696
|
+
items(): Promise<Array<{
|
|
21697
|
+
name: string;
|
|
21698
|
+
|
|
21699
|
+
value: string;
|
|
21700
|
+
}>>;
|
|
21701
|
+
|
|
21702
|
+
/**
|
|
21703
|
+
* Removes the item with the given
|
|
21704
|
+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-remove-item-option-name). No-op if the item
|
|
21705
|
+
* is absent.
|
|
21706
|
+
* @param name Name of the item to remove.
|
|
21707
|
+
*/
|
|
21708
|
+
removeItem(name: string): Promise<void>;
|
|
21709
|
+
|
|
21710
|
+
/**
|
|
21711
|
+
* Sets the value for the given
|
|
21712
|
+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-set-item-option-name). Overwrites any
|
|
21713
|
+
* existing value for that name.
|
|
21714
|
+
* @param name Name of the item to set.
|
|
21715
|
+
* @param value New value for the item.
|
|
21716
|
+
*/
|
|
21717
|
+
setItem(name: string, value: string): Promise<void>;
|
|
21718
|
+
}
|
|
21719
|
+
|
|
21891
21720
|
/**
|
|
21892
21721
|
* Playwright has **experimental** support for Electron automation. You can access electron namespace via:
|
|
21893
21722
|
*
|
|
@@ -21938,6 +21767,35 @@ export interface WebSocket {
|
|
|
21938
21767
|
* - Ensure that `nodeCliInspect`
|
|
21939
21768
|
* ([FuseV1Options.EnableNodeCliInspectArguments](https://www.electronjs.org/docs/latest/tutorial/fuses#nodecliinspect))
|
|
21940
21769
|
* fuse is **not** set to `false`.
|
|
21770
|
+
*
|
|
21771
|
+
* **Mocking native dialogs:**
|
|
21772
|
+
*
|
|
21773
|
+
* Playwright does not intercept the native Electron [dialog](https://www.electronjs.org/docs/latest/api/dialog) API
|
|
21774
|
+
* (`dialog.showOpenDialog`, `dialog.showSaveDialog`, `dialog.showMessageBox`, etc.) because those calls happen in the
|
|
21775
|
+
* Electron main process and go straight to OS APIs. Use
|
|
21776
|
+
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
|
|
21777
|
+
* to replace the relevant methods in the main process so tests run deterministically without any OS-level UI:
|
|
21778
|
+
*
|
|
21779
|
+
* ```js
|
|
21780
|
+
* // Stub the open dialog to always return a fixed path.
|
|
21781
|
+
* await electronApp.evaluate(({ dialog }, filePaths) => {
|
|
21782
|
+
* dialog.showOpenDialog = () => Promise.resolve({ canceled: false, filePaths });
|
|
21783
|
+
* }, ['/path/to/file.txt']);
|
|
21784
|
+
*
|
|
21785
|
+
* // Stub the save dialog.
|
|
21786
|
+
* await electronApp.evaluate(({ dialog }, filePath) => {
|
|
21787
|
+
* dialog.showSaveDialog = () => Promise.resolve({ canceled: false, filePath });
|
|
21788
|
+
* }, '/path/to/saved.txt');
|
|
21789
|
+
*
|
|
21790
|
+
* // Stub showMessageBox to click the first button.
|
|
21791
|
+
* await electronApp.evaluate(({ dialog }) => {
|
|
21792
|
+
* dialog.showMessageBox = () => Promise.resolve({ response: 0, checkboxChecked: false });
|
|
21793
|
+
* });
|
|
21794
|
+
* ```
|
|
21795
|
+
*
|
|
21796
|
+
* The replacement persists until the application is closed. Synchronous variants (`showOpenDialogSync`,
|
|
21797
|
+
* `showSaveDialogSync`, `showMessageBoxSync`) can be stubbed the same way — just return the value directly instead of
|
|
21798
|
+
* a `Promise`.
|
|
21941
21799
|
*/
|
|
21942
21800
|
export interface Electron {
|
|
21943
21801
|
/**
|
|
@@ -23531,6 +23389,11 @@ export interface LaunchOptions {
|
|
|
23531
23389
|
}
|
|
23532
23390
|
|
|
23533
23391
|
export interface ConnectOverCDPOptions {
|
|
23392
|
+
/**
|
|
23393
|
+
* If specified, browser artifacts (such as traces and downloads) are saved into this directory.
|
|
23394
|
+
*/
|
|
23395
|
+
artifactsDir?: string;
|
|
23396
|
+
|
|
23534
23397
|
/**
|
|
23535
23398
|
* @deprecated Use the first argument instead.
|
|
23536
23399
|
*/
|
|
@@ -24389,6 +24252,22 @@ type Devices = {
|
|
|
24389
24252
|
"Galaxy Tab S4 landscape": DeviceDescriptor;
|
|
24390
24253
|
"Galaxy Tab S9": DeviceDescriptor;
|
|
24391
24254
|
"Galaxy Tab S9 landscape": DeviceDescriptor;
|
|
24255
|
+
"Galaxy Z Fold 6": DeviceDescriptor;
|
|
24256
|
+
"Galaxy Z Fold 6 landscape": DeviceDescriptor;
|
|
24257
|
+
"Galaxy Z Fold 6 Cover": DeviceDescriptor;
|
|
24258
|
+
"Galaxy Z Fold 6 Cover landscape": DeviceDescriptor;
|
|
24259
|
+
"Galaxy Z Fold 7": DeviceDescriptor;
|
|
24260
|
+
"Galaxy Z Fold 7 landscape": DeviceDescriptor;
|
|
24261
|
+
"Galaxy Z Fold 7 Cover": DeviceDescriptor;
|
|
24262
|
+
"Galaxy Z Fold 7 Cover landscape": DeviceDescriptor;
|
|
24263
|
+
"Galaxy Z Flip 6": DeviceDescriptor;
|
|
24264
|
+
"Galaxy Z Flip 6 landscape": DeviceDescriptor;
|
|
24265
|
+
"Galaxy Z Flip 6 Cover": DeviceDescriptor;
|
|
24266
|
+
"Galaxy Z Flip 6 Cover landscape": DeviceDescriptor;
|
|
24267
|
+
"Galaxy Z Flip 7": DeviceDescriptor;
|
|
24268
|
+
"Galaxy Z Flip 7 landscape": DeviceDescriptor;
|
|
24269
|
+
"Galaxy Z Flip 7 Cover": DeviceDescriptor;
|
|
24270
|
+
"Galaxy Z Flip 7 Cover landscape": DeviceDescriptor;
|
|
24392
24271
|
"iPad (gen 5)": DeviceDescriptor;
|
|
24393
24272
|
"iPad (gen 5) landscape": DeviceDescriptor;
|
|
24394
24273
|
"iPad (gen 6)": DeviceDescriptor;
|
|
@@ -24459,6 +24338,26 @@ type Devices = {
|
|
|
24459
24338
|
"iPhone 15 Pro landscape": DeviceDescriptor;
|
|
24460
24339
|
"iPhone 15 Pro Max": DeviceDescriptor;
|
|
24461
24340
|
"iPhone 15 Pro Max landscape": DeviceDescriptor;
|
|
24341
|
+
"iPhone 16": DeviceDescriptor;
|
|
24342
|
+
"iPhone 16 landscape": DeviceDescriptor;
|
|
24343
|
+
"iPhone 16 Plus": DeviceDescriptor;
|
|
24344
|
+
"iPhone 16 Plus landscape": DeviceDescriptor;
|
|
24345
|
+
"iPhone 16 Pro": DeviceDescriptor;
|
|
24346
|
+
"iPhone 16 Pro landscape": DeviceDescriptor;
|
|
24347
|
+
"iPhone 16 Pro Max": DeviceDescriptor;
|
|
24348
|
+
"iPhone 16 Pro Max landscape": DeviceDescriptor;
|
|
24349
|
+
"iPhone 16e": DeviceDescriptor;
|
|
24350
|
+
"iPhone 16e landscape": DeviceDescriptor;
|
|
24351
|
+
"iPhone 17": DeviceDescriptor;
|
|
24352
|
+
"iPhone 17 landscape": DeviceDescriptor;
|
|
24353
|
+
"iPhone Air": DeviceDescriptor;
|
|
24354
|
+
"iPhone Air landscape": DeviceDescriptor;
|
|
24355
|
+
"iPhone 17 Pro": DeviceDescriptor;
|
|
24356
|
+
"iPhone 17 Pro landscape": DeviceDescriptor;
|
|
24357
|
+
"iPhone 17 Pro Max": DeviceDescriptor;
|
|
24358
|
+
"iPhone 17 Pro Max landscape": DeviceDescriptor;
|
|
24359
|
+
"iPhone 17e": DeviceDescriptor;
|
|
24360
|
+
"iPhone 17e landscape": DeviceDescriptor;
|
|
24462
24361
|
"Kindle Fire HDX": DeviceDescriptor;
|
|
24463
24362
|
"Kindle Fire HDX landscape": DeviceDescriptor;
|
|
24464
24363
|
"LG Optimus L70": DeviceDescriptor;
|
|
@@ -24497,8 +24396,36 @@ type Devices = {
|
|
|
24497
24396
|
"Pixel 4a (5G) landscape": DeviceDescriptor;
|
|
24498
24397
|
"Pixel 5": DeviceDescriptor;
|
|
24499
24398
|
"Pixel 5 landscape": DeviceDescriptor;
|
|
24399
|
+
"Pixel 6": DeviceDescriptor;
|
|
24400
|
+
"Pixel 6 landscape": DeviceDescriptor;
|
|
24401
|
+
"Pixel 6 Pro": DeviceDescriptor;
|
|
24402
|
+
"Pixel 6 Pro landscape": DeviceDescriptor;
|
|
24403
|
+
"Pixel 6a": DeviceDescriptor;
|
|
24404
|
+
"Pixel 6a landscape": DeviceDescriptor;
|
|
24500
24405
|
"Pixel 7": DeviceDescriptor;
|
|
24501
24406
|
"Pixel 7 landscape": DeviceDescriptor;
|
|
24407
|
+
"Pixel 7 Pro": DeviceDescriptor;
|
|
24408
|
+
"Pixel 7 Pro landscape": DeviceDescriptor;
|
|
24409
|
+
"Pixel 7a": DeviceDescriptor;
|
|
24410
|
+
"Pixel 7a landscape": DeviceDescriptor;
|
|
24411
|
+
"Pixel 8": DeviceDescriptor;
|
|
24412
|
+
"Pixel 8 landscape": DeviceDescriptor;
|
|
24413
|
+
"Pixel 8 Pro": DeviceDescriptor;
|
|
24414
|
+
"Pixel 8 Pro landscape": DeviceDescriptor;
|
|
24415
|
+
"Pixel 8a": DeviceDescriptor;
|
|
24416
|
+
"Pixel 8a landscape": DeviceDescriptor;
|
|
24417
|
+
"Pixel 9": DeviceDescriptor;
|
|
24418
|
+
"Pixel 9 landscape": DeviceDescriptor;
|
|
24419
|
+
"Pixel 9 Pro": DeviceDescriptor;
|
|
24420
|
+
"Pixel 9 Pro landscape": DeviceDescriptor;
|
|
24421
|
+
"Pixel 9 Pro XL": DeviceDescriptor;
|
|
24422
|
+
"Pixel 9 Pro XL landscape": DeviceDescriptor;
|
|
24423
|
+
"Pixel 10": DeviceDescriptor;
|
|
24424
|
+
"Pixel 10 landscape": DeviceDescriptor;
|
|
24425
|
+
"Pixel 10 Pro": DeviceDescriptor;
|
|
24426
|
+
"Pixel 10 Pro landscape": DeviceDescriptor;
|
|
24427
|
+
"Pixel 10 Pro XL": DeviceDescriptor;
|
|
24428
|
+
"Pixel 10 Pro XL landscape": DeviceDescriptor;
|
|
24502
24429
|
"Moto G4": DeviceDescriptor;
|
|
24503
24430
|
"Moto G4 landscape": DeviceDescriptor;
|
|
24504
24431
|
"Desktop Chrome HiDPI": DeviceDescriptor;
|