How to use the appium-ios-driver.iosCommands.device function in appium-ios-driver

To help you get started, we’ve selected a few appium-ios-driver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-xcuitest-driver / lib / commands / general.js View on Github external
}
  let el = util.unwrapElement(await this.active());
  if (_.isEmpty(el)) {
    throw new errors.NoSuchElementError();
  }
  await this.setValue(keys, el);
};

commands.setUrl = async function setUrl (url) {
  if (!this.isWebContext() && this.isRealDevice()) {
    return await this.proxyCommand('/url', 'POST', {url});
  }
  return await iosCommands.general.setUrl.call(this, url);
};

commands.getViewportRect = iosCommands.device.getViewportRect;

// memoized in constructor
commands.getScreenInfo = async function getScreenInfo () {
  return await this.proxyCommand('/wda/screen', 'GET');
};

commands.getStatusBarHeight = async function getStatusBarHeight () {
  const {statusBarSize} = await this.getScreenInfo();
  return statusBarSize.height;
};

// memoized in constructor
commands.getDevicePixelRatio = async function getDevicePixelRatio () {
  const {scale} = await this.getScreenInfo();
  return scale;
};