webdriver 8.10.7 → 8.11.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.
@@ -0,0 +1,16 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'node:events';
3
+ import WebSocket from 'ws';
4
+ import type { CommandData } from './remoteTypes.js';
5
+ import type { CommandResponse } from './localTypes.js';
6
+ export declare class BidiCore extends EventEmitter {
7
+ #private;
8
+ private _webSocketUrl;
9
+ constructor(_webSocketUrl: string);
10
+ connect(): Promise<void>;
11
+ get socket(): WebSocket;
12
+ get isConnected(): boolean;
13
+ send(params: CommandData): Promise<CommandResponse>;
14
+ sendAsync(params: CommandData): number;
15
+ }
16
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/bidi/core.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,SAAS,MAAM,IAAI,CAAA;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKtD,qBAAa,QAAS,SAAQ,YAAY;;IAKzB,OAAO,CAAC,aAAa;gBAAb,aAAa,EAAE,MAAM;IAMnC,OAAO;IAQd,IAAI,MAAM,cAET;IAED,IAAI,WAAW,YAEd;IAEM,IAAI,CAAE,MAAM,EAAE,WAAW;IA4BzB,SAAS,CAAE,MAAM,EAAE,WAAW;CASxC"}
@@ -1,9 +1,9 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import WebSocket from 'ws';
3
3
  import logger from '@wdio/logger';
4
- const log = logger('webdriver:BidiHandler');
4
+ const log = logger('webdriver');
5
5
  const RESPONSE_TIMEOUT = 1000 * 60;
6
- export class BidiHandler extends EventEmitter {
6
+ export class BidiCore extends EventEmitter {
7
7
  _webSocketUrl;
8
8
  #id = 0;
9
9
  #ws;
@@ -16,6 +16,7 @@ export class BidiHandler extends EventEmitter {
16
16
  }
17
17
  connect() {
18
18
  return new Promise((resolve) => this.#ws.on('open', () => {
19
+ log.info('Connected session to Bidi protocol');
19
20
  this.#isConnected = true;
20
21
  resolve();
21
22
  }));
@@ -27,11 +28,7 @@ export class BidiHandler extends EventEmitter {
27
28
  return this.#isConnected;
28
29
  }
29
30
  send(params) {
30
- if (!this.#isConnected) {
31
- throw new Error('No connection to WebDriver Bidi was established');
32
- }
33
- const id = ++this.#id;
34
- this.#ws.send(JSON.stringify({ id, ...params }));
31
+ const id = this.sendAsync(params);
35
32
  return new Promise((resolve, reject) => {
36
33
  const t = setTimeout(() => {
37
34
  reject(new Error(`Request with id ${id} timed out`));
@@ -43,6 +40,10 @@ export class BidiHandler extends EventEmitter {
43
40
  if (payload.id === id) {
44
41
  clearTimeout(t);
45
42
  h.off('message', listener);
43
+ log.info('BIDI RESULT', JSON.stringify(payload));
44
+ if (payload.error) {
45
+ return reject(new Error(payload.error));
46
+ }
46
47
  resolve(payload);
47
48
  }
48
49
  }
@@ -59,5 +60,6 @@ export class BidiHandler extends EventEmitter {
59
60
  }
60
61
  const id = ++this.#id;
61
62
  this.#ws.send(JSON.stringify({ id, ...params }));
63
+ return id;
62
64
  }
63
65
  }
@@ -0,0 +1,188 @@
1
+ /**
2
+ * !!! PLEASE DO NOT EDIT THIS FILE !!!
3
+ *
4
+ * This source file, even though checked in, is auto-generated based on the
5
+ * current development within the WebDriver Bidi spec. Any changes to this
6
+ * file need to come from the specification. You can generate this file by calling
7
+ *
8
+ * ```
9
+ * $ npm run generate:bidi
10
+ * ```
11
+ *
12
+ * from the project root. You can find the scripts that generates this file in
13
+ * ./scripts/bidi/**
14
+ */
15
+ /**
16
+ * !!! PLEASE DO NOT EDIT THIS FILE !!!
17
+ *
18
+ * This source file, even though checked in, is auto-generated based on the
19
+ * current development within the WebDriver Bidi spec. Any changes to this
20
+ * file need to come from the specification. You can generate this file by calling
21
+ *
22
+ * ```
23
+ * $ npm run generate:bidi
24
+ * ```
25
+ *
26
+ * from the project root. You can find the scripts that generates this file in
27
+ * ./scripts/bidi/**
28
+ */
29
+ import type * as local from './localTypes.js';
30
+ import type * as remote from './remoteTypes.js';
31
+ import { BidiCore } from './core.js';
32
+ export declare class BidiHandler extends BidiCore {
33
+ /**
34
+ * WebDriver Bidi command to send command method "session.status" with parameters.
35
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-status
36
+ * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-session-status | command parameter}
37
+ * @returns `Promise<local.SessionStatusResult>`
38
+ **/
39
+ sessionStatus(params: remote.EmptyParams): Promise<local.SessionStatusResult>;
40
+ /**
41
+ * WebDriver Bidi command to send command method "session.new" with parameters.
42
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-new
43
+ * @param params `remote.SessionNewParameters` {@link https://w3c.github.io/webdriver-bidi/#command-session-new | command parameter}
44
+ * @returns `Promise<local.SessionNewResult>`
45
+ **/
46
+ sessionNew(params: remote.SessionNewParameters): Promise<local.SessionNewResult>;
47
+ /**
48
+ * WebDriver Bidi command to send command method "session.end" with parameters.
49
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-end
50
+ * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-session-end | command parameter}
51
+ * @returns `Promise<local.EmptyResult>`
52
+ **/
53
+ sessionEnd(params: remote.EmptyParams): Promise<local.EmptyResult>;
54
+ /**
55
+ * WebDriver Bidi command to send command method "session.subscribe" with parameters.
56
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-subscribe
57
+ * @param params `remote.SessionSubscriptionRequest` {@link https://w3c.github.io/webdriver-bidi/#command-session-subscribe | command parameter}
58
+ * @returns `Promise<local.EmptyResult>`
59
+ **/
60
+ sessionSubscribe(params: remote.SessionSubscriptionRequest): Promise<local.EmptyResult>;
61
+ /**
62
+ * WebDriver Bidi command to send command method "session.unsubscribe" with parameters.
63
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe
64
+ * @param params `remote.SessionSubscriptionRequest` {@link https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe | command parameter}
65
+ * @returns `Promise<local.EmptyResult>`
66
+ **/
67
+ sessionUnsubscribe(params: remote.SessionSubscriptionRequest): Promise<local.EmptyResult>;
68
+ /**
69
+ * WebDriver Bidi command to send command method "browser.close" with parameters.
70
+ * @url https://w3c.github.io/webdriver-bidi/#command-browser-close
71
+ * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-browser-close | command parameter}
72
+ * @returns `Promise<local.EmptyResult>`
73
+ **/
74
+ browserClose(params: remote.EmptyParams): Promise<local.EmptyResult>;
75
+ /**
76
+ * WebDriver Bidi command to send command method "browsingContext.captureScreenshot" with parameters.
77
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot
78
+ * @param params `remote.BrowsingContextCaptureScreenshotParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot | command parameter}
79
+ * @returns `Promise<local.BrowsingContextCaptureScreenshotResult>`
80
+ **/
81
+ browsingContextCaptureScreenshot(params: remote.BrowsingContextCaptureScreenshotParameters): Promise<local.BrowsingContextCaptureScreenshotResult>;
82
+ /**
83
+ * WebDriver Bidi command to send command method "browsingContext.close" with parameters.
84
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-close
85
+ * @param params `remote.BrowsingContextCloseParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-close | command parameter}
86
+ * @returns `Promise<local.EmptyResult>`
87
+ **/
88
+ browsingContextClose(params: remote.BrowsingContextCloseParameters): Promise<local.EmptyResult>;
89
+ /**
90
+ * WebDriver Bidi command to send command method "browsingContext.create" with parameters.
91
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-create
92
+ * @param params `remote.BrowsingContextCreateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-create | command parameter}
93
+ * @returns `Promise<local.BrowsingContextCreateResult>`
94
+ **/
95
+ browsingContextCreate(params: remote.BrowsingContextCreateParameters): Promise<local.BrowsingContextCreateResult>;
96
+ /**
97
+ * WebDriver Bidi command to send command method "browsingContext.getTree" with parameters.
98
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree
99
+ * @param params `remote.BrowsingContextGetTreeParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree | command parameter}
100
+ * @returns `Promise<local.BrowsingContextGetTreeResult>`
101
+ **/
102
+ browsingContextGetTree(params: remote.BrowsingContextGetTreeParameters): Promise<local.BrowsingContextGetTreeResult>;
103
+ /**
104
+ * WebDriver Bidi command to send command method "browsingContext.handleUserPrompt" with parameters.
105
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt
106
+ * @param params `remote.BrowsingContextHandleUserPromptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt | command parameter}
107
+ * @returns `Promise<local.EmptyResult>`
108
+ **/
109
+ browsingContextHandleUserPrompt(params: remote.BrowsingContextHandleUserPromptParameters): Promise<local.EmptyResult>;
110
+ /**
111
+ * WebDriver Bidi command to send command method "browsingContext.navigate" with parameters.
112
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate
113
+ * @param params `remote.BrowsingContextNavigateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate | command parameter}
114
+ * @returns `Promise<local.BrowsingContextNavigateResult>`
115
+ **/
116
+ browsingContextNavigate(params: remote.BrowsingContextNavigateParameters): Promise<local.BrowsingContextNavigateResult>;
117
+ /**
118
+ * WebDriver Bidi command to send command method "browsingContext.print" with parameters.
119
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-print
120
+ * @param params `remote.BrowsingContextPrintParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-print | command parameter}
121
+ * @returns `Promise<local.BrowsingContextPrintResult>`
122
+ **/
123
+ browsingContextPrint(params: remote.BrowsingContextPrintParameters): Promise<local.BrowsingContextPrintResult>;
124
+ /**
125
+ * WebDriver Bidi command to send command method "browsingContext.reload" with parameters.
126
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload
127
+ * @param params `remote.BrowsingContextReloadParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload | command parameter}
128
+ * @returns `Promise<local.EmptyResult>`
129
+ **/
130
+ browsingContextReload(params: remote.BrowsingContextReloadParameters): Promise<local.EmptyResult>;
131
+ /**
132
+ * WebDriver Bidi command to send command method "script.addPreloadScript" with parameters.
133
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript
134
+ * @param params `remote.ScriptAddPreloadScriptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript | command parameter}
135
+ * @returns `Promise<local.EmptyResult>`
136
+ **/
137
+ scriptAddPreloadScriptCommand(params: remote.ScriptAddPreloadScriptParameters): Promise<local.EmptyResult>;
138
+ /**
139
+ * WebDriver Bidi command to send command method "script.disown" with parameters.
140
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-disown
141
+ * @param params `remote.ScriptDisownParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-disown | command parameter}
142
+ * @returns `Promise<local.EmptyResult>`
143
+ **/
144
+ scriptDisown(params: remote.ScriptDisownParameters): Promise<local.EmptyResult>;
145
+ /**
146
+ * WebDriver Bidi command to send command method "script.callFunction" with parameters.
147
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-callFunction
148
+ * @param params `remote.ScriptCallFunctionParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-callFunction | command parameter}
149
+ * @returns `Promise<local.EmptyResult>`
150
+ **/
151
+ scriptCallFunction(params: remote.ScriptCallFunctionParameters): Promise<local.EmptyResult>;
152
+ /**
153
+ * WebDriver Bidi command to send command method "script.evaluate" with parameters.
154
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-evaluate
155
+ * @param params `remote.ScriptEvaluateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-evaluate | command parameter}
156
+ * @returns `Promise<local.ScriptEvaluateResult>`
157
+ **/
158
+ scriptEvaluate(params: remote.ScriptEvaluateParameters): Promise<local.ScriptEvaluateResult>;
159
+ /**
160
+ * WebDriver Bidi command to send command method "script.getRealms" with parameters.
161
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-getRealms
162
+ * @param params `remote.ScriptGetRealmsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-getRealms | command parameter}
163
+ * @returns `Promise<local.ScriptGetRealmsResult>`
164
+ **/
165
+ scriptGetRealms(params: remote.ScriptGetRealmsParameters): Promise<local.ScriptGetRealmsResult>;
166
+ /**
167
+ * WebDriver Bidi command to send command method "script.removePreloadScript" with parameters.
168
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript
169
+ * @param params `remote.ScriptRemovePreloadScriptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript | command parameter}
170
+ * @returns `Promise<local.EmptyResult>`
171
+ **/
172
+ scriptRemovePreloadScriptCommand(params: remote.ScriptRemovePreloadScriptParameters): Promise<local.EmptyResult>;
173
+ /**
174
+ * WebDriver Bidi command to send command method "input.performActions" with parameters.
175
+ * @url https://w3c.github.io/webdriver-bidi/#command-input-performActions
176
+ * @param params `remote.InputPerformActionsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-performActions | command parameter}
177
+ * @returns `Promise<local.EmptyResult>`
178
+ **/
179
+ inputPerformActions(params: remote.InputPerformActionsParameters): Promise<local.EmptyResult>;
180
+ /**
181
+ * WebDriver Bidi command to send command method "input.releaseActions" with parameters.
182
+ * @url https://w3c.github.io/webdriver-bidi/#command-input-releaseActions
183
+ * @param params `remote.InputReleaseActionsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-releaseActions | command parameter}
184
+ * @returns `Promise<local.EmptyResult>`
185
+ **/
186
+ inputReleaseActions(params: remote.InputReleaseActionsParameters):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AAC,KAAK,CAAC,qBAAqB,CAAC;IASrG;;;;;QAKI;IACE,gCAAgC,CAAC,MAAM,EAAE,MAAM,CAAC,mCAAmC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC;IAStH;;;;;QAKI;IACE,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,6BAA6B,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC;IASnG;;;;;QAKI;IACE,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,6BAA6B,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC;CAQtG"}
@@ -0,0 +1,303 @@
1
+ /**
2
+ * !!! PLEASE DO NOT EDIT THIS FILE !!!
3
+ *
4
+ * This source file, even though checked in, is auto-generated based on the
5
+ * current development within the WebDriver Bidi spec. Any changes to this
6
+ * file need to come from the specification. You can generate this file by calling
7
+ *
8
+ * ```
9
+ * $ npm run generate:bidi
10
+ * ```
11
+ *
12
+ * from the project root. You can find the scripts that generates this file in
13
+ * ./scripts/bidi/**
14
+ */
15
+ import { BidiCore } from './core.js';
16
+ export class BidiHandler extends BidiCore {
17
+ /**
18
+ * WebDriver Bidi command to send command method "session.status" with parameters.
19
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-status
20
+ * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-session-status | command parameter}
21
+ * @returns `Promise<local.SessionStatusResult>`
22
+ **/
23
+ async sessionStatus(params) {
24
+ const result = await this.send({
25
+ method: 'session.status',
26
+ params
27
+ });
28
+ return result.result;
29
+ }
30
+ /**
31
+ * WebDriver Bidi command to send command method "session.new" with parameters.
32
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-new
33
+ * @param params `remote.SessionNewParameters` {@link https://w3c.github.io/webdriver-bidi/#command-session-new | command parameter}
34
+ * @returns `Promise<local.SessionNewResult>`
35
+ **/
36
+ async sessionNew(params) {
37
+ const result = await this.send({
38
+ method: 'session.new',
39
+ params
40
+ });
41
+ return result.result;
42
+ }
43
+ /**
44
+ * WebDriver Bidi command to send command method "session.end" with parameters.
45
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-end
46
+ * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-session-end | command parameter}
47
+ * @returns `Promise<local.EmptyResult>`
48
+ **/
49
+ async sessionEnd(params) {
50
+ const result = await this.send({
51
+ method: 'session.end',
52
+ params
53
+ });
54
+ return result.result;
55
+ }
56
+ /**
57
+ * WebDriver Bidi command to send command method "session.subscribe" with parameters.
58
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-subscribe
59
+ * @param params `remote.SessionSubscriptionRequest` {@link https://w3c.github.io/webdriver-bidi/#command-session-subscribe | command parameter}
60
+ * @returns `Promise<local.EmptyResult>`
61
+ **/
62
+ async sessionSubscribe(params) {
63
+ const result = await this.send({
64
+ method: 'session.subscribe',
65
+ params
66
+ });
67
+ return result.result;
68
+ }
69
+ /**
70
+ * WebDriver Bidi command to send command method "session.unsubscribe" with parameters.
71
+ * @url https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe
72
+ * @param params `remote.SessionSubscriptionRequest` {@link https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe | command parameter}
73
+ * @returns `Promise<local.EmptyResult>`
74
+ **/
75
+ async sessionUnsubscribe(params) {
76
+ const result = await this.send({
77
+ method: 'session.unsubscribe',
78
+ params
79
+ });
80
+ return result.result;
81
+ }
82
+ /**
83
+ * WebDriver Bidi command to send command method "browser.close" with parameters.
84
+ * @url https://w3c.github.io/webdriver-bidi/#command-browser-close
85
+ * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-browser-close | command parameter}
86
+ * @returns `Promise<local.EmptyResult>`
87
+ **/
88
+ async browserClose(params) {
89
+ const result = await this.send({
90
+ method: 'browser.close',
91
+ params
92
+ });
93
+ return result.result;
94
+ }
95
+ /**
96
+ * WebDriver Bidi command to send command method "browsingContext.captureScreenshot" with parameters.
97
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot
98
+ * @param params `remote.BrowsingContextCaptureScreenshotParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot | command parameter}
99
+ * @returns `Promise<local.BrowsingContextCaptureScreenshotResult>`
100
+ **/
101
+ async browsingContextCaptureScreenshot(params) {
102
+ const result = await this.send({
103
+ method: 'browsingContext.captureScreenshot',
104
+ params
105
+ });
106
+ return result.result;
107
+ }
108
+ /**
109
+ * WebDriver Bidi command to send command method "browsingContext.close" with parameters.
110
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-close
111
+ * @param params `remote.BrowsingContextCloseParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-close | command parameter}
112
+ * @returns `Promise<local.EmptyResult>`
113
+ **/
114
+ async browsingContextClose(params) {
115
+ const result = await this.send({
116
+ method: 'browsingContext.close',
117
+ params
118
+ });
119
+ return result.result;
120
+ }
121
+ /**
122
+ * WebDriver Bidi command to send command method "browsingContext.create" with parameters.
123
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-create
124
+ * @param params `remote.BrowsingContextCreateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-create | command parameter}
125
+ * @returns `Promise<local.BrowsingContextCreateResult>`
126
+ **/
127
+ async browsingContextCreate(params) {
128
+ const result = await this.send({
129
+ method: 'browsingContext.create',
130
+ params
131
+ });
132
+ return result.result;
133
+ }
134
+ /**
135
+ * WebDriver Bidi command to send command method "browsingContext.getTree" with parameters.
136
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree
137
+ * @param params `remote.BrowsingContextGetTreeParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree | command parameter}
138
+ * @returns `Promise<local.BrowsingContextGetTreeResult>`
139
+ **/
140
+ async browsingContextGetTree(params) {
141
+ const result = await this.send({
142
+ method: 'browsingContext.getTree',
143
+ params
144
+ });
145
+ return result.result;
146
+ }
147
+ /**
148
+ * WebDriver Bidi command to send command method "browsingContext.handleUserPrompt" with parameters.
149
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt
150
+ * @param params `remote.BrowsingContextHandleUserPromptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt | command parameter}
151
+ * @returns `Promise<local.EmptyResult>`
152
+ **/
153
+ async browsingContextHandleUserPrompt(params) {
154
+ const result = await this.send({
155
+ method: 'browsingContext.handleUserPrompt',
156
+ params
157
+ });
158
+ return result.result;
159
+ }
160
+ /**
161
+ * WebDriver Bidi command to send command method "browsingContext.navigate" with parameters.
162
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate
163
+ * @param params `remote.BrowsingContextNavigateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate | command parameter}
164
+ * @returns `Promise<local.BrowsingContextNavigateResult>`
165
+ **/
166
+ async browsingContextNavigate(params) {
167
+ const result = await this.send({
168
+ method: 'browsingContext.navigate',
169
+ params
170
+ });
171
+ return result.result;
172
+ }
173
+ /**
174
+ * WebDriver Bidi command to send command method "browsingContext.print" with parameters.
175
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-print
176
+ * @param params `remote.BrowsingContextPrintParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-print | command parameter}
177
+ * @returns `Promise<local.BrowsingContextPrintResult>`
178
+ **/
179
+ async browsingContextPrint(params) {
180
+ const result = await this.send({
181
+ method: 'browsingContext.print',
182
+ params
183
+ });
184
+ return result.result;
185
+ }
186
+ /**
187
+ * WebDriver Bidi command to send command method "browsingContext.reload" with parameters.
188
+ * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload
189
+ * @param params `remote.BrowsingContextReloadParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload | command parameter}
190
+ * @returns `Promise<local.EmptyResult>`
191
+ **/
192
+ async browsingContextReload(params) {
193
+ const result = await this.send({
194
+ method: 'browsingContext.reload',
195
+ params
196
+ });
197
+ return result.result;
198
+ }
199
+ /**
200
+ * WebDriver Bidi command to send command method "script.addPreloadScript" with parameters.
201
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript
202
+ * @param params `remote.ScriptAddPreloadScriptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript | command parameter}
203
+ * @returns `Promise<local.EmptyResult>`
204
+ **/
205
+ async scriptAddPreloadScriptCommand(params) {
206
+ const result = await this.send({
207
+ method: 'script.addPreloadScript',
208
+ params
209
+ });
210
+ return result.result;
211
+ }
212
+ /**
213
+ * WebDriver Bidi command to send command method "script.disown" with parameters.
214
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-disown
215
+ * @param params `remote.ScriptDisownParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-disown | command parameter}
216
+ * @returns `Promise<local.EmptyResult>`
217
+ **/
218
+ async scriptDisown(params) {
219
+ const result = await this.send({
220
+ method: 'script.disown',
221
+ params
222
+ });
223
+ return result.result;
224
+ }
225
+ /**
226
+ * WebDriver Bidi command to send command method "script.callFunction" with parameters.
227
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-callFunction
228
+ * @param params `remote.ScriptCallFunctionParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-callFunction | command parameter}
229
+ * @returns `Promise<local.EmptyResult>`
230
+ **/
231
+ async scriptCallFunction(params) {
232
+ const result = await this.send({
233
+ method: 'script.callFunction',
234
+ params
235
+ });
236
+ return result.result;
237
+ }
238
+ /**
239
+ * WebDriver Bidi command to send command method "script.evaluate" with parameters.
240
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-evaluate
241
+ * @param params `remote.ScriptEvaluateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-evaluate | command parameter}
242
+ * @returns `Promise<local.ScriptEvaluateResult>`
243
+ **/
244
+ async scriptEvaluate(params) {
245
+ const result = await this.send({
246
+ method: 'script.evaluate',
247
+ params
248
+ });
249
+ return result.result;
250
+ }
251
+ /**
252
+ * WebDriver Bidi command to send command method "script.getRealms" with parameters.
253
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-getRealms
254
+ * @param params `remote.ScriptGetRealmsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-getRealms | command parameter}
255
+ * @returns `Promise<local.ScriptGetRealmsResult>`
256
+ **/
257
+ async scriptGetRealms(params) {
258
+ const result = await this.send({
259
+ method: 'script.getRealms',
260
+ params
261
+ });
262
+ return result.result;
263
+ }
264
+ /**
265
+ * WebDriver Bidi command to send command method "script.removePreloadScript" with parameters.
266
+ * @url https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript
267
+ * @param params `remote.ScriptRemovePreloadScriptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript | command parameter}
268
+ * @returns `Promise<local.EmptyResult>`
269
+ **/
270
+ async scriptRemovePreloadScriptCommand(params) {
271
+ const result = await this.send({
272
+ method: 'script.removePreloadScript',
273
+ params
274
+ });
275
+ return result.result;
276
+ }
277
+ /**
278
+ * WebDriver Bidi command to send command method "input.performActions" with parameters.
279
+ * @url https://w3c.github.io/webdriver-bidi/#command-input-performActions
280
+ * @param params `remote.InputPerformActionsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-performActions | command parameter}
281
+ * @returns `Promise<local.EmptyResult>`
282
+ **/
283
+ async inputPerformActions(params) {
284
+ const result = await this.send({
285
+ method: 'input.performActions',
286
+ params
287
+ });
288
+ return result.result;
289
+ }
290
+ /**
291
+ * WebDriver Bidi command to send command method "input.releaseActions" with parameters.
292
+ * @url https://w3c.github.io/webdriver-bidi/#command-input-releaseActions
293
+ * @param params `remote.InputReleaseActionsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-releaseActions | command parameter}
294
+ * @returns `Promise<local.EmptyResult>`
295
+ **/
296
+ async inputReleaseActions(params) {
297
+ const result = await this.send({
298
+ method: 'input.releaseActions',
299
+ params
300
+ });
301
+ return result.result;
302
+ }
303
+ }