dwyl / learn-nightwatch

:last_quarter_moon_with_face: Learn how to use Nightwatch.js to easily & automatically test your web apps in *real* web browsers.
584 stars 214 forks source link

Need help with - new clone of learn-nightwatch testing (npm ERR!) #56

Closed mushibugyo closed 7 years ago

mushibugyo commented 7 years ago

Hello Everyone, I was hoping to get some assistance. I am testing out nightwatch.js for the first time. I have created a new CentOS VM and installed all of the required components (node.js, java, etc). I then cloned the github learn-nightwatch repository and everything seems to have gone smoothly. However, after running "node nightwatch.conf.BASIC.js in order to download the selenium.jar file I run into an issue when I actually run the tests: npm test.

The attached snip contains the error:

npmerr

Additional information:

npm version = 4.1.2 node version = 7.6.0

Also, here's a snip using npm test --verbose

npmverbose1 npmverbose2

Any help with this matter is greatly appreciated!!

Cheers MB

naazy commented 7 years ago

Hi @mushibugyo What's the first line of your guineaPig.js? If it's var config = require('../../nightwatch.conf.js');, would you mind changing to var config = require('../../nightwatch.conf.BASIC.js'); and letting me know what you see when you run the command again? Thanks

mushibugyo commented 7 years ago

Heya @naazy here is a snip of the file itself:

guineapigcontents

Cheers MB

naazy commented 7 years ago

@mushibugyo Please could you try changing the first line to var config = require('../../nightwatch.conf.BASIC.js');

and try running the command again?

Thanks

mushibugyo commented 7 years ago

@naazy ... Similar error as before. Please see snips:

npmverbose1a npmverbose2a

Cheers MB

mushibugyo commented 7 years ago

Seems like there's another thread with a similar problem to my own: Issue 51.

naazy commented 7 years ago

@mushibugyo I've just tried cloning myself and running npm t and I get:

screen shot 2017-03-01 at 20 16 30

Have you literally just cloned? Or have any of the files been changed at all? Also your browser is Chrome right?

mushibugyo commented 7 years ago

@naazy It's a straight up clone. I also checked and after running the nightwatch.conf.BASIC.js the required selenium server as well as the chromedriver are both downloaded. The only thing I changed was to remove the one test from the e2e folder.

In regards to your own test which OS are you using?

naazy commented 7 years ago

@mushibugyo OS x el capitan.

When you run your tests, does it open up your browser at all?

mushibugyo commented 7 years ago

In order to duplicate my issue exactly try spinning up a VM with CentOS and then try a full clone again. Let me know what happens.

Cheers MB

mushibugyo commented 7 years ago

I had a chance to spin up an Ubuntu (16.04) VM and managed to get everything up and running. See snip below:

successubuntu

However, before this was up and functioning properly I used this script to install chrome webdriver + selenium server. Afterwards everything worked like a charm. Just a quick note if using that script ... the last part runs selenium-server via Xvfb. You need to stop the server before running "npm test". Just do a quick ps -aux | grep java. :)

Cheers MB

mushibugyo commented 7 years ago

I managed to get nightwatch up and running on CentOS by installing Gnome Desktop and running it from terminal via desktop.

suwarna-wade commented 7 years ago

@mushibugyo Hi I am getting same error as you had. But I want to run tests without UI. How can I do it?

CameronFraser commented 6 years ago

I have this same problem on windows. It only happens if i try to require something outside of module.exports, otherwise everything works fine.