Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { iosCommands, IOSPerformanceLog, NATIVE_WIN, WEBVIEW_WIN } from 'appium-ios-driver';
import { createRemoteDebugger, RemoteDebugger } from 'appium-remote-debugger';
import { errors, isErrorType } from 'appium-base-driver';
import { util, timing } from 'appium-support';
import log from '../logger';
import { retryInterval } from 'asyncbox';
import _ from 'lodash';
const WEBVIEW_BASE = `${WEBVIEW_WIN}_`;
let commands = {}, helpers = {}, extensions = {};
Object.assign(extensions, iosCommands.context);
// override, as appium-ios-driver's version uses UI Automation to close
extensions.closeAlertBeforeTest = async function closeAlertBeforeTest () { // eslint-disable-line require-await
return true;
};
// the appium-ios-driver version has a wait on real devices, which is no longer
// necessary
extensions.navToInitialWebview = async function navToInitialWebview () {
if (this.useNewSafari()) {
await this.typeAndNavToUrl();
} else if (!this.isRealDevice() && this.opts.safari) {
await this.navToViewThroughFavorites();
} else {
await this.navToViewWithTitle(/.*/);
}
extensions.isWebContext = function isWebContext () {
return !!this.curContext && this.curContext !== iosCommands.context.NATIVE_WIN;
};