This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
nightwatch-patch-1504 with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Nightwatch works with the Selenium standalone server so the first thing you need to do is download the selenium server jar file
selenium-server-standalone-2.x.x.jar from the Selenium releases page:
Install Node.js and then:
$ git clone https://github.com/nightwatchjs/nightwatch.git $ cd nightwatch $ npm install
The tests for Nightwatch are written using Mocha exports interface so they can also be run with Nightwatch itself.
To run the unit tests using mocha, do:
$ npm test
To run the unit tests using Nightwatch, do:
$ npm run unit-tests
To check test coverage, run the command:
$ npm run mocha-coverage
and then open the generate file coverage.html in your browser.