Author image Emmanuel Peroumalnaïk
and 2 contributors

NAME

App::Duppy - a wrapper around casperjs to pass test configurations as json files

VERSION

version 0.05

SYNOPSIS

  # will launch casperjs with the options mentionned in the file. See in
  # the fixture directory for an example 
  duppy --test mytestplan.json --test myothertestplan.json 

DESCRIPTION

The original idea came from a discussion I had with Nicolas Perriault. I was searching a way to organise my casperjs tests, and he came out with this suggestion.

So I decided to write a little wrapper around casperjs that would be able to launch tests using the format he suggested.

This script is dead simple: given a json file, it builds out a valid list of parameters that is passed to casperjs. It then displays the output returned by casperjs.

JSON File syntax

The JSON file you use to wrap up your tests consists in valid casperjs command line options, excepted for the path argument, which will resolve to the path where your test files are.

  {
    "auto-exit": false,
    "concise": false,
    "fail-fast": false,
    "includes": ["t/fixtures/inc.js"],
    "log-level": "debug",
    "no-colors": false,
    "paths": ["t/fixtures/main.js", "t/fixtures/main2.js"],
    "post": ["t/fixtures/post.js"],
    "pre": ["t/fixtures/pre.js"],
    "verbose": true,
    "xunit": "results.xml"
  }

  # this will resolve to the following : 
  # casperjs --auto-exit=false --concise=false --fail-fast=false
  # --includes='t/fixtures/inc.js' --log-level='debug' --no-colors=false
  # --post='t/fixtures/post.js' --pre='t/fixtures/pre.js' --verbose=true
  # --xunit='results.xml' test t/fixtures/main.js t/fixtures/main2.js

Note that I assumed that you will always put valid parameters inside a JSON file, so there is no control on that.

AUTHORS

  • Emmanuel "BHS_error" Peroumalnaik

  • Fabrice "pokki" Gabolde

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by E. Peroumalnaik.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.