webdriver 9.3.1 → 9.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bidi/socket.d.ts +1 -6
- package/build/bidi/socket.d.ts.map +1 -1
- package/build/browser.d.ts +4 -0
- package/build/browser.d.ts.map +1 -0
- package/build/constants.d.ts.map +1 -1
- package/build/environment.d.ts +23 -0
- package/build/environment.d.ts.map +1 -0
- package/build/index.cjs +7 -264
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +778 -763
- package/build/node.d.ts +4 -0
- package/build/node.d.ts.map +1 -0
- package/build/node.js +1734 -0
- package/build/request/node.d.ts +13 -0
- package/build/request/node.d.ts.map +1 -0
- package/build/request/request.d.ts +15 -4
- package/build/request/request.d.ts.map +1 -1
- package/build/request/types.d.ts +3 -0
- package/build/request/types.d.ts.map +1 -1
- package/build/request/web.d.ts +8 -0
- package/build/request/web.d.ts.map +1 -0
- package/build/utils.d.ts.map +1 -1
- package/package.json +8 -4
- package/build/request/index.d.ts +0 -26
- package/build/request/index.d.ts.map +0 -1
package/build/bidi/socket.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A WebSocket implementation that wraps the browser native WebSocket
|
|
3
3
|
* interface and exposes a similar interface to the Node.js WebSocket
|
|
4
4
|
*/
|
|
5
|
-
declare class BrowserSocket {
|
|
5
|
+
export declare class BrowserSocket {
|
|
6
6
|
#private;
|
|
7
7
|
constructor(wsUrl: string, opts: any);
|
|
8
8
|
handleMessage(event: MessageEvent): void;
|
|
@@ -11,9 +11,4 @@ declare class BrowserSocket {
|
|
|
11
11
|
off(event: string, callback: (data: any, reason?: any) => void): this;
|
|
12
12
|
close(): void;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
* make sure to use the correct WebSocket implementation based on the environment
|
|
16
|
-
*/
|
|
17
|
-
declare const _default: typeof BrowserSocket | typeof import("ws");
|
|
18
|
-
export default _default;
|
|
19
14
|
//# sourceMappingURL=socket.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/bidi/socket.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/bidi/socket.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,aAAa;;gBAKT,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAKrC,aAAa,CAAE,KAAK,EAAE,YAAY;IAMlC,IAAI,CAAE,IAAI,EAAE,MAAM;IAIlB,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI;IAc9D,GAAG,CAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI;IAK/D,KAAK;CAGR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAIlC,eAAe,SAAS,CAAA;AACxB,cAAc,YAAY,CAAA"}
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CA2I/D,CAAA;AAED,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAChE,eAAO,MAAM,kBAAkB,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BrowserSocket } from './bidi/socket.js';
|
|
2
|
+
import type { FetchRequest } from './request/web.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const isNode: boolean;
|
|
7
|
+
export interface EnvironmentVariables {
|
|
8
|
+
WEBDRIVER_CACHE_DIR?: string;
|
|
9
|
+
PROXY_URL?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface EnvironmentDependencies {
|
|
12
|
+
Request: typeof FetchRequest;
|
|
13
|
+
Socket: typeof BrowserSocket;
|
|
14
|
+
variables: EnvironmentVariables;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Holder for environment dependencies. These dependencies cannot
|
|
18
|
+
* be used during the module instantiation.
|
|
19
|
+
*/
|
|
20
|
+
export declare const environment: {
|
|
21
|
+
value: EnvironmentDependencies;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,MAAM,SAAwD,CAAA;AAE3E,MAAM,WAAW,oBAAoB;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,OAAO,YAAY,CAAC;IAC7B,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,SAAS,EAAE,oBAAoB,CAAA;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE;IACtB,KAAK,EAAE,uBAAuB,CAAC;CAalC,CAAA"}
|
package/build/index.cjs
CHANGED
|
@@ -6,13 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __esm = (fn, res) => function __init() {
|
|
10
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
-
};
|
|
12
|
-
var __export = (target, all) => {
|
|
13
|
-
for (var name in all)
|
|
14
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
-
};
|
|
16
9
|
var __copyProps = (to, from, except, desc) => {
|
|
17
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
11
|
for (let key of __getOwnPropNames(from))
|
|
@@ -30,285 +23,35 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
23
|
mod
|
|
31
24
|
));
|
|
32
25
|
|
|
33
|
-
// src/request/constants.ts
|
|
34
|
-
var REG_EXPS;
|
|
35
|
-
var init_constants = __esm({
|
|
36
|
-
"src/request/constants.ts"() {
|
|
37
|
-
"use strict";
|
|
38
|
-
REG_EXPS = {
|
|
39
|
-
commandName: /.*\/session\/[0-9a-f-]+\/(.*)/,
|
|
40
|
-
execFn: /return \(([\s\S]*)\)\.apply\(null, arguments\)/
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// src/request/error.ts
|
|
46
|
-
var import_utils, WebDriverError, WebDriverRequestError;
|
|
47
|
-
var init_error = __esm({
|
|
48
|
-
"src/request/error.ts"() {
|
|
49
|
-
"use strict";
|
|
50
|
-
import_utils = require("@wdio/utils");
|
|
51
|
-
init_constants();
|
|
52
|
-
WebDriverError = class extends Error {
|
|
53
|
-
/**
|
|
54
|
-
* return timeout error with information about the executing command on which the test hangs
|
|
55
|
-
*/
|
|
56
|
-
computeErrorMessage() {
|
|
57
|
-
const cmdName = this.#getExecCmdName();
|
|
58
|
-
const cmdArgs = this.#getExecCmdArgs(this.opts);
|
|
59
|
-
const cmdInfoMsg = `when running "${cmdName}" with method "${this.opts.method}"`;
|
|
60
|
-
const cmdArgsMsg = cmdArgs ? ` and args ${cmdArgs}` : "";
|
|
61
|
-
return `WebDriverError: ${this.message} ${cmdInfoMsg}${cmdArgsMsg}`;
|
|
62
|
-
}
|
|
63
|
-
#getExecCmdName() {
|
|
64
|
-
const { href } = this.url;
|
|
65
|
-
const res = href.match(REG_EXPS.commandName) || [];
|
|
66
|
-
return res[1] || href;
|
|
67
|
-
}
|
|
68
|
-
#getExecCmdArgs(requestOptions) {
|
|
69
|
-
const { body: cmdJson } = requestOptions;
|
|
70
|
-
if (typeof cmdJson !== "object") {
|
|
71
|
-
return "";
|
|
72
|
-
}
|
|
73
|
-
const transformedRes = (0, import_utils.transformCommandLogResult)(cmdJson);
|
|
74
|
-
if (typeof transformedRes === "string") {
|
|
75
|
-
return transformedRes;
|
|
76
|
-
}
|
|
77
|
-
if (typeof cmdJson.script === "string") {
|
|
78
|
-
const scriptRes = cmdJson.script.match(REG_EXPS.execFn) || [];
|
|
79
|
-
return `"${scriptRes[1] || cmdJson.script}"`;
|
|
80
|
-
}
|
|
81
|
-
return Object.keys(cmdJson).length ? `"${JSON.stringify(cmdJson)}"` : "";
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
WebDriverRequestError = class extends WebDriverError {
|
|
85
|
-
url;
|
|
86
|
-
opts;
|
|
87
|
-
statusCode;
|
|
88
|
-
body;
|
|
89
|
-
code;
|
|
90
|
-
constructor(err, url, opts) {
|
|
91
|
-
let message = err.message;
|
|
92
|
-
if (err.message === "fetch failed") {
|
|
93
|
-
message = `Failed to fetch [${opts.method}] ${url.href}: please make sure you have a WebDriver compatible server running on ${url.origin}`;
|
|
94
|
-
}
|
|
95
|
-
super(message);
|
|
96
|
-
this.url = url;
|
|
97
|
-
this.opts = opts;
|
|
98
|
-
const errorCode = typeof err.cause === "object" && err.cause && "code" in err.cause && typeof err.cause.code === "string" ? err.cause.code : "code" in err && typeof err.code === "string" ? err.code : void 0;
|
|
99
|
-
if (errorCode) {
|
|
100
|
-
this.code = errorCode;
|
|
101
|
-
this.message = errorCode === "UND_ERR_CONNECT_TIMEOUT" ? 'Request timed out! Consider increasing the "connectionRetryTimeout" option.' : "Request failed with error code " + errorCode;
|
|
102
|
-
}
|
|
103
|
-
this.message = this.computeErrorMessage();
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// src/request/request.ts
|
|
110
|
-
var import_node_perf_hooks, import_node_dns, import_index, FetchRequest;
|
|
111
|
-
var init_request = __esm({
|
|
112
|
-
"src/request/request.ts"() {
|
|
113
|
-
"use strict";
|
|
114
|
-
import_node_perf_hooks = require("node:perf_hooks");
|
|
115
|
-
import_node_dns = __toESM(require("node:dns"), 1);
|
|
116
|
-
import_index = __toESM(require("./index.js"), 1);
|
|
117
|
-
init_error();
|
|
118
|
-
if ("process" in globalThis && globalThis.process.versions?.node) {
|
|
119
|
-
import_node_dns.default.setDefaultResultOrder("ipv4first");
|
|
120
|
-
}
|
|
121
|
-
FetchRequest = class extends import_index.default {
|
|
122
|
-
constructor(method, endpoint, body, isHubCommand = false) {
|
|
123
|
-
super(method, endpoint, body, isHubCommand);
|
|
124
|
-
}
|
|
125
|
-
async _libRequest(url, opts) {
|
|
126
|
-
try {
|
|
127
|
-
const response = await fetch(url, {
|
|
128
|
-
method: opts.method,
|
|
129
|
-
body: JSON.stringify(opts.body),
|
|
130
|
-
headers: opts.headers,
|
|
131
|
-
signal: opts.signal
|
|
132
|
-
});
|
|
133
|
-
const resp = response.clone();
|
|
134
|
-
return {
|
|
135
|
-
statusCode: resp.status,
|
|
136
|
-
body: await resp.json() ?? {}
|
|
137
|
-
};
|
|
138
|
-
} catch (err) {
|
|
139
|
-
if (!(err instanceof Error)) {
|
|
140
|
-
throw new WebDriverRequestError(
|
|
141
|
-
new Error(`Failed to fetch ${url.href}: ${err.message || err || "Unknown error"}`),
|
|
142
|
-
url,
|
|
143
|
-
opts
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
throw new WebDriverRequestError(err, url, opts);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
_libPerformanceNow() {
|
|
150
|
-
return import_node_perf_hooks.performance.now();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// src/command.ts
|
|
157
|
-
var command_exports = {};
|
|
158
|
-
__export(command_exports, {
|
|
159
|
-
default: () => command_default
|
|
160
|
-
});
|
|
161
|
-
function command_default(method, endpointUri, commandInfo, doubleEncodeVariables = false) {
|
|
162
|
-
const { command: command2, deprecated, ref, parameters, variables = [], isHubCommand = false } = commandInfo;
|
|
163
|
-
return async function protocolCommand(...args) {
|
|
164
|
-
const isBidiCommand = BIDI_COMMANDS.includes(command2);
|
|
165
|
-
let endpoint = endpointUri;
|
|
166
|
-
const commandParams = [...variables.map((v) => Object.assign(v, {
|
|
167
|
-
/**
|
|
168
|
-
* url variables are:
|
|
169
|
-
*/
|
|
170
|
-
required: true,
|
|
171
|
-
// always required as they are part of the endpoint
|
|
172
|
-
type: "string"
|
|
173
|
-
// have to be always type of string
|
|
174
|
-
})), ...parameters];
|
|
175
|
-
const commandUsage = `${command2}(${commandParams.map((p) => p.name).join(", ")})`;
|
|
176
|
-
const moreInfo = `
|
|
177
|
-
|
|
178
|
-
For more info see ${ref}
|
|
179
|
-
`;
|
|
180
|
-
const body = {};
|
|
181
|
-
if (typeof deprecated === "string" && !process.env.DISABLE_WEBDRIVERIO_DEPRECATION_WARNINGS) {
|
|
182
|
-
const warning = deprecated.replace("This command", `The "${command2}" command`);
|
|
183
|
-
log.warn(warning);
|
|
184
|
-
console.warn(`\u26A0\uFE0F [WEBDRIVERIO DEPRECATION NOTICE] ${warning}`);
|
|
185
|
-
}
|
|
186
|
-
if (isBidiCommand) {
|
|
187
|
-
throw new Error(
|
|
188
|
-
`Failed to execute WebDriver Bidi command "${command2}" as no Bidi session was established. Make sure you enable it by setting "webSocketUrl: true" in your capabilities and verify that your environment and browser supports it.`
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
const minAllowedParams = commandParams.filter((param) => param.required).length;
|
|
192
|
-
if (args.length < minAllowedParams || args.length > commandParams.length) {
|
|
193
|
-
const parameterDescription = commandParams.length ? `
|
|
194
|
-
|
|
195
|
-
Property Description:
|
|
196
|
-
${commandParams.map((p) => ` "${p.name}" (${p.type}): ${p.description}`).join("\n")}` : "";
|
|
197
|
-
throw new Error(
|
|
198
|
-
`Wrong parameters applied for ${command2}
|
|
199
|
-
Usage: ${commandUsage}` + parameterDescription + moreInfo
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
for (const [it, arg] of Object.entries(args)) {
|
|
203
|
-
if (isBidiCommand) {
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
const i = parseInt(it, 10);
|
|
207
|
-
const commandParam = commandParams[i];
|
|
208
|
-
if (!(0, import_utils2.isValidParameter)(arg, commandParam.type)) {
|
|
209
|
-
if (typeof arg === "undefined" && !commandParam.required) {
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
const actual = commandParam.type.endsWith("[]") ? `(${(Array.isArray(arg) ? arg : [arg]).map((a) => (0, import_utils2.getArgumentType)(a))})[]` : (0, import_utils2.getArgumentType)(arg);
|
|
213
|
-
throw new Error(
|
|
214
|
-
`Malformed type for "${commandParam.name}" parameter of command ${command2}
|
|
215
|
-
Expected: ${commandParam.type}
|
|
216
|
-
Actual: ${actual}` + moreInfo
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
if (i < variables.length) {
|
|
220
|
-
const encodedArg = doubleEncodeVariables ? encodeURIComponent(encodeURIComponent(arg)) : encodeURIComponent(arg);
|
|
221
|
-
endpoint = endpoint.replace(`:${commandParams[i].name}`, encodedArg);
|
|
222
|
-
continue;
|
|
223
|
-
}
|
|
224
|
-
body[commandParams[i].name] = arg;
|
|
225
|
-
}
|
|
226
|
-
const request = new FetchRequest(method, endpoint, body, isHubCommand);
|
|
227
|
-
request.on("performance", (...args2) => this.emit("request.performance", ...args2));
|
|
228
|
-
this.emit("command", { command: command2, method, endpoint, body });
|
|
229
|
-
log.info("COMMAND", (0, import_utils2.commandCallStructure)(command2, args));
|
|
230
|
-
return request.makeRequest(this.options, this.sessionId).then((result) => {
|
|
231
|
-
if (typeof result.value !== "undefined") {
|
|
232
|
-
let resultLog = result.value;
|
|
233
|
-
if (/screenshot|recording/i.test(command2) && typeof result.value === "string" && result.value.length > 64) {
|
|
234
|
-
resultLog = `${result.value.slice(0, 61)}...`;
|
|
235
|
-
} else if (command2 === "executeScript" && body.script && body.script.includes("(() => window.__wdioEvents__)")) {
|
|
236
|
-
resultLog = `[${result.value.length} framework events captured]`;
|
|
237
|
-
}
|
|
238
|
-
log.info("RESULT", resultLog);
|
|
239
|
-
}
|
|
240
|
-
this.emit("result", { command: command2, method, endpoint, body, result });
|
|
241
|
-
if (command2 === "deleteSession") {
|
|
242
|
-
const browser = this;
|
|
243
|
-
browser._bidiHandler?.close();
|
|
244
|
-
const shutdownDriver = body.deleteSessionOpts?.shutdownDriver !== false;
|
|
245
|
-
if (shutdownDriver && "wdio:driverPID" in this.capabilities && this.capabilities["wdio:driverPID"]) {
|
|
246
|
-
log.info(`Kill driver process with PID ${this.capabilities["wdio:driverPID"]}`);
|
|
247
|
-
try {
|
|
248
|
-
const killedSuccessfully = process.kill(this.capabilities["wdio:driverPID"], "SIGKILL");
|
|
249
|
-
if (!killedSuccessfully) {
|
|
250
|
-
log.warn("Failed to kill driver process, manually clean-up might be required");
|
|
251
|
-
}
|
|
252
|
-
} catch (err) {
|
|
253
|
-
log.warn("Failed to kill driver process", err);
|
|
254
|
-
}
|
|
255
|
-
setTimeout(() => {
|
|
256
|
-
for (const handle of process._getActiveHandles()) {
|
|
257
|
-
if (handle.servername && handle.servername.includes("edgedl.me")) {
|
|
258
|
-
handle.destroy();
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}, 10);
|
|
262
|
-
}
|
|
263
|
-
if (!process.env.WDIO_WORKER_ID) {
|
|
264
|
-
import_logger.default.clearLogger();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return result.value;
|
|
268
|
-
});
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
var import_logger, import_utils2, import_protocols, log, BIDI_COMMANDS;
|
|
272
|
-
var init_command = __esm({
|
|
273
|
-
"src/command.ts"() {
|
|
274
|
-
"use strict";
|
|
275
|
-
import_logger = __toESM(require("@wdio/logger"), 1);
|
|
276
|
-
import_utils2 = require("@wdio/utils");
|
|
277
|
-
import_protocols = require("@wdio/protocols");
|
|
278
|
-
init_request();
|
|
279
|
-
log = (0, import_logger.default)("webdriver");
|
|
280
|
-
BIDI_COMMANDS = Object.values(import_protocols.WebDriverBidiProtocol).map((def) => def.socket.command);
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
|
|
284
26
|
// src/index.cts
|
|
27
|
+
var esmModule = import("./node.js");
|
|
285
28
|
function command(method, encodeUri, commandInfo, doubleEncodeVariables = false) {
|
|
286
29
|
return async function protocolCommand(...args) {
|
|
287
|
-
const commandESM = await
|
|
288
|
-
return commandESM.
|
|
30
|
+
const commandESM = await esmModule;
|
|
31
|
+
return commandESM.command(method, encodeUri, commandInfo, doubleEncodeVariables).apply(this, args);
|
|
289
32
|
};
|
|
290
33
|
}
|
|
291
34
|
var WebDriver = class _WebDriver {
|
|
292
35
|
static async newSession(options, modifier, userPrototype = {}, customCommandWrapper) {
|
|
293
|
-
const WebDriver2 = (await
|
|
36
|
+
const WebDriver2 = (await esmModule).WebDriver;
|
|
294
37
|
return WebDriver2.newSession(options, modifier, userPrototype, customCommandWrapper);
|
|
295
38
|
}
|
|
296
39
|
/**
|
|
297
40
|
* allows user to attach to existing sessions
|
|
298
41
|
*/
|
|
299
42
|
static async attachToSession(options, modifier, userPrototype = {}, commandWrapper) {
|
|
300
|
-
const WebDriver2 = (await
|
|
43
|
+
const WebDriver2 = (await esmModule).WebDriver;
|
|
301
44
|
return WebDriver2.attachToSession(options, modifier, userPrototype, commandWrapper);
|
|
302
45
|
}
|
|
303
46
|
/**
|
|
304
47
|
* Changes The instance session id and browser capabilities for the new session
|
|
305
|
-
* directly into the passed in browser object
|
|
48
|
+
* directly into the passed in browser object!!
|
|
306
49
|
*
|
|
307
50
|
* @param {object} instance the object we get from a new browser session.
|
|
308
51
|
* @returns {string} the new session id of the browser
|
|
309
52
|
*/
|
|
310
53
|
static async reloadSession(instance) {
|
|
311
|
-
const WebDriver2 = (await
|
|
54
|
+
const WebDriver2 = (await esmModule).WebDriver;
|
|
312
55
|
return WebDriver2.reloadSession(instance);
|
|
313
56
|
}
|
|
314
57
|
static get WebDriver() {
|
package/build/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export default class WebDriver {
|
|
|
25
25
|
/**
|
|
26
26
|
* Helper methods consumed by webdriverio package
|
|
27
27
|
*/
|
|
28
|
-
export { getPrototype, DEFAULTS, command, getEnvironmentVars, initiateBidi, parseBidiMessage };
|
|
28
|
+
export { getPrototype, DEFAULTS, command, getEnvironmentVars, initiateBidi, parseBidiMessage, WebDriver };
|
|
29
29
|
export * from './types.js';
|
|
30
30
|
export * from './constants.js';
|
|
31
31
|
export * from './bidi/handler.js';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,aAAa,CAAA;AAExD,OAAO,OAAO,MAA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