Grails CasperJS Tests Runner Plugin <img src=“https://travis-ci.org/ulrich/grails-casper-plugin.png?branch=master” alt=“Build Status” /> ¶ ↑
The purpose of this plugin is to run functionals CapserJS tests in Grails application. The results of these tests are reported in xUnit XML files format. To execute functionnals CasperJS tests, you must put your tests files in the test/casper directory. They may can be written both Javascript and CoffeeScript language.
To more informations about CapserJS/PhantomJS tools, you can read this introduction.
Before, you must install and configure the PhantomJS CapserJS tools. See the corresponding documentations for installs.
To install the latest stable version of the plugin run:
grails install-plugin casper-runner
You can also package and install casper-runner plugin for specific version by the following way:
git clone git://github.com/ulrich/grails-casper-plugin.git git checkout TAG_VERSION grails package-plugin grails install-plugin ./grails-casper-runner-TAG_VERSION.zip -global
Declare the plugin in the Config.groovy like this:
plugins { runtime ":hibernate:$grailsVersion" ... runtime ":yui-minify-resources:0.1.4" ... build ":tomcat:$grailsVersion" ... <b>test ":casper-runner:TAG_VERSION"</b> }
To run the tests, you must enter the following command:
grails test-app casper:
Moreover in this first draft, you must add in run method how to render the xUnit file used by plugin for result test parsing. Like this:
casper.run(function() { this.test.renderResults(true, 0, this.cli.get('xunitFileName')); });
Acutally, we are in the first release of plugin and of course there are many improvements possible. So, don’t hesitate to report any bug/improvement in the issues tracker on the project.
The plugin is distributed under MIT license, see LICENSE.