Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

amaze-tdd

Package Overview
Dependencies
64
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amaze-tdd

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


Version published
Maintainers
1
Install size
99.7 MB
Created

Readme

Source

Amaze test-driven development

This is a set of tools that will allow for test-driven development using the following technologies:

  • Mocha
  • Chai
  • selenium-webdriver
  • Chrome and PhantomJS

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

Installation

Install the testing suite into your project root directory with:

npm install amaze-tdd

Writing tests

Ensure the testing suite is required at the top of the test. We use ES2015. Instantiate a global variable for Browser.

const Amaze = require('amaze-tdd);
var Browser;

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

Browser = Amaze.Client.build();

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.

Running tests

Develop mode

npm run amaze dev

Production mode

For production, after JavaScript has been compiled and is placed on the remote server, you may use PhantomJS to headlessly test the interfaces. No browser plugin is required.

npm run amaze prod

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.

Changelog

0.2.6

  • 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 for dev option and PhantomJS for prod option
  • Refactored some files to use ES2015
  • Included an ESlint config file and devDependencies
  • Increased global timeout to 30s allowing removal of individual overrides

0.2.5

  • Tweaking the global object

0.1.1

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

0.1.0

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

0.0.15

  • Added a jQuery wrapper to make working with Selenium easier

0.0.14

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

0.0.13

  • Package bin path update

0.0.12

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

0.0.11

  • 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

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

FAQs

Last updated on 08 Nov 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc