Giter Site home page Giter Site logo

grails-cucumber's Introduction

What's this?

grails-cucumber is a Grails plugin for Cucumber based on Cucumber-JVM.

Goals

  • integrate cucumber (via cucumber-jvm) into the grails test runner as a grails test type "cucumber" to run cucumber scenarios via grails test-app and use Geb to implement cucumber steps definitions

Current State

It is not yet production ready... it is still a bit experimental but it is basically working. You can run cucumber scenarios with the steps implemented in geb and you can use grails domain classes in the steps as well. Take a look at the geb demo application in tests/projects/geb.

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 is implemented as grails test type that gets added to the functional test phase, e.g. to run the cucumber tests only use
grails test-app functional:cucumber
  • you can run cucumber features with steps implemented using geb.
  • cucumber features are expected in the test/cucumber folder using the typical cucumber layout.
  test/cucumber/step_definitions/XxSteps.groovy
  test/cucumber/step_definitions/YySteps.groovy
  test/cucumber/step_definitions/...
  test/cucumber/support/env.groovy
  test/cucumber/support/...
  test/cucumber/Xx.feature
  test/cucumber/Yy.feature
  • place geb modules and pages in the usual place as well:
  functional/modules/XRowModule.groovy
  functional/modules/...
  functional/pages/XxPage.groovy
  functional/pages/YyPage.groovy
  • see the sample project in tests/projects/geb for a full example grails project
  • 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 target/test-reports

Todo

  • 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, language
  • extend example

Source Notes

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

grails-cucumber's People

Contributors

hauner avatar

Stargazers

Chris Sterling avatar

Watchers

James Cloos 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.