All Projects → samueltbrown → Gradle Cucumber Plugin

samueltbrown / Gradle Cucumber Plugin

Licence: mit
Plugin to support cucumber-jvm in Gradle builds

Labels

Projects that are alternatives of or similar to Gradle Cucumber Plugin

Behat
BDD in PHP
Stars: ✭ 3,696 (+4520%)
Mutual labels:  cucumber
Cuke linter
A linting tool for Cucumber
Stars: ✭ 24 (-70%)
Mutual labels:  cucumber
Cucumber Api
API validator in BBD style with Cucumber
Stars: ✭ 50 (-37.5%)
Mutual labels:  cucumber
Knapsack
Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time.
Stars: ✭ 430 (+437.5%)
Mutual labels:  cucumber
Webdriverio
Next-gen browser and mobile automation test framework for Node.js
Stars: ✭ 7,214 (+8917.5%)
Mutual labels:  cucumber
Oerpscenario
Business Driven Development (BDD) for OpenERP/Odoo
Stars: ✭ 32 (-60%)
Mutual labels:  cucumber
Cucumber
A monorepo of common components - building blocks for implementing Cucumber in various languages.
Stars: ✭ 3,299 (+4023.75%)
Mutual labels:  cucumber
Mobileautomationframework
Single code base framework to test android and iOS app using appium (v6.1.0), maven, testng,java. Option to start appium server programmatically.
Stars: ✭ 66 (-17.5%)
Mutual labels:  cucumber
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (+1025%)
Mutual labels:  cucumber
Intellij Cucumber Scala
Enables navigation between cucumber feature steps and glue code using cucumber-scala DSL.
Stars: ✭ 48 (-40%)
Mutual labels:  cucumber
Cucumber Js
Cucumber for JavaScript
Stars: ✭ 4,383 (+5378.75%)
Mutual labels:  cucumber
Appiumtestdistribution
A tool for running android and iOS appium tests in parallel across devices... U like it STAR it !
Stars: ✭ 764 (+855%)
Mutual labels:  cucumber
Fabrication
This project has moved to GitLab! Please check there for the latest updates.
Stars: ✭ 1,017 (+1171.25%)
Mutual labels:  cucumber
Cucumber Boilerplate
Boilerplate project to run WebdriverIO tests with Cucumber
Stars: ✭ 411 (+413.75%)
Mutual labels:  cucumber
Cypress Cucumber Example
An example skeleton with Cypress and Cucumber
Stars: ✭ 57 (-28.75%)
Mutual labels:  cucumber
Jest Cucumber
Execute Gherkin scenarios in Jest
Stars: ✭ 347 (+333.75%)
Mutual labels:  cucumber
Cucumber Protractor Harness
Simple starter project for incorporating cucumber (2.3.1) with protractor
Stars: ✭ 9 (-88.75%)
Mutual labels:  cucumber
Wdio Cucumber Framework
A WebdriverIO v4 plugin. Adapter for Cucumber testing framework.
Stars: ✭ 77 (-3.75%)
Mutual labels:  cucumber
Email Spec
Collection of RSpec/MiniTest matchers and Cucumber steps for testing email in a ruby app using ActionMailer or Pony
Stars: ✭ 1,142 (+1327.5%)
Mutual labels:  cucumber
Specflow.assist.dynamic
Extension methods to create dynamic objects from SpecFlow tables
Stars: ✭ 45 (-43.75%)
Mutual labels:  cucumber

Download

Gradle Cucumber Plugin

![Cucumber Logo] (https://cucumber.io/images/cucumber-logo.svg)

The gradle cucumber plugin provides the ability to run cucumber acceptance tests directly from a gradle build. The plugin utilizes the cucumber cli provided by the cucumber-jvm project and should support any of the languages utilized in cucumber-jvm.

(Currently only tested with Java, Groovy, and JRuby more coming soon!)

Contributors

Using the plugin in your gradle build script

From v0.7 on

To use in Gradle 2.1 and later…

      plugins {
        id "com.github.samueltbrown.cucumber" version "0.9"
      }

To use in earlier versions of Gradle…

      buildscript {
        repositories {
          jcenter()
        }
        dependencies {
          classpath "com.github.samueltbrown:gradle-cucumber-plugin:0.9"
        }
      }
      
      apply plugin: "com.github.samueltbrown.cucumber"

Before v0.7

You can apply the plugin using the following buildscript:

  apply plugin: 'cucumber'

  buildscript {
      repositories {
          mavenCentral()
      }

      dependencies {
          classpath 'com.github.samueltbrown:gradle-cucumber-plugin:0.6'
      }
  }

Older versions can be downloaded directly from GitHub like so;

  buildscript {
      apply from: 'https://github.com/samueltbrown/gradle-cucumber-plugin/raw/master/repo/gradle-cucumber-plugin/gradle-cucumber-plugin/0.3/cucumberinit.gradle'
  }

Running the Tests only

Once the plugin has been applied, the project dependencies need to be updated with the cucumber-jvm jar file needed for your language. Below 'groovy' is the chosen language.

  dependencies {

    ...

  	cucumberRuntime 'info.cukes:cucumber-groovy:1.2.2'

  }

Building and Running the Tests

If you have a src/cucumber source set (similar to src/test), the plugin will automatically detect it and setup Java tasks and configurations for you. The "cucumber" code unit depends on "test", the same way "test" depends on "main". Also, choose your library dependencies:

  dependencies {

  	cucumberCompile 'info.cukes:cucumber-groovy:1.2.2'

  }

Write your feature files under src/cucumber/resources.

Available Tasks

Currently the plugin only supports one task to run your cucumber tests:

  > gradle cucumber

Cucumber Task Configuration

The cucumber task has several configurable properties:

  • formats: A list of output formats. (Defaults to pretty)
  • glueDirs: A list of directories where stepdefs and supporting code are located (Defaults to src/test/java)
  • featureDirs: A list of directories where feature files are located.(Defaults to src/test/resources)
  • tags: a list of the tags of the scenarios to run (['@a,[email protected]', '@c'] reads as (@a OR NOT @b) AND @c)
  • monochrome: A boolean value indicating if console output should be one color. (Defaults to false)
  • strict: A boolean value indicating whether scenarios should be evaluated strictly. (Defaults to false)
  • dryRun: A boolean value indicating whether scenarios should be run as a dry run. (Defaults to false)
  • jvmOptions {}: a DSL block configuring the spawned process. Options are the same as for JavaExec.
  • ignoreFailures: A boolean value indicating whether failures from the cucumber runner should be ignored or not. Defaults to false

Example task configuration

cucumber {
    formats = ['pretty','json:build/cucumber.json','junit:build/cucumber.xml']
    glueDirs = ['src/test/resources/env',
                'src/test/resources/support',
                'src/test/resources/step_definitions']
    featureDirs = ['src/test/resources/features']
    tags = ['@billing', '@important']
    monochrome = false
    strict = false
    dryRun = false
    ignoreFailures = false
    
    jvmOptions {
      maxHeapSize = '512m'
      environment 'ENV', 'staging'
    }
}

Prerequisites

You must use Cucumber version 1.1.6 or higher.

Release Notes

v0.9

  • Minimum Gradle version is now 2.0
  • Uses the --plugin rather than --format arg for the cucumber runner when using cucumber-jvm 1.2.+
  • Introduces ignoreFailures convention for test running.

v0.8

  • Cucumber is now executed as a separate process using an underlying JavaExec task.

v0.7.2

  • Fixed support of Java 1.6/1.7

v0.7.1

  • Dependency on specific version of Cucumber now has a provided scope.

v0.7

  • Minimum Cucumber version is now 1.1.6.
  • Fixed support of multiple tags.
  • Fixed execution on Windows

v0.6

  • Windows support
  • Idea integration: Cucumber source dirs automatically added to modules with test scope

Coming Soon

  • Automatic dependency retrieval and default glue dirs for each jvm language
  • Simplified task configuration
  • Command-line arguments to override task configuration

Contributing

As you would expect, clone, push to GitHub and create a pull request for us to review and merge.

Make sure you are using jdk 1.6 when running tests (jenv is our friend here).

Pushing to Maven Central

  ./gradlew \
    -Psigning.secretKeyRingFile=path/to/ring.gpg \
    -Psigning.keyId=GPG_KEYID \
    -Psigning.password=$GPG_PASS \
    -PsonatypeUsername=$SONATYPE_USER \
    -PsonatypePassword=$SONATYPE_PASS \
    clean uploadArchives

It is possible to save some or all of those properties to ~/.gradle/gradle.properties.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].