webdriver 7.16.9 → 7.16.11
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/constants.d.ts +4 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +5 -1
- package/build/request/index.d.ts.map +1 -1
- package/build/request/index.js +2 -1
- package/build/utils.d.ts +4 -0
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +34 -1
- package/package.json +5 -5
package/build/constants.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { Options } from '@wdio/types';
|
|
2
2
|
export declare const DEFAULTS: Options.Definition<Required<Options.WebDriver>>;
|
|
3
3
|
export declare const VALID_CAPS: string[];
|
|
4
|
+
export declare const REG_EXPS: {
|
|
5
|
+
commandName: RegExp;
|
|
6
|
+
execFn: RegExp;
|
|
7
|
+
};
|
|
4
8
|
//# sourceMappingURL=constants.d.ts.map
|
package/build/constants.d.ts.map
CHANGED
|
@@ -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;AAE1C,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAiJpE,CAAA;AAED,eAAO,MAAM,UAAU,UAItB,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAiJpE,CAAA;AAED,eAAO,MAAM,UAAU,UAItB,CAAA;AAED,eAAO,MAAM,QAAQ;;;CAGpB,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VALID_CAPS = exports.DEFAULTS = void 0;
|
|
3
|
+
exports.REG_EXPS = exports.VALID_CAPS = exports.DEFAULTS = void 0;
|
|
4
4
|
exports.DEFAULTS = {
|
|
5
5
|
/**
|
|
6
6
|
* protocol of automation driver
|
|
@@ -151,3 +151,7 @@ exports.VALID_CAPS = [
|
|
|
151
151
|
'pageLoadStrategy', 'proxy', 'setWindowRect', 'timeouts', 'strictFileInteractability',
|
|
152
152
|
'unhandledPromptBehavior'
|
|
153
153
|
];
|
|
154
|
+
exports.REG_EXPS = {
|
|
155
|
+
commandName: /.*\/session\/[0-9a-f-]+\/(.*)/,
|
|
156
|
+
execFn: /return \(([\s\S]*)\)\.apply\(null, arguments\)/
|
|
157
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAK9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAM1C,aAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AAC5B,aAAK,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAA;AAClD,aAAK,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;AACpD,aAAK,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;AAE7D,qBAAa,eAAgB,SAAQ,KAAK;IACtC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KA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c,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,GAAG,iBAAiB;cAiErG,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAIhF,QAAQ;CA8GzB"}
|
package/build/request/index.js
CHANGED
|
@@ -144,7 +144,8 @@ class WebDriverRequest extends events_1.EventEmitter {
|
|
|
144
144
|
* handle timeouts
|
|
145
145
|
*/
|
|
146
146
|
if (response.code === 'ETIMEDOUT') {
|
|
147
|
-
|
|
147
|
+
const error = (0, utils_2.getTimeoutError)(response, fullRequestOptions);
|
|
148
|
+
return retry(error, 'Request timed out! Consider increasing the "connectionRetryTimeout" option.');
|
|
148
149
|
}
|
|
149
150
|
/**
|
|
150
151
|
* throw if request error is unknown
|
package/build/utils.d.ts
CHANGED
|
@@ -65,4 +65,8 @@ export declare function getEnvironmentVars({ isW3C, isMobile, isIOS, isAndroid,
|
|
|
65
65
|
* @param {Error} err response error
|
|
66
66
|
*/
|
|
67
67
|
export declare const getSessionError: (err: JSONWPCommandError, params?: Partial<Options.WebDriver>) => string;
|
|
68
|
+
/**
|
|
69
|
+
* return timeout error with information about the executing command on which the test hangs
|
|
70
|
+
*/
|
|
71
|
+
export declare const getTimeoutError: (error: Error, requestOptions: Options.RequestLibOptions) => Error;
|
|
68
72
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MA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) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSessionError = exports.getEnvironmentVars = exports.CustomRequestError = exports.getErrorFromResponseBody = exports.getPrototype = exports.isSuccessfulResponse = exports.startWebDriverSession = void 0;
|
|
6
|
+
exports.getTimeoutError = exports.getSessionError = exports.getEnvironmentVars = exports.CustomRequestError = exports.getErrorFromResponseBody = exports.getPrototype = exports.isSuccessfulResponse = exports.startWebDriverSession = void 0;
|
|
7
7
|
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
8
|
const logger_1 = __importDefault(require("@wdio/logger"));
|
|
9
9
|
const protocols_1 = require("@wdio/protocols");
|
|
10
10
|
const factory_1 = __importDefault(require("./request/factory"));
|
|
11
11
|
const command_1 = __importDefault(require("./command"));
|
|
12
|
+
const utils_1 = require("@wdio/utils");
|
|
12
13
|
const constants_1 = require("./constants");
|
|
13
14
|
const log = (0, logger_1.default)('webdriver');
|
|
14
15
|
const BROWSER_DRIVER_ERRORS = [
|
|
@@ -283,3 +284,35 @@ const getSessionError = (err, params = {}) => {
|
|
|
283
284
|
return err.message;
|
|
284
285
|
};
|
|
285
286
|
exports.getSessionError = getSessionError;
|
|
287
|
+
/**
|
|
288
|
+
* return timeout error with information about the executing command on which the test hangs
|
|
289
|
+
*/
|
|
290
|
+
const getTimeoutError = (error, requestOptions) => {
|
|
291
|
+
const cmdName = getExecCmdName(requestOptions);
|
|
292
|
+
const cmdArgs = getExecCmdArgs(requestOptions);
|
|
293
|
+
const cmdInfoMsg = `when running "${cmdName}" with method "${requestOptions.method}"`;
|
|
294
|
+
const cmdArgsMsg = cmdArgs ? ` and args ${cmdArgs}` : '';
|
|
295
|
+
const timeoutErr = new Error(`${error.message} ${cmdInfoMsg}${cmdArgsMsg}`);
|
|
296
|
+
return Object.assign(timeoutErr, error);
|
|
297
|
+
};
|
|
298
|
+
exports.getTimeoutError = getTimeoutError;
|
|
299
|
+
function getExecCmdName(requestOptions) {
|
|
300
|
+
const { href } = requestOptions.url;
|
|
301
|
+
const res = href.match(constants_1.REG_EXPS.commandName) || [];
|
|
302
|
+
return res[1] || href;
|
|
303
|
+
}
|
|
304
|
+
function getExecCmdArgs(requestOptions) {
|
|
305
|
+
const { json: cmdJson } = requestOptions;
|
|
306
|
+
if (typeof cmdJson !== 'object') {
|
|
307
|
+
return '';
|
|
308
|
+
}
|
|
309
|
+
const transformedRes = (0, utils_1.transformCommandLogResult)(cmdJson);
|
|
310
|
+
if (typeof transformedRes === 'string') {
|
|
311
|
+
return transformedRes;
|
|
312
|
+
}
|
|
313
|
+
if (typeof cmdJson.script === 'string') {
|
|
314
|
+
const scriptRes = cmdJson.script.match(constants_1.REG_EXPS.execFn) || [];
|
|
315
|
+
return `"${scriptRes[1] || cmdJson.script}"`;
|
|
316
|
+
}
|
|
317
|
+
return Object.keys(cmdJson).length ? `"${JSON.stringify(cmdJson)}"` : '';
|
|
318
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriver",
|
|
3
|
-
"version": "7.16.
|
|
3
|
+
"version": "7.16.11",
|
|
4
4
|
"description": "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
|
|
5
5
|
"author": "Christian Bromann <christian@saucelabs.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@types/node": "^16.11.1",
|
|
29
|
-
"@wdio/config": "7.16.
|
|
29
|
+
"@wdio/config": "7.16.11",
|
|
30
30
|
"@wdio/logger": "7.16.0",
|
|
31
31
|
"@wdio/protocols": "7.16.7",
|
|
32
|
-
"@wdio/types": "7.16.
|
|
33
|
-
"@wdio/utils": "7.16.
|
|
32
|
+
"@wdio/types": "7.16.11",
|
|
33
|
+
"@wdio/utils": "7.16.11",
|
|
34
34
|
"got": "^11.0.2",
|
|
35
35
|
"ky": "^0.28.5",
|
|
36
36
|
"lodash.merge": "^4.6.1"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "7aa1d82a1590b47db444734dc86fae7bca1c777c"
|
|
39
39
|
}
|