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

Not using env files #29

Closed
jinky32 opened this issue Sep 12, 2016 · 9 comments
Closed

Not using env files #29

jinky32 opened this issue Sep 12, 2016 · 9 comments

Comments

@jinky32
Copy link

jinky32 commented Sep 12, 2016

Hi,

I used the quick version of the tutorial - cloning the repo locally etc. However when I try and run my tests I get an error:
WARNING: env2 was required to load an .env file: learn-nightwatch/.env NOT FOUND!

If I comment out the require('env2')('.env') at the top of the nightwatch.conf.js I still get an npm ERR! although it no longer mentions the missing file. However after i run the npm test command I can see that it's running nightwatch --env local.

How do I resolve this?

@nelsonic
Copy link
Member

@jinky32 thanks very much for reporting this issue (and helping us to improve our tutorial)!

First, can you give us a bit more info about your system: what Operating System are you using?

@nelsonic
Copy link
Member

I just tried the steps in the Quick-start:

git clone https://github.com/dwyl/learn-nightwatch.git 
cd learn-nightwatch
npm install
npm test

and get:
learn-nightwatch-quickstart

I'm running on a Mac but the experience should be the same on Linux/Windows...

@jinky32 if you can give as a bit more insight or even upload a screenshot we'd love to help you make progress! 👍

@jinky32
Copy link
Author

jinky32 commented Sep 13, 2016

@nelsonic thanks for the quick reply. I'm running Ubuntu 16. The below is what I get out of the box
screen shot 2016-09-13 at 8 54 22 am

If I modify package.json from "test": "./node_modules/.bin/nightwatch --env local", to "test": "./node_modules/.bin/nightwatch, and run I get
screen shot 2016-09-13 at 8 55 39 am

However if (with the modified package.json) I run node_modules/.bin/nightwatch rather than npm test then all good
screen shot 2016-09-13 at 8 56 28 am

@jinky32
Copy link
Author

jinky32 commented Sep 13, 2016

Hmm, actually I say all good, but I can't make the test fail. For example if i modify the github test to look for some other copy in the body no failure is reported

@nelsonic
Copy link
Member

@jinky32 this is very strange. 😕
We don't see a child process for coverageChecker on ours. what is that?
Has anything changed in your nightwatch.conf.js or either of /test/e2e/guineaPig.js or /test/e2e/github.js that requires starting such a child process?

@cepm-nate
Copy link
Contributor

cepm-nate commented Sep 13, 2016

I downloaded the git repo as a zip, extracted to "A:\vpubweb\testing", then ran the following commands in a terminal:
npm install
npm test
And this is the result of the "npm test" command:
image
I can see the chrome window show up, and the tests pass, but what's up with the env errors? This is on windows 10 x64.

EDIT: Following the directions on https://github.com/dwyl/env2#how, and now the error is gone. (Creating an .env file then installing env2) Perhaps this should be mentioned on the learn-nightwatch page?

@nelsonic
Copy link
Member

@cepm-nate Yeah, let's add a note in the Readme! 👍

@gaddamsridhar6
Copy link

How Do we Configure Different environments in VSTS for Running the Smoke tests in Dev env and Regression in QA env

@nelsonic
Copy link
Member

@gaddamsridhar6 this is a good question, worthy of a separate/new issue. 👍

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

No branches or pull requests

4 participants