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
yarn
(ornpm install
if you're a square)npm run dev
to start the Barkwire web app. It will be available at http://localhost:3000.- In another shell,
npm run install-selenium
to install Selenium WebDriver, thennpm run selenium
to start it - In yet another shell,
npm test
to run your automated acceptance test. - Star the repo because it was so helpful!
- This demo uses the phantom.js headless browser. The
nightwatch.json
file is where you configure the tests for other browsers (Chrome, Firefox, Safari, etc.) - The test spec in
tests/add-puppy.js
should 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
scripts
hash inpackage.json
to see how they work. They can be even more magical by adding something likewatch
to 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.