Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

How to pass complex params to protractor from command line? #51

Closed
dmitry-dedukhin opened this issue Apr 7, 2014 · 4 comments
Closed

Comments

@dmitry-dedukhin
Copy link

Hi!

In the readme I can see

options.args

Type: Object Default value: {}

Arguments passed to the command. These arguments can also be supplied via command-line too.

But I can't figure out how I can pass complex params from command line, e.g. this

grunt protractor --params.someParam=someVal

doesn't work as expected.

@Smolations
Copy link

I agree that it is unclear how to pass objects on the command line. The only example in the README shows how to pass a spec file, which is a string. Please add an example of how to pass objects on the command line. Specifically, I am having an issue passing the params I want. I have tried many things:

--params='{ location: { href: "http://localhost:3030/" } }'
--params='{ location: { href: \"http://localhost:3030/\" } }'
--params={location:{href:"http://localhost:3030/"}}
--params='{location:{href:"http://localhost:3030/"}}'
--params.location.href "http://localhost:3030/"
--params.location.href http://localhost:3030/
--params.location.href=http://localhost:3030/

None of them work, and no errors are thrown.

@ciekawy
Copy link

ciekawy commented Feb 11, 2015

after looking into the code it looks like objectArgs are curently not supported via command line

@joaoffalcao
Copy link

Anyone of you already find out how to do it?

@teerapap
Copy link
Owner

teerapap commented May 7, 2016

Current behaviour is you need to pass escaped JSON object string for --params. (Sorry for unclear README.md)
Please try this

--params='{ "location":"some url" }'

If you want --params.location.xxx behaviour, please join the discussion in #148

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants