Skip to content

ulrich/grails-casper-plugin

Repository files navigation

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.

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.

About

Plugin Grails permettant de lancer des tests CasperJS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages