var p = require("p");
var ChromeProfile = require("chrome-profile");
var createChromeProfile = function(settingsMap) {
var deferred = p.defer();
var chromeProfile = new ChromeProfile();
for (var k in settingsMap) {
chromeProfile.setSetting(k, settingsMap[k]);
};
chromeProfile.encoded(function (encodedConfig) {
var capabilities = {
browserName: "chrome",
directConnect: true,
chrome_profile: encodedConfig
};
deferred.resolve(capabilities);
});
return deferred.promise;
};
exports.config = {
specs:specs,
getMultiCapabilities: function() {
return p.all([
createChromeProfile(
{
"browser.download.folderList": 2,
"browser.download.dir": "/path/to/save/downloads",
"browser.helperApps.neverAsk.saveToDisk": "application/zip"
}
)
]);
},
// ...
}
An error has occurred with the message below:
ERROR - failed loading configuration file protractor.conf.js /usr/local/lib/node_modules/protractor/lib/configParser.js:183 throw e; ^ Error: Cannot find module 'p'
Kindly provide your suggestions to resolve this problem.