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

A bit confused by readme #37

Open
Conorc1000 opened this issue Oct 28, 2016 · 5 comments
Open

A bit confused by readme #37

Conorc1000 opened this issue Oct 28, 2016 · 5 comments
Assignees
Labels

Comments

@Conorc1000
Copy link
Contributor

Conorc1000 commented Oct 28, 2016

In this section we are told to add some code to the nightwatch.conf.js

Download Selenium (Web Driver) Standalone Server (Script)

Once you've downloaded the the selenium-download node module, put the following code at the bottom of your nightwatch.conf.js file:

require('selenium-download').ensure('./bin', function(error) {  
   if (error) {
     return console.log(error);
   } else {
     console.log('✔ Selenium & Chromedriver downloaded to:', './bin');
   }
});
We run include this script in our nightwatch.conf.js which checks for the existence of selenium.jar before trying to run our tests. You will create your nightwatch.conf.js file in the next step.

But I dont believe the code is require. It appear to already be in the file.

@nelsonic
Copy link
Member

@Conorc1000, you're right, it is already in the sample nightwatch.conf.js

/**
* selenium-download does exactly what it's name suggests;
* downloads (or updates) the version of Selenium (& chromedriver)
* on your localhost where it will be used by Nightwatch.
*/
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // got it?
if (err || !stat || stat.size < 1) {
require('selenium-download').ensure(BINPATH, function(error) {
if (error) throw new Error(error); // no point continuing so exit!
console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH);
});
}
});

But if someone was setting up their own project independently of this tutorial, we recommend they add those lines so that selenium-download .ensure will be run and we are sure that Selenium and Chromedriver are installed.

If you can improve the wording, please go for it! 👍

@nelsonic
Copy link
Member

nelsonic commented Nov 9, 2016

@Conorc1000 are you still confused.com by the readme...?

@nelsonic nelsonic assigned Conorc1000 and unassigned nelsonic Nov 9, 2016
@AlainPilon
Copy link
Contributor

I think removing the code while keeping the section 5 is even more confusing ;-)

@nelsonic
Copy link
Member

nelsonic commented Dec 6, 2016

@AlainPilon given that you are our "fresh pair of eyes" on this, can you please help us improve it? (e.g. with a Pull Request... thanks!)

@AlainPilon
Copy link
Contributor

I really want to use Nightwatch to do our testing so, yes, I will submit a few PR and newb questions along the way.

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

No branches or pull requests

3 participants