I am writing a web application that depends heavily on geolocation. I am using chimpjs (combination of cucumber, webdriverio, chai) to do my BDD. I would like to launch google chrome with geolocation allowed. I think I must do this because I can find no way to click the Allow button in chrome to allow geolocation.
I have a chimp.js config file in my cucumber directory. Here are its contents:
module.exports = {
webdriverio: {
desiredCapabilities: {
chromeOptions: {
deviceName: 'Google Nexus 5'
}
}
},
browser: 'chrome',
watch: false,
path: './features',
chai: true,
screenshotsPath: '.screenshots'
};
I know that:
- chrome uses profile information that may be provided around runtime
- there is an option 'geolocation' which must be set to 1
- some other relevant nesting are 'prefs' and 'default_content_setting_values', which I learned about from digging through my chrome preferences
What I cannot figure out is which among these need to be passed to chromeOptions, and what needs to be nested where.
I am sure I cannot be the only person who ever needed to launch chrome with webdriver and have geolocation enabled.