ulrich / grails-casper-plugin

Plugin Grails permettant de lancer des tests CasperJS
3 stars 3 forks source link

= Grails CasperJS Tests Runner Plugin {Build Status}[https://travis-ci.org/ulrich/grails-casper-plugin] http://stillmaintained.com/ulrich/grails-casper-plugin.png

The purpose of this plugin is to run functionals {CapserJS}[http://casperjs.org/] 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}[http://casperjs.org/]/{PhantomJS}[http://phantomjs.org/] tools, you can read this {introduction}[http://casperjs.org/testing.html].

== Installation

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>

}

== Using

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')); });

== Issues

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.

== License

The plugin is distributed under MIT license, see {LICENSE}[http://en.wikipedia.org/wiki/MIT_License].