Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

reading configuration parameters from the configuration file #102

Closed
vishalshivnath opened this issue Sep 23, 2013 · 10 comments
Closed

reading configuration parameters from the configuration file #102

vishalshivnath opened this issue Sep 23, 2013 · 10 comments

Comments

@vishalshivnath
Copy link

I am trying to set some configuration parameters in configuraiton file and reading the same in my protractorjs file. As per my understanding I can set the config parameters in conf.js file. But i am trying to read the same in my protractor js file. Can you tell me how to read or which function to call to read these parameters. Some sample code snippet would be helpful

@juliemr
Copy link
Member

juliemr commented Sep 24, 2013

The configuration file is set up to configure how Protractor runs. Maybe you're asking about something like this: #32 ? That feature request is in the pipes.

@vishalshivnath
Copy link
Author

Yes , I am looking for the somewhat similar thing. Will it be available in future release

@juliemr
Copy link
Member

juliemr commented Sep 24, 2013

Yes, it should be done in the next major release.

@juliemr juliemr closed this as completed Sep 24, 2013
@nithyanatesan
Copy link

is this available now?

@juliemr
Copy link
Member

juliemr commented Mar 11, 2014

Yes, you can use command line flags to change the configuration.

@nithyanatesan
Copy link

so can i read and reference any of the config parameters/value in my test.js file for instance? If so, how do I do that?

@juliemr
Copy link
Member

juliemr commented Mar 11, 2014

Run just protractor to see some of the command line options. The options will be parsed (using the optimist module) and merged in with the configuration from your config file.

@nithyanatesan
Copy link

Got it, thanks! I am using process.argv (http://nodejs.org/docs/latest/api/process.html#process_process_argv) to capture these command line params back into my test.js file.

@zahafyou
Copy link

HOW DID YOU DO ? an example code please nithyanatesan

@djom202
Copy link

djom202 commented Aug 29, 2018

Hi @juliemr ,

I have a similar question, I need to access for the cucumberOptions to know if the tests are running on dry-run on the protractor hooks, is it possible?

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

No branches or pull requests

5 participants