Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
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;
};