webdriver 7.20.3 → 7.20.7
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/command.js +1 -1
- package/build/constants.d.ts +0 -1
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +1 -6
- package/build/request/index.js +1 -1
- package/build/utils.d.ts +2 -2
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +14 -5
- package/package.json +7 -7
package/build/command.js
CHANGED
|
@@ -79,7 +79,7 @@ function default_1(method, endpointUri, commandInfo, doubleEncodeVariables = fal
|
|
|
79
79
|
? `${result.value.substr(0, 61)}...` : result.value);
|
|
80
80
|
}
|
|
81
81
|
this.emit('result', { method, endpoint, body, result });
|
|
82
|
-
if (command === 'deleteSession') {
|
|
82
|
+
if (command === 'deleteSession' && !process.env.WDIO_WORKER_ID) {
|
|
83
83
|
logger_1.default.clearLogger();
|
|
84
84
|
}
|
|
85
85
|
return result.value;
|
package/build/constants.d.ts
CHANGED
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,CA0IpE,CAAA;AAED,eAAO,MAAM,
|
|
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,CA0IpE,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.REG_EXPS = exports.
|
|
3
|
+
exports.REG_EXPS = exports.DEFAULTS = void 0;
|
|
4
4
|
exports.DEFAULTS = {
|
|
5
5
|
/**
|
|
6
6
|
* protocol of automation driver
|
|
@@ -139,11 +139,6 @@ exports.DEFAULTS = {
|
|
|
139
139
|
default: true
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
exports.VALID_CAPS = [
|
|
143
|
-
'browserName', 'browserVersion', 'platformName', 'acceptInsecureCerts',
|
|
144
|
-
'pageLoadStrategy', 'proxy', 'setWindowRect', 'timeouts', 'strictFileInteractability',
|
|
145
|
-
'unhandledPromptBehavior'
|
|
146
|
-
];
|
|
147
142
|
exports.REG_EXPS = {
|
|
148
143
|
commandName: /.*\/session\/[0-9a-f-]+\/(.*)/,
|
|
149
144
|
execFn: /return \(([\s\S]*)\)\.apply\(null, arguments\)/
|
package/build/request/index.js
CHANGED
|
@@ -163,7 +163,7 @@ class WebDriverRequest extends events_1.EventEmitter {
|
|
|
163
163
|
if (typeof transformResponse === 'function') {
|
|
164
164
|
response = transformResponse(response, fullRequestOptions);
|
|
165
165
|
}
|
|
166
|
-
const error = (0, utils_2.getErrorFromResponseBody)(response.body);
|
|
166
|
+
const error = (0, utils_2.getErrorFromResponseBody)(response.body, fullRequestOptions.json);
|
|
167
167
|
/**
|
|
168
168
|
* retry connection refused errors
|
|
169
169
|
*/
|
package/build/utils.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export declare function getPrototype({ isW3C, isChrome, isFirefox, isMobile, isS
|
|
|
24
24
|
* @param {Object} body body object
|
|
25
25
|
* @return {Object} error
|
|
26
26
|
*/
|
|
27
|
-
export declare function getErrorFromResponseBody(body: any): Error;
|
|
27
|
+
export declare function getErrorFromResponseBody(body: any, requestOptions: any): Error;
|
|
28
28
|
export declare class CustomRequestError extends Error {
|
|
29
|
-
constructor(body: WebDriverResponse);
|
|
29
|
+
constructor(body: WebDriverResponse, requestOptions: any);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* return all supported flags and return them in a format so we can attach them
|
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,MAAM,aAAa,CAAA;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAWvE;;GAEG;AACH,wBAAsB,qBAAqB,CAAE,MAAM,EAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,YAAY,CAAC,mBAAmB,CAAA;CAAE,CAAC,CAmEtJ;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,WA4DlF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE,OAAO,CAAC,YAAY,CAAC,sCAyC3H;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAE,IAAI,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,SAcvE;AAGD,qBAAa,kBAAmB,SAAQ,KAAK;gBAC5B,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG;CAyB5D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;EAWlJ;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,QAmBhD;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAS,kBAAkB,WAAU,QAAQ,iBAAiB,CAAC,WAmD1F,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,UAAW,KAAK,kBAAkB,QAAQ,iBAAiB,KAAG,KASzF,CAAA"}
|
package/build/utils.js
CHANGED
|
@@ -10,6 +10,7 @@ const protocols_1 = require("@wdio/protocols");
|
|
|
10
10
|
const factory_1 = __importDefault(require("./request/factory"));
|
|
11
11
|
const command_1 = __importDefault(require("./command"));
|
|
12
12
|
const utils_1 = require("@wdio/utils");
|
|
13
|
+
const protocols_2 = require("@wdio/protocols");
|
|
13
14
|
const constants_1 = require("./constants");
|
|
14
15
|
const log = (0, logger_1.default)('webdriver');
|
|
15
16
|
const BROWSER_DRIVER_ERRORS = [
|
|
@@ -29,7 +30,7 @@ async function startWebDriverSession(params) {
|
|
|
29
30
|
if (params.capabilities) {
|
|
30
31
|
const extensionCaps = Object.keys(params.capabilities).filter((cap) => cap.includes(':'));
|
|
31
32
|
const invalidWebDriverCaps = Object.keys(params.capabilities)
|
|
32
|
-
.filter((cap) => !
|
|
33
|
+
.filter((cap) => !protocols_2.CAPABILITY_KEYS.includes(cap) && !cap.includes(':'));
|
|
33
34
|
/**
|
|
34
35
|
* if there are vendor extensions, e.g. sauce:options or appium:app
|
|
35
36
|
* used (only WebDriver compatible) and caps that aren't defined
|
|
@@ -184,7 +185,7 @@ exports.getPrototype = getPrototype;
|
|
|
184
185
|
* @param {Object} body body object
|
|
185
186
|
* @return {Object} error
|
|
186
187
|
*/
|
|
187
|
-
function getErrorFromResponseBody(body) {
|
|
188
|
+
function getErrorFromResponseBody(body, requestOptions) {
|
|
188
189
|
if (!body) {
|
|
189
190
|
return new Error('Response has empty body');
|
|
190
191
|
}
|
|
@@ -194,14 +195,22 @@ function getErrorFromResponseBody(body) {
|
|
|
194
195
|
if (typeof body !== 'object') {
|
|
195
196
|
return new Error('Unknown error');
|
|
196
197
|
}
|
|
197
|
-
return new CustomRequestError(body);
|
|
198
|
+
return new CustomRequestError(body, requestOptions);
|
|
198
199
|
}
|
|
199
200
|
exports.getErrorFromResponseBody = getErrorFromResponseBody;
|
|
200
201
|
//Exporting for testability
|
|
201
202
|
class CustomRequestError extends Error {
|
|
202
|
-
constructor(body) {
|
|
203
|
+
constructor(body, requestOptions) {
|
|
203
204
|
const errorObj = body.value || body;
|
|
204
|
-
|
|
205
|
+
let errorMessage = errorObj.message || errorObj.class || 'unknown error';
|
|
206
|
+
/**
|
|
207
|
+
* improve error message for Chrome and Safari on invalid selectors
|
|
208
|
+
*/
|
|
209
|
+
if (typeof errorObj.error === 'string' && errorObj.error.includes('invalid selector')) {
|
|
210
|
+
errorMessage = (`The selector "${requestOptions.value}" used with strategy "${requestOptions.using}" is invalid! ` +
|
|
211
|
+
'For more information on selectors visit the WebdriverIO docs at: https://webdriver.io/docs/selectors');
|
|
212
|
+
}
|
|
213
|
+
super(errorMessage);
|
|
205
214
|
if (errorObj.error) {
|
|
206
215
|
this.name = errorObj.error;
|
|
207
216
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriver",
|
|
3
|
-
"version": "7.20.
|
|
3
|
+
"version": "7.20.7",
|
|
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",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@types/node": "^18.0.0",
|
|
29
|
-
"@wdio/config": "7.20.
|
|
29
|
+
"@wdio/config": "7.20.7",
|
|
30
30
|
"@wdio/logger": "7.19.0",
|
|
31
|
-
"@wdio/protocols": "7.20.
|
|
32
|
-
"@wdio/types": "7.20.
|
|
33
|
-
"@wdio/utils": "7.20.
|
|
31
|
+
"@wdio/protocols": "7.20.6",
|
|
32
|
+
"@wdio/types": "7.20.7",
|
|
33
|
+
"@wdio/utils": "7.20.7",
|
|
34
34
|
"got": "^11.0.2",
|
|
35
|
-
"ky": "
|
|
35
|
+
"ky": "0.30.0",
|
|
36
36
|
"lodash.merge": "^4.6.1"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "21b8b61453f4749d87eca3e4d7d6e5e2cb60f043"
|
|
39
39
|
}
|