Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get command line arg before executing tests? #89

Open
DallasEpperson opened this issue Mar 1, 2019 · 1 comment
Open

How to get command line arg before executing tests? #89

DallasEpperson opened this issue Mar 1, 2019 · 1 comment

Comments

@DallasEpperson
Copy link

I need to pass in something like --environment "qa". Then I need to use this value to determine which variables to pull in from my ./shared-objects/environment.js file. I was hoping I could pull in CLI arguments from within this.BeforeFeatures but I can't. Any ideas? Any help at all would be appreciated.

@itjstagame
Copy link

I had this same problem and the only thought I had was to update my files directly.
So I created a shared/config.js to provide shared options, in my case just baseUrl.

I'm using Jenkins to run this, so I scripted something to the effect of:
sed -i -r -e "s|(baseUrl: )[^\n]|\1'$URL'|g" shared/config.js

This will update config.js to use the $URL which I generate based on my environment.

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

No branches or pull requests

2 participants