Git Product home page Git Product logo

grails-cucumber's Introduction

Cucumber Grails Plugin

grails-cucumber is a Grails plugin for Cucumber based on Cucumber-JVM. Cucumber-JVM is the JVM implementation of cucumber with support for many JVM languages.

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 the wiki for more information, especially the plugin guide or the introductional article that walks through a simple example.

Quick Usage

The plugin integrates cucumber as a grails test type into the grails test infrastructure. That means you can run the cucumber features with test-app and 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
  • cucumber features and steps are expected in the test/functional folder

  • step implementations look like this:

      this.metaClass.mixin (cucumber.runtime.groovy.EN)
    
      Given (~'^I have specified my app by example$') { ->
      	// implement me using groovy and grails code
      }
      
      When (~'^I run the specification without failures$') { ->
      	// implement me using groovy and grails code
      }
      
      Then (~'^I am confident the app does what the customer wanted$') { ->
      	// implement me using groovy and grails code
      }
    
  • failing steps, steps with errors or undefined steps are all reported by grails as FAILED. The normal cucumber output can be found in target/test-reports

Changes

see CHANGES.md

Development

Todo

  • support other grails functional test plugins
  • extend examples

Plugin test code

  • 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:

The unit tests will also run from an IDE without starting up grails (works for me with IDEA 11.1).

grails-cucumber's People

Contributors

hauner avatar

Stargazers

miinx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.