nuclearjs

0.0.1 • Public • Published

NuclearJS - Boilerplate for CasperJS

NuclearJS is a boilerplate to start your test cases with CasperJS for every project. You don't need always code the same things!

Concept and Organization

Based in Atomic Design Concept for organization:

  • Atoms
  • Molecules
  • Organisms
  • Pages

Example of folder structure:

source/
    atoms/
        a.js (case test for links)
    molecules/
        search.js (case test for search form)
    organisms/
        header.js (case test for header element)
    pages/
        index.js (case test for index.html)
tests/
    checkout.js (case test for checkout process)
init.js (case test initializer)
nuclear.json (your paths)

Dependencies

Install

If CasperJS is installed, so clone the repo

$ git clone git@github.com:richardsantos/nuclearjs.git

// edit yours paths in the nuclear.json file:
{
   "root"   : "/var/www/nuclearjs/",
   "source" : "/var/www/nuclearjs/source/",
   "test"   : "/var/www/nuclearjs/tests/"
}

Options

  • --ignore (you can ignore atoms, molecules or organisms)
  • --page
  • --screenshot (default: false)
  • --url (default: http://www.example.com)
  • --network (default: false)

Usage

$ casperjs test ./init.js
$ casperjs test ./init.js --url=http://www.example.com --screenshot=true
$ casperjs test ./init.js --url=http://www.example.com --ignore=atoms
$ casperjs test ./init.js --url=http://www.example.com --page=index
$ casperjs test ./init.js --url=http://www.example.com --network=true

Contribution

Please, submit an issue and send me a pull request.

Thanks

Thank you Brad Frost by inspiration!

Package Sidebar

Install

npm i nuclearjs

Weekly Downloads

11

Version

0.0.1

License

MIT

Last publish

Collaborators

  • richardsantos