@financial-times/n-automation

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.

Stats

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

Readme

n-automation Circle CI

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

Installation

npm install @financial-times/n-automation

Usage

Makefile

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

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

Init

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

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

Automation.run({
    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.

Examples

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.