App::Duppy - a wrapper around casperjs to pass test configurations as json files
version 0.05
# 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
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.
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.
Emmanuel "BHS_error" Peroumalnaik
Fabrice "pokki" Gabolde
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.
To install App::Duppy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Duppy
CPAN shell
perl -MCPAN -e shell install App::Duppy
For more information on module installation, please visit the detailed CPAN module installation guide.