This is a demonstration of automated acceptance testing using the nightwatch.js framework.
Note: This requires a recent version of the JDK to be installed!
- Fork and clone
npm installif you're a square)
npm run devto start the Barkwire web app. It will be available at http://localhost:3000.
- In another shell,
npm run install-seleniumto install Selenium WebDriver, then
npm run seleniumto start it
- In yet another shell,
npm testto run your automated acceptance test.
- Star the repo because it was so helpful!
- This demo uses the phantom.js headless browser. The
nightwatch.jsonfile is where you configure the tests for other browsers (Chrome, Firefox, Safari, etc.)
- The test spec in
tests/add-puppy.jsshould give an idea of how these tests are written. The API for nightwatch is simple to learn, and the resulting tests are extremely readable.
- There's a small amount of magic happening in the npm scripts- check out the
package.jsonto see how they work. They can be even more magical by adding something like
watchto automatically run your tests whenever your app files or tests change.
- It's a pretty paint-by-numbers Express app. It uses knex to abstract out all the database stuff, which is all stored locally in a SQLite3 embedded database. It also uses Handlebars and SCSS.