Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
driver.session(capabilities, function*(error, browser){
if(error){
console.log(__('chrome_init_failed').red);
console.log(error);
if(/unable to connect to renderer/.test(error)){
console.log(__('localhost_hosts_tip').red);
}
chromedriver.kill();
chromedriver.on('close', function(){
process.exit(1);
});
}
else{
yield browser.config({
asyncScriptTimeout: 10000
});
yield callback(this);
}
}).catch(function(e){});
}