Reputation: 1226
I am new to protractor testing tool in angular js, I installed CORS extension in chrome browser, I wrote my first test-case, I try to run this using 'protractor config.js' chrome browser is getting open, actually it is login form, i entered correct username and password but it is not connecting to server, I understood that CORS extension was disabled, how to enable cors extension when i am running test case through cmd.
my config.js
exports.config = {
capabilities: {
// You can use other browsers
// like firefox, phantoms, safari, IE (-_-)
'browserName': 'chrome'
},
specs: [
// We are going to make this file in a minute
'../www/modules/user/login.spec.js',
//'../www/modules/lead/list.spec.js',
],
jasmineNodeOpts: {
showColors: true,
//defaultTimeoutInterval: 30000,
isVerbose: true,
},
allScriptsTimeout: 20000,
onPrepare: function(){
browser.driver.get('http://localhost:8100/');
}
};
Upvotes: 3
Views: 2319
Reputation: 1226
just change capabilities section. or u can follow alexe answer.
capabilities: {
// You can use other browsers
// like firefox, phantoms, safari, IE (-_-)
'browserName': 'chrome',
chromeOptions': { 'args': ['--disable-web-security'] }
},
Upvotes: 1
Reputation: 474201
By default, a completely clean browser is fired up with no extensions installed.
In order to start Chrome with an extension, you need to set the chromeOptions
and the extensions
appropriately. Here you can find working samples:
Upvotes: 3