A basic template for a test suite based on Nightwatch.js
Nightwatch is a powerful framework for doing automated browser-based integration tests. While it doesn't replace unit testing, it often provides a good signal for when things are broken, leading to better testing across an entire engineering team. Combined with Selenium (vs. just Chromedriver), it can also be the basis for cross-browser testing across a variety of different browsers.
This simple template is designed to help teams bootstrap their Nightwatch test suite. It can either be used as a separate test repository, or integrated easily into an existing javascript codebase.
git clone git@github.com:initialized/nightwatch-template.git
npm install
- Install Chromedriver
- Start Chromedriver on port 9515:
./chromedriver
- Run tests:
./node_modules/.bin/nightwatch
(or individually:./node_modules/.bin/nightwatch tests/test-google-search.js
)
The API docs are pretty complete and give a great sense of what types of tests you can write.