A tool for writing functional front-end tests for overlays.

Downloads in past


0.2.96 years ago6 years agoMinified + gzip package size for amaze-tdd in KB


Amaze test-driven development
This is a set of tools that will allow for test-driven development using the following technologies:
  • Mocha
  • Chai
  • jQuery
  • selenium-webdriver
  • Chrome and PhantomJS

It contains everything you need to write functional tests for remote URLs.


Install the testing suite into your project root directory with:
npm install amaze-tdd --save

Writing tests

Ensure the testing suite is required at the top of the test. We use ES2016. Instantiate a global variable for Browser.
var Amaze = require('amaze-tdd');
var Browser;
var $;

Instantiate the browser object in the suiteSetup function. You should look at another test to see an example.
Browser =;

Optionally, you may instantiate a $ variable for a more familiar jQuery interface.
$ = Amaze.jQuery;

If you do this, you can then target web objects like you would a jQuery object, like...

...instead of...

It's not much, but it's something :-)
Tests should be written asynchronously due to Selenium's asynchronous nature. We should return something or use an expectation/assertion which returns a promise. An example test has been included for reference. We have also created further documentation on writing tests to help you write good tests.

Running tests

Run tests with:
node node_modules/amaze-tdd
You may pass in additional flags, such as sanity-check to include the demo test. This may help with sanity checks if you're getting a bunch of test failures:
node node_modules/amaze-tdd sanity-check
Additionally, you may use PhantomJS to headlessly test the interfaces. No browser plugin is required and no browsers will spawn, which may speed up tests. Add the headless option:
node node_modules/amaze-tdd headless

Test files

Our process will run Mocha on any files in the specified path with the format *-spec.js. This means that the following examples will work:
  • test-spec.js
  • overlay-name-spec.js
  • camelCase-spec.js
  • ALLCAPS-spec.js
  • some-folder/test-spec.js
  • some-folder/nested-folder/test-spec.js

Basically any file that ends with -spec.js will be covered in testing.


Along with the standard compiled .js file, you may also deliver the specs folder. When you run your tests, they're copied into this folder for easy delivery. The only thing your customer will need to do is install this NPM suite.


We want you! To help us make this great. See our wiki on contributing for more information.



  • Removed bundled drivers as they can be found elsewhere and makes this package about 40MB smaller
  • Updated the check for local configuration files
  • Added documentation for a familiar jQuery experience
  • Renamed a folder to better suit its contents
  • Added functionality that packages all specs for delivery
  • Silenced the logging when using a headless browser (e.g. PhantomJS)
  • Added process logging for transparency with colors!


  • Changed the way the script checks for local configuration files


  • Updated the demo spec test to be more of a sanity check
  • Removed dev option; changed prod to phantomjs for PhantomJS tests
  • Will only include the demo spec as a sanity check if sanity-check option is present
  • Tests will use your projects .amazerc file rather than the one included in this package
  • Slight tweaks to this readme file, typo fixes, and added link to documentation
  • Documentation updates; copying stuff over to the Wiki
  • Moved from Google ESlint rules to a custom set based on standard rules


  • Removing the necessity to use a global install and removing the bin for the command
  • Instead, relying on the package.json script so we need only a single install of the files
  • Added support for an .amazerc configuration file for individual project settings
  • Removed Firefox (geckodriver) and IE (iedriver) from global object
  • Using Chrome as default and PhantomJS for phantomjs option
  • Refactored some files to use ES2016, more on the way
  • Included an ESlint config file and devDependencies
  • Increased global timeout to 30s allowing removal of individual overrides


  • Tweaking the global object


  • Moved the demo test Browser instance into a suiteSetup to fix the empty browser that spawns during tests
  • Fixed typo of this section heading :-)


  • Removed unused Chai.should() library
  • Added documentation
  • Various cleanup and consolidations


  • Added a jQuery wrapper to make working with Selenium easier


  • Making Chrome plugin path work regardless of project
  • Moving browser builder to individual tests. This is necessary so the browser can re-instantiate itself between tests.


  • Package bin path update


  • Directory structure updates; needed an index.js for easier module loading


  • Removed selenium/mocha wrapper to reduce dependencies
  • Moved to a promise-based test setup
  • Switched from BDD to TDD for clarity
  • Preferring local install to global; was previously global
  • Added changelog :-)

0.0.1 - 0.0.10

  • Regretting not starting a changelog sooner
  • Basically gets stuff setup and working through bugs