Run automated [regression tests](https://en.wikipedia.org/wiki/Regression_testing) for your app using [nightwatch.js](http://nightwatchjs.org/) and get results on Slack and email.


622.4.03 years ago5 years agoMinified + gzip package size for @financial-times/n-automation in KB


n-automation Circle CI

Run automated regression tests for your app using nightwatch.js and get results on Slack and email.


npm install @financial-times/n-automation



Write a regression recipe on your Makefile containing the tests you'd like to run, passing the n-automation reporter to nht nightwatch:

REPORTER = ./node_modules/@financial-times/n-automation/build/reporter.js

    nht nightwatch -c nightwatch.js path/to/test.js --reporter ${REPORTER}
    nht nightwatch -c nightwatch.js path/to/anotherTest.js --reporter ${REPORTER}


Init n-automation in an independent file somewhere in your project, for example jobs/run-regression.js:

const Automation = require('@financial-times/n-automation');

    appName: 'Your App Name',
    nightwatchJson: require('../nightwatch.js')

Only pass in nightwatchJson if your project has a nightwatch config. If not, send only appName and n-automation will default to the n-heroku-tools nightwatch config file

Env Variables

  • process.env.SLACK_URL Slack Incoming Webhook Integration URL for the channel to notify
  • process.env.SLACK_MENTIONS Slack users to mention on failure (optional)
  • process.env.REGRESSION_RECIPIENTS email addresses of the people to notify on test failure

Heroku Schedule

Schedule your job with something like the Heroku Scheduler. Once a day is recommended.

Email on failure

Full nightwatch output will be sent to the email addresses above whenever a test fails.


See next-signup

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.