-
Notifications
You must be signed in to change notification settings - Fork 123
It seems grunt protractor runner cannot support params well #121
Comments
Hi!
and you can access parameters in your specs like . browser.params.fieldName |
What puzzled me is I want to pass the parameters from the command line because the params is given by other modules. |
I donot like to use parameters from command line because it can mess up. I just pass command grunt and it fetches all parameters from my config-params.json and populates my specs with required data. config-param.json |
It will be ok if you just need to load the config from one file. However, my challenge is set up a server and there will be more than one task running currently, so I need to generate more than one config file and load these config files respectively. Emm... I don't think it's fun. |
we are passing the browser and environments we want to run the protractor tests against, Since there are multiple environments we need to run against, we cant have them in simple json. is there any kind of feature where we can simply pass the protractor cmd line arguments from grunt? |
Current behaviour is you need to pass escaped JSON object string for --params. (Sorry for unclear README.md)
If you want |
When using protractor I can pass parameters by adding something like this: --params.key1=value1
Unfortunately it doesn't work for protractor runner.
To solve the problem I add some code into the protrotractor_runner.js, and now it's OK for the moment
//Add params command line support
var cargs = grunt.option.flags();
cargs.forEach(function(a){
if (a.indexOf('--params') ==0){
args.push(a);
}
})
I hope this feature could be added.
The text was updated successfully, but these errors were encountered: