webdriver 5.8.3 → 5.9.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
@@ -43,6 +43,10 @@ var _chromium = _interopRequireDefault(require("../protocol/chromium.json"));
43
43
 
44
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
45
45
 
46
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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
+
46
50
  class WebDriver {
47
51
  static async newSession(options = {}, modifier, userPrototype = {}, commandWrapper) {
48
52
  const params = (0, _config.validateConfig)(_constants.DEFAULTS, options);
@@ -122,10 +126,8 @@ class WebDriver {
122
126
  };
123
127
  const protocolCommands = (0, _utils.getPrototype)({
124
128
  isW3C,
125
- isMobile,
126
- isIOS,
127
- isAndroid,
128
129
  isChrome,
130
+ isMobile,
129
131
  isSauce
130
132
  });
131
133
  const prototype = (0, _lodash.default)(protocolCommands, environmentFlags, userPrototype);
@@ -145,8 +147,8 @@ class WebDriver {
145
147
  _logger.default.setLevel('webdriver', options.logLevel);
146
148
 
147
149
  options.capabilities = options.capabilities || {};
148
- options.isW3C = options.isW3C || true;
149
- const prototype = Object.assign((0, _utils.getPrototype)(options.isW3C), userPrototype);
150
+ options.isW3C = options.isW3C === false ? false : true;
151
+ const prototype = Object.assign((0, _utils.getPrototype)(_objectSpread({}, options)), userPrototype);
150
152
  const monad = (0, _monad.default)(options, modifier, prototype);
151
153
  return monad(options.sessionId, commandWrapper);
152
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webdriver",
3
- "version": "5.8.3",
3
+ "version": "5.9.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",
@@ -30,11 +30,11 @@
30
30
  "url": "https://github.com/webdriverio/webdriverio/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@wdio/config": "^5.8.1",
34
- "@wdio/logger": "^5.8.0",
33
+ "@wdio/config": "^5.9.1",
34
+ "@wdio/logger": "^5.9.0",
35
35
  "deepmerge": "^2.0.1",
36
36
  "lodash.merge": "^4.6.1",
37
37
  "request": "^2.83.0"
38
38
  },
39
- "gitHead": "01b502cf4925e6938c574da5b5f8da1dbc197162"
39
+ "gitHead": "575883b611fde854fae80830e91417d88838aa50"
40
40
  }
@@ -541,7 +541,7 @@
541
541
  }
542
542
  },
543
543
  "/session/:sessionId/appium/device/app_state": {
544
- "GET": {
544
+ "POST": {
545
545
  "command": "queryAppState",
546
546
  "description": "Get the given app status on the device",
547
547
  "ref": "http://appium.io/docs/en/commands/device/app/app-state/",
@@ -273,7 +273,7 @@
273
273
  },
274
274
  "/session/:sessionId/window/current/size": {
275
275
  "GET": {
276
- "command": "getWindowSize",
276
+ "command": "_getWindowSize",
277
277
  "description": "Get the size of the current focused window.",
278
278
  "ref": "https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidwindowwindowhandlesize",
279
279
  "parameters": [],
package/webdriver.d.ts CHANGED
@@ -210,6 +210,7 @@ declare namespace WebDriver {
210
210
 
211
211
  // Appium
212
212
  deviceName?: string;
213
+ automationName?: string;
213
214
  platformVersion?: string;
214
215
  app?: string;
215
216
  udid?: string;
@@ -232,6 +233,11 @@ declare namespace WebDriver {
232
233
  key?: string;
233
234
  }
234
235
 
236
+ interface AttachSessionOptions extends Options {
237
+ sessionId: string,
238
+ isW3C?: boolean
239
+ }
240
+
235
241
  function newSession(
236
242
  options?: Options,
237
243
  modifier?: (...args: any[]) => any,
@@ -239,6 +245,13 @@ declare namespace WebDriver {
239
245
  commandWrapper?: (commandName: string, fn: (...args: any[]) => any) => any
240
246
  ): Promise<Client>;
241
247
 
248
+ function attachToSession(
249
+ options: AttachSessionOptions,
250
+ modifier?: (...args: any[]) => any,
251
+ proto?: object,
252
+ commandWrapper?: (commandName: string, fn: (...args: any[]) => any) => any
253
+ ): Promise<Client>;
254
+
242
255
  interface ClientOptions {
243
256
  capabilities: DesiredCapabilities;
244
257
  isW3C: boolean;
@@ -395,7 +408,7 @@ declare namespace WebDriver {
395
408
  switchToParentFrame(): void;
396
409
  getWindowPosition(): object;
397
410
  setWindowPosition(x: number, y: number): object;
398
- getWindowSize(): object;
411
+ _getWindowSize(): object;
399
412
  _setWindowSize(width: number, height: number): void;
400
413
  maximizeWindow(): void;
401
414
  findElement(using: string, value: string): string;