webdriver 5.12.0 → 5.12.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/index.js CHANGED
@@ -41,6 +41,12 @@ var _chromium = _interopRequireDefault(require("../protocol/chromium.json"));
41
41
 
42
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
43
 
44
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
45
+
46
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
47
+
48
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
49
+
44
50
  class WebDriver {
45
51
  static async newSession(options = {}, modifier, userPrototype = {}, commandWrapper) {
46
52
  const params = (0, _config.validateConfig)(_constants.DEFAULTS, options);
@@ -66,10 +72,9 @@ class WebDriver {
66
72
  const environment = (0, _utils.environmentDetector)(params);
67
73
  const environmentPrototype = (0, _utils.getEnvironmentVars)(environment);
68
74
  const protocolCommands = (0, _utils.getPrototype)(environment);
69
- const prototype = { ...protocolCommands,
70
- ...environmentPrototype,
71
- ...userPrototype
72
- };
75
+
76
+ const prototype = _objectSpread({}, protocolCommands, {}, environmentPrototype, {}, userPrototype);
77
+
73
78
  const monad = (0, _monad.default)(params, modifier, prototype);
74
79
  return monad(response.value.sessionId || response.sessionId, commandWrapper);
75
80
  }
@@ -87,10 +92,9 @@ class WebDriver {
87
92
  options.isW3C = options.isW3C === false ? false : true;
88
93
  const environmentPrototype = (0, _utils.getEnvironmentVars)(options);
89
94
  const protocolCommands = (0, _utils.getPrototype)(options);
90
- const prototype = { ...protocolCommands,
91
- ...environmentPrototype,
92
- ...userPrototype
93
- };
95
+
96
+ const prototype = _objectSpread({}, protocolCommands, {}, environmentPrototype, {}, userPrototype);
97
+
94
98
  const monad = (0, _monad.default)(options, modifier, prototype);
95
99
  return monad(options.sessionId, commandWrapper);
96
100
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "webdriver",
3
- "version": "5.12.0",
3
+ "version": "5.12.1",
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/master/packages/webdriver",
7
7
  "license": "MIT",
8
8
  "main": "./build/index",
9
9
  "engines": {
10
- "node": ">= 10.13.0"
10
+ "node": ">= 8.11.0"
11
11
  },
12
12
  "types": "./webdriver.d.ts",
13
13
  "typeScriptVersion": "3.2.1",
@@ -30,11 +30,11 @@
30
30
  "url": "https://github.com/webdriverio/webdriverio/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@wdio/config": "^5.12.0",
34
- "@wdio/logger": "^5.12.0",
33
+ "@wdio/config": "^5.12.1",
34
+ "@wdio/logger": "^5.12.1",
35
35
  "deepmerge": "^4.0.0",
36
36
  "lodash.merge": "^4.6.1",
37
37
  "request": "^2.83.0"
38
38
  },
39
- "gitHead": "187c8f044e252877533e53ee2b645f56416d5a41"
39
+ "gitHead": "848151e5fdcb8b694c1a273b9b69852c22875687"
40
40
  }
@@ -1401,5 +1401,33 @@
1401
1401
  }
1402
1402
  }
1403
1403
  }
1404
+ },
1405
+ "/session/:sessionId/appium/execute_driver": {
1406
+ "POST": {
1407
+ "command": "driverScript",
1408
+ "description": "This command allows you to define a webdriverio script in a string and send it to the Appium server to be executed locally to the server itself, thus reducing latency that might otherwise occur along with each command.",
1409
+ "ref": "https://github.com/appium/appium/blob/master/docs/en/commands/session/execute-driver.md",
1410
+ "parameters": [{
1411
+ "name": "script",
1412
+ "type": "string",
1413
+ "description": "The script to execute. It has access to a 'driver' object which represents a webdriverio session attached to the current server.",
1414
+ "required": true
1415
+ }, {
1416
+ "name": "type",
1417
+ "type": "string",
1418
+ "description": "The language/framework used in the script. Currently, only 'webdriverio' is supported and is the default.",
1419
+ "required": false
1420
+ }, {
1421
+ "name": "timeout",
1422
+ "type": "number",
1423
+ "description": "The number of milliseconds the script should be allowed to run before being killed by the Appium server. Defaults to the equivalent of 1 hour.",
1424
+ "required": false
1425
+ }],
1426
+ "returns": {
1427
+ "type": "object",
1428
+ "name": "result",
1429
+ "description": "An object containing two fields: 'result', which is the return value of the script itself, and 'logs', which contains 3 inner fields, 'log', 'warn', and 'error', which hold an array of strings logged by console.log, console.warn, and console.error in the script's execution."
1430
+ }
1431
+ }
1404
1432
  }
1405
1433
  }
package/webdriver.d.ts CHANGED
@@ -561,6 +561,7 @@ declare namespace WebDriver {
561
561
  getClipboard(contentType?: string): string;
562
562
  touchPerform(actions: object[]): void;
563
563
  multiTouchPerform(actions: object[]): void;
564
+ driverScript(script: string, type?: string, timeout?: number): ProtocolCommandResponse;
564
565
  }
565
566
 
566
567
  // jsonwp types