Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { errors } from 'appium-base-driver';
import { util } from 'appium-support';
import { iosCommands } from 'appium-ios-driver';
import _ from 'lodash';
import log from '../logger';
let helpers = {}, extensions = {}, commands = {};
commands.moveTo = iosCommands.gesture.moveTo;
commands.mobileShake = async function mobileShake () {
if (!this.isSimulator()) {
throw new errors.UnknownError('Shake is not supported on real devices');
}
await this.opts.device.shake();
};
commands.click = async function click (el) {
if (!this.isWebContext()) {
// there are multiple commands that map here, so manually proxy
return await this.nativeClick(el);
}
el = util.unwrapElement(el);
if ((await this.settings.getSettings()).nativeWebTap) {
// atoms-based clicks don't always work in safari 7