Cucumber Grails Plugin
The plugin runs cucumber inside grails which allows us to call the grails api. For example it is possible to call dynamic finders in the step implementations. You can populate the database with test data or check domain objects written to the database.
See Testing-Grails-with-Cucumber-and-Geb for a complete tutorial.
The plugin integrates cucumber as a grails test type
into grails test infrastructure. That means you can run the cucumber features with
that the results will be included in the usual grails test reports.
Currently the plugin registers the cucumber test type only to the functional test phase. To run the cucumber features you call grails by one of the following commands:
grails test-app functional:cucumber grails test-app :cucumber
The cucumber plugin does not provide an implementation for the functional test phase. It depends on another grails plugin, like Geb, to provide it. Geb is currently the only functional test plugin I have tried.
Cucumber-JVM is still a moving target, i.e. its api is still changing and it might brake the plugin code when you are using the MASTER branch code.
- cucumber features are expected in the
- the plugin integrates into grails usual test reporting. So failing steps, steps with errors or
undefined steps are all reported by grails as FAILED. The normal cucumber output can be found in
- keep up with api changes in cucumber-jvm
- the test report summary prints "Testcase: unknown took 0.065 sec", I do not yet understand why it prints "unknown" instead of the scenario name
- use grails like configuration for tags
- extend example
- the plugin has a number of unit tests and a single "cli" test. There are also a number of cucumber tests which are not meant to be run directly. They are only used by the "cli" test. You can run the cli test with
grails test-app other:cli
and the unit tests with
grails test-app unit: