Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const setupNewAndroidDriver = async (caps) => {
const androidArgs = {
javascriptEnabled: true,
};
const androiddriver = new AndroidDriver(androidArgs);
const capsCopy = Object.assign({}, caps, { newCommandTimeout: 0 });
await androiddriver.createSession(capsCopy);
return androiddriver;
};
const androidAppium = async (config) => {
let defaultCaps = {
app: config.app,
deviceName: config.deviceName,
platformName: config.platformName,
automationName: 'uiautomator2'
};
let driver = new AndroidUiautomator2Driver();
await driver.createSession(defaultCaps);
}