webdriver 9.30.1 → 9.31.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.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAgK/D,CAAA;AAED,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAChE,eAAO,MAAM,kBAAkB,uCAAuC,CAAA;AAEtE,eAAO,MAAM,aAAa,QAAiE,CAAA;AAC3F,eAAO,MAAM,qCAAqC,SAAU,CAAA;AAE5D,eAAO,MAAM,qBAAqB;;CAAsC,CAAA"}
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,CA+J/D,CAAA;AAED,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAChE,eAAO,MAAM,kBAAkB,uCAAuC,CAAA;AAEtE,eAAO,MAAM,aAAa,QAAiE,CAAA;AAC3F,eAAO,MAAM,qCAAqC,SAAU,CAAA;AAE5D,eAAO,MAAM,qBAAqB;;CAAsC,CAAA"}
package/build/index.js CHANGED
@@ -229,8 +229,7 @@ var DEFAULTS = {
229
229
  * when attempting to start a session.
230
230
  */
231
231
  cacheDir: {
232
- type: "string",
233
- default: environment.value.variables.WEBDRIVER_CACHE_DIR
232
+ type: "string"
234
233
  },
235
234
  /**
236
235
  * Mask sensitive data in logs by replacing matching string or all captured groups for the provided regular expressions as string
@@ -2074,10 +2073,11 @@ var WebDriverRequestError = class extends WebDriverError {
2074
2073
  __publicField(this, "code");
2075
2074
  this.url = url;
2076
2075
  this.opts = opts;
2077
- 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;
2076
+ const isAbortTimeout = err.name === "TimeoutError";
2077
+ 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 : isAbortTimeout ? "ETIMEDOUT" : void 0;
2078
2078
  if (errorCode) {
2079
2079
  this.code = errorCode;
2080
- this.message = errorCode === "UND_ERR_CONNECT_TIMEOUT" ? 'Request timed out! Consider increasing the "connectionRetryTimeout" option.' : "Request failed with error code " + errorCode;
2080
+ this.message = errorCode === "UND_ERR_CONNECT_TIMEOUT" || isAbortTimeout ? 'Request timed out! Consider increasing the "connectionRetryTimeout" option.' : "Request failed with error code " + errorCode;
2081
2081
  }
2082
2082
  if (typeof err.cause === "object" && err.cause) {
2083
2083
  this.statusCode = "statusCode" in err.cause && typeof err.cause.statusCode === "number" ? err.cause.statusCode : void 0;
@@ -2114,7 +2114,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
2114
2114
  // package.json
2115
2115
  var package_default = {
2116
2116
  name: "webdriver",
2117
- version: "9.30.0",
2117
+ version: "9.31.0",
2118
2118
  description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
2119
2119
  author: "Christian Bromann <mail@bromann.dev>",
2120
2120
  homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
@@ -2242,6 +2242,7 @@ var WebDriverRequest = class {
2242
2242
  __publicField(this, "requiresSessionId");
2243
2243
  __publicField(this, "eventHandler");
2244
2244
  __publicField(this, "abortSignal");
2245
+ __publicField(this, "connectionRetryTimeout", DEFAULTS.connectionRetryTimeout.default);
2245
2246
  this.body = body;
2246
2247
  this.method = method;
2247
2248
  this.endpoint = endpoint;
@@ -2256,15 +2257,18 @@ var WebDriverRequest = class {
2256
2257
  (_b = (_a = this.eventHandler).onRequest) == null ? void 0 : _b.call(_a, requestOptions);
2257
2258
  return this._request(url, requestOptions, options.transformResponse, options.connectionRetryCount, 0);
2258
2259
  }
2260
+ createAbortSignal(signal) {
2261
+ return AbortSignal.any([
2262
+ AbortSignal.timeout(this.connectionRetryTimeout),
2263
+ ...signal ? [signal] : []
2264
+ ]);
2265
+ }
2259
2266
  async createOptions(options, sessionId, isBrowser = false) {
2260
- const timeout = options.connectionRetryTimeout || DEFAULTS.connectionRetryTimeout.default;
2267
+ this.connectionRetryTimeout = options.connectionRetryTimeout || DEFAULTS.connectionRetryTimeout.default;
2261
2268
  const requestOptions = {
2262
2269
  method: this.method,
2263
2270
  redirect: "follow",
2264
- signal: AbortSignal.any([
2265
- AbortSignal.timeout(timeout),
2266
- ...this.abortSignal ? [this.abortSignal] : []
2267
- ])
2271
+ signal: this.abortSignal
2268
2272
  };
2269
2273
  const requestHeaders = new Headers({
2270
2274
  ...DEFAULT_HEADERS,
@@ -2332,7 +2336,10 @@ var WebDriverRequest = class {
2332
2336
  if (loggableBody && hasLoggableBody(loggableBody)) {
2333
2337
  (_b = (_a = this.eventHandler).onLogData) == null ? void 0 : _b.call(_a, loggableBody);
2334
2338
  }
2335
- const { ...requestLibOptions } = fullRequestOptions;
2339
+ const requestLibOptions = {
2340
+ ...fullRequestOptions,
2341
+ signal: this.createAbortSignal(fullRequestOptions.signal)
2342
+ };
2336
2343
  const startTime = performance.now();
2337
2344
  let response = await this._libRequest(url, requestLibOptions).catch((err) => err);
2338
2345
  const durationMillisecond = performance.now() - startTime;
package/build/node.js CHANGED
@@ -210,8 +210,7 @@ var DEFAULTS = {
210
210
  * when attempting to start a session.
211
211
  */
212
212
  cacheDir: {
213
- type: "string",
214
- default: environment.value.variables.WEBDRIVER_CACHE_DIR
213
+ type: "string"
215
214
  },
216
215
  /**
217
216
  * Mask sensitive data in logs by replacing matching string or all captured groups for the provided regular expressions as string
@@ -2004,10 +2003,11 @@ var WebDriverRequestError = class extends WebDriverError {
2004
2003
  super(message);
2005
2004
  this.url = url;
2006
2005
  this.opts = opts;
2007
- 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;
2006
+ const isAbortTimeout = err.name === "TimeoutError";
2007
+ 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 : isAbortTimeout ? "ETIMEDOUT" : void 0;
2008
2008
  if (errorCode) {
2009
2009
  this.code = errorCode;
2010
- this.message = errorCode === "UND_ERR_CONNECT_TIMEOUT" ? 'Request timed out! Consider increasing the "connectionRetryTimeout" option.' : "Request failed with error code " + errorCode;
2010
+ this.message = errorCode === "UND_ERR_CONNECT_TIMEOUT" || isAbortTimeout ? 'Request timed out! Consider increasing the "connectionRetryTimeout" option.' : "Request failed with error code " + errorCode;
2011
2011
  }
2012
2012
  if (typeof err.cause === "object" && err.cause) {
2013
2013
  this.statusCode = "statusCode" in err.cause && typeof err.cause.statusCode === "number" ? err.cause.statusCode : void 0;
@@ -2044,7 +2044,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
2044
2044
  // package.json
2045
2045
  var package_default = {
2046
2046
  name: "webdriver",
2047
- version: "9.30.0",
2047
+ version: "9.31.0",
2048
2048
  description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
2049
2049
  author: "Christian Bromann <mail@bromann.dev>",
2050
2050
  homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
@@ -2171,6 +2171,7 @@ var WebDriverRequest = class {
2171
2171
  requiresSessionId;
2172
2172
  eventHandler;
2173
2173
  abortSignal;
2174
+ connectionRetryTimeout = DEFAULTS.connectionRetryTimeout.default;
2174
2175
  constructor(method, endpoint, body, abortSignal, isHubCommand = false, eventHandler = {}) {
2175
2176
  this.body = body;
2176
2177
  this.method = method;
@@ -2185,15 +2186,18 @@ var WebDriverRequest = class {
2185
2186
  this.eventHandler.onRequest?.(requestOptions);
2186
2187
  return this._request(url, requestOptions, options.transformResponse, options.connectionRetryCount, 0);
2187
2188
  }
2189
+ createAbortSignal(signal) {
2190
+ return AbortSignal.any([
2191
+ AbortSignal.timeout(this.connectionRetryTimeout),
2192
+ ...signal ? [signal] : []
2193
+ ]);
2194
+ }
2188
2195
  async createOptions(options, sessionId, isBrowser = false) {
2189
- const timeout = options.connectionRetryTimeout || DEFAULTS.connectionRetryTimeout.default;
2196
+ this.connectionRetryTimeout = options.connectionRetryTimeout || DEFAULTS.connectionRetryTimeout.default;
2190
2197
  const requestOptions = {
2191
2198
  method: this.method,
2192
2199
  redirect: "follow",
2193
- signal: AbortSignal.any([
2194
- AbortSignal.timeout(timeout),
2195
- ...this.abortSignal ? [this.abortSignal] : []
2196
- ])
2200
+ signal: this.abortSignal
2197
2201
  };
2198
2202
  const requestHeaders = new Headers({
2199
2203
  ...DEFAULT_HEADERS,
@@ -2260,7 +2264,10 @@ var WebDriverRequest = class {
2260
2264
  if (loggableBody && hasLoggableBody(loggableBody)) {
2261
2265
  this.eventHandler.onLogData?.(loggableBody);
2262
2266
  }
2263
- const { ...requestLibOptions } = fullRequestOptions;
2267
+ const requestLibOptions = {
2268
+ ...fullRequestOptions,
2269
+ signal: this.createAbortSignal(fullRequestOptions.signal)
2270
+ };
2264
2271
  const startTime = performance.now();
2265
2272
  let response = await this._libRequest(url, requestLibOptions).catch((err) => err);
2266
2273
  const durationMillisecond = performance.now() - startTime;
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/request/error.ts"],"names":[],"mappings":"AAIA,uBAAe,cAAe,SAAQ,KAAK;;IACvC,QAAQ,CAAC,GAAG,EAAE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D9D"}
@@ -10,8 +10,10 @@ export declare abstract class WebDriverRequest {
10
10
  requiresSessionId: boolean;
11
11
  eventHandler: RequestEventHandler;
12
12
  abortSignal?: AbortSignal;
13
+ connectionRetryTimeout: number;
13
14
  constructor(method: string, endpoint: string, body?: Record<string, unknown>, abortSignal?: AbortSignal, isHubCommand?: boolean, eventHandler?: RequestEventHandler);
14
15
  makeRequest(options: RequestOptions, sessionId?: string): Promise<WebDriverResponse<unknown>>;
16
+ private createAbortSignal;
15
17
  createOptions(options: RequestOptions, sessionId?: string, isBrowser?: boolean): Promise<{
16
18
  url: URL;
17
19
  requestOptions: RequestInit;
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAM5G,OAAO,eAAe,CAAA;AA+CtB,8BAAsB,gBAAgB;IAClC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAExE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,YAAY,EAAE,mBAAmB,CAAA;IACjC,WAAW,CAAC,EAAE,WAAW,CAAA;gBAErB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,WAAW,CAAC,EAAE,WAAW,EACzB,YAAY,GAAE,OAAe,EAC7B,YAAY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A;IACjC,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,sBAAsB,SAA2C;gBAE7D,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,WAAW,CAAC,EAAE,WAAW,EACzB,YAAY,GAAE,OAAe,EAC7B,YAAY,GAAE,mBAAwB;IAWpC,WAAW,CAAE,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM;IAM9D,OAAO,CAAC,iBAAiB;IAOnB,aAAa,CAAE,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,cAAc,EAAE,WAAW,CAAC;KAAE,CAAC;cA0DlI,WAAW,CAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAiBhF,aAAa;cAiBX,QAAQ,CACpB,GAAG,EAAE,GAAG,EACR,kBAAkB,EAAE,WAAW,EAC/B,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,KAAK,kBAAkB,EACrG,eAAe,SAAI,EACnB,UAAU,SAAI,GACf,OAAO,CAAC,iBAAiB,CAAC;CAsIhC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webdriver",
3
- "version": "9.30.1",
3
+ "version": "9.31.1",
4
4
  "description": "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
@@ -38,15 +38,15 @@
38
38
  "dependencies": {
39
39
  "@types/node": "^20.1.0",
40
40
  "@types/ws": "^8.5.3",
41
- "@wdio/config": "9.30.1",
41
+ "@wdio/config": "9.31.1",
42
42
  "@wdio/logger": "9.29.1",
43
- "@wdio/protocols": "9.30.1",
44
- "@wdio/types": "9.30.1",
45
- "@wdio/utils": "9.30.1",
43
+ "@wdio/protocols": "9.31.1",
44
+ "@wdio/types": "9.31.1",
45
+ "@wdio/utils": "9.31.1",
46
46
  "deepmerge-ts": "^7.0.3",
47
47
  "https-proxy-agent": "^7.0.6",
48
48
  "undici": "^6.27.0",
49
49
  "ws": "^8.21.0"
50
50
  },
51
- "gitHead": "2ea7c6945a5ec1fa0edd89fe7d3f821dc29201d8"
51
+ "gitHead": "c766850846f7ac91cd6cd1d2cd979fbb8a6e8daf"
52
52
  }