You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+33-46
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
1
xsbt-cucumber-plugin
2
2
====================
3
3
4
-
An [sbt 0.11.x](https://github.com/harrah/xsbt/wiki) plugin for running [Cucumber](http://cukes.info) features under [cuke4duke](http://github.com/aslakhellesoy/cuke4duke).
4
+
An [sbt 0.11.x](https://github.com/harrah/xsbt/wiki) plugin for running [Cucumber](http://cukes.info) features.
5
5
6
-
Provides the ability to run Cucumber via Cuke4Duke within the SBT environment. Originally based on the [cuke4duke-sbt-plugin](https://github.com/rubbish/cuke4duke-sbt-plugin) by rubbish and my original implementation for SBT 0.7.x. Specifics for this release:
6
+
IMPORTANT: The current release is a major update that switches from running the ruby version of cucumber (using JRuby) to running cucumber-jvm. This provides a significant improvement in speed and reliability. It also significantly changes the configuration options for the plugin. If you are using an older version of this plugin, please read below and update your project configurations to match the new options.
7
7
8
-
* Works with xsbt 0.11.0, 0.11.1 and 0.11.2
9
-
* Works with Cucumber 1.0.0
10
-
* Works with cuke4duke 0.4.4
11
-
* Allows projects compiled and running against Scala 2.9.1
8
+
Provides the ability to run Cucumber-jvm within the SBT environment. Originally based on the [cuke4duke-sbt-plugin](https://github.com/rubbish/cuke4duke-sbt-plugin) by rubbish and my original implementation for SBT 0.7.x. Specifics for this release:
9
+
10
+
* Works with xsbt 0.11.3 (probably works with other 0.11.x versions, but I haven't tested this)
11
+
* Works with cucumber-jvm (1.0.9 for scala 2.9 and 1.0.10 for scala 2.10)
12
+
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-M4
12
13
13
14
## Usage ##
14
-
Install the plugin (see later). Be default features files go in a 'features' directory at the root of the project. Step definitions go in "src/test/scala'. Finally from the sbt console call the task:
15
+
Install the plugin (see later). By default features files go in a 'src/test/features' directory. Step definitions go in 'src/test/scala'. Finally from the sbt console call the task:
15
16
16
17
cucumber
17
18
@@ -29,7 +30,7 @@ would run features with a name matched to "User admin". Multiple arguments can b
29
30
* arguments starting with anything else will be passed to cucumber using the --name flag
30
31
31
32
## Writing Features ##
32
-
Features are written in text format and are placed in .feature files inside the 'features' directory. For more info on writing features please see the [Cucumber](http://cukes.info) website.
33
+
Features are written in text format and are placed in .feature files inside the 'src/test/features' directory. For more info on writing features please see the [Cucumber](http://cukes.info) website.
33
34
For example:
34
35
35
36
Feature: Cucumber
@@ -45,10 +46,10 @@ For example:
45
46
The location of the features can be changed by overriding a plugin setting (see below).
46
47
47
48
## Writing Step Defitions ##
48
-
Step definitions can be written in Scala, using the cuke4duke Scala DSL. More information on this api can be obtained from the the [cuke4duke wiki page for scala](http://wiki.github.com/aslakhellesoy/cuke4duke/scala).
49
+
Step definitions can be written in Scala, using the Scala DSL. More information on this api can be obtained from the the [Cucumber](http://cukes.info) website.
49
50
For example:
50
51
51
-
import cuke4duke.{EN, ScalaDsl}
52
+
import cucumber.runtime.{EN, ScalaDsl}
52
53
import org.scalatest.matchers.ShouldMatchers
53
54
54
55
class CucumberSteps extends ScalaDsl with EN with ShouldMatchers {
@@ -75,7 +76,7 @@ To install the cucumber plugin, add entries to the build plugins file (project/p
75
76
76
77
resolvers += "Templemore Repository" at "http://templemore.co.uk/repo"
To add the cucumber plugin settings to a basic project, just add the following to the build.sbt file:
@@ -101,60 +102,46 @@ To add the cucumber plugin settings to a full configuration (often a multi-modul
101
102
102
103
The testProjects/multiModuleTestProject in the plugin source repository shows this setup in a multi-module project.
103
104
104
-
## Gems ##
105
-
All gems are automatically installed the first time that the cucumber plugin is run. These gems are installed to the default location {user.home}/.jruby/gems so that they are cached for all projects using the cucumber plugin. The location of the cache directory can be overridden in the settings.
106
-
107
-
A task is provided to delete the cache directory contents:
108
-
109
-
cucumber-clean-gems
110
-
111
105
## Customisation ##
112
106
The plugin supports a number of customisations and settings. The following settings can be modified to change the behaviour of the plugin:
113
107
114
-
### Mode ###
115
-
*cucumberMode = The mode to run cucumber in. Defaults to the value templemore.xsbt.cucumber.Normal
116
-
117
-
The four supported modes are:
108
+
### Cucumber Settings ###
109
+
*cucumberFeaturesDir - The location of the cucumber features directory within the projects. Defaults to a java.io.File of ./src/test/features
110
+
* cucumberStepsBasePackage - The base package from which to search for files containing Steps. Defaults to an empty String (search all packages)
111
+
* cucumberExtraOptions - Additional commandline options to pass to the cucumber command. Defaults to an empty List[String]
118
112
119
-
* templemore.xsbt.cucumber.Normal - Runs cucumber and outputs results to the console
120
-
* templemore.xsbt.cucumber.Developer - Runs cucumber and outputs results, snippets and source to the console
121
-
* templemore.xsbt.cucumber.HtmlReport - Runs cucumber and outputs an html report of the results
122
-
* templemore.xsbt.cucumber.PdfReport - Runs cucumber and outputs a pdf report of the results
113
+
Note: The cucumberStepsBasePackage should be set in configurations to avoid scanning the entire classpath for files containing Steps
123
114
124
-
### General Settings ###
125
-
*cucumberJRubyHome - The location for the JRuby home. Defaults to a java.io.File of {user.home}/.jruby
126
-
*cucumberGemDir - The location of the Gem cache directory. Defaults to a java.io.File of {cucumberJRubyHome}/gems
127
-
*cucumberMaxMemory - The maximum JVM memory to allocate to the JRuby process. Defaults to the string "256M"
128
-
*cucumberMaxPermGen - The maximum PermGen space for the JRuby process. Defaults to the string "64M"
115
+
### Output Settings ###
116
+
*cucumberPrettyReport - Outputs a pretty printed text file of the executed features instead of writing them to the console. The console display is default to just displaying progress dots. This solves the problem of interleaving of parallel test output when running in a multi-module project. Defaults to the Boolean value false
117
+
*cucumberHtmlReport - Outputs an html report of the executed features to a report directory. Defaults to the Boolean value false
118
+
*cucumberJunitReport - Outputs a Junit format XML report file of the executed features. Defaults to the Boolean value false
119
+
*cucumberJsonReport - Outputs a JSON format report file of the executed features. Defaults to the Boolean value false
129
120
130
-
### Gem Settings ###
131
-
* cucumberVersion - The version of Cucumber to use. Defaults to the string "1.0.0"
132
-
* cucumberCuke4DukeVersion - The version of Cuke4Duke to use. Defaults to the string "0.4.4"
133
-
* cucumberPrawnVersion - The version of the Prawn PDF generator to use. Defaults to the string "0.8.4"
134
-
* cucumberGemUrl - The URL for downloading Gems. Default to the string "http://rubygems.org/"
135
-
* cucumberForceGemReload - Whether to force reloading of all gems, even if they exist in the cache. Defaults to false
121
+
If none of the above are set to true then the default output is pretty printed features to the console. It is possible to support multiple outputs in a single run by setting more than one of the above settings to true. For multi-module projects it is recommended to set cucumberPrettyReport to true so that you don't end up with interleaved console output caused by cucumber being run concurrently for each project.
136
122
137
-
### Cucumber Settings ###
138
-
* cucumberFeaturesDir - The location of the cucumber features directory within the projects. Defaults to a java.io.File of ./features
139
-
* cucumberOptions - Custom options to pass to the cucumber command. Defaults to an empty List[String]
123
+
* cucumberPrettyReportFile - The location of the pretty printed text report file. Defaults to a java.io.File of ./target/scala-{scalaVersion}/cucumber.txt
124
+
* cucumberHtmlReportDir - The directory for the html report. Defaults to a java.io.File of ./target/scala-{scalaVersion}/cucumber/
125
+
* cucumberJunitReportFile - The location of the Junit XML report file. Defaults fo a java.io.File of ./target/scala-{scalaVersion}/cucumber.xml
126
+
* cucumberJsonReportFile - The location of the JSON format report file. Defaults fo a java.io.File of ./target/scala-{scalaVersion}/cucumber.json
140
127
141
-
### Output Settings ###
142
-
*cucumberHtmlReportFile - The location of the html report file. Defaults fo a java.io.File of ./target/cucumber-report/cucumber.html
143
-
*cucumberPdfReportFile - The location of the pdf report file. Defaults fo a java.io.File of ./target/cucumber-report/cucumber.pdf
128
+
### JVM Settings ###
129
+
*cucumberMaxMemory - The maximum JVM memory to allocate to the JRuby process. Defaults to the string "256M"
130
+
*cucumberMaxPermGen - The maximum PermGen space for the JRuby process. Defaults to the string "64M"
144
131
145
132
### Lifecycle Settings ###
146
133
* cucumberBefore - A function of type () => Unit that will be run BEFORE cucumber is executed. Defaults to a no-op function
147
134
* cucumberAfter - A function of type () => Unit that will be run AFTER cucumber is executed. Defaults to a no-op function
148
135
149
136
## Roadmap ##
150
137
151
-
This plugin will continue to track releases of both SBT (0.10 and onwards) and Cucumber.
138
+
This plugin will continue to track releases of both SBT (0.10 and onwards) and Cucumber-jvm.
152
139
Requests for features can be posted to the issues list or emailed to the author.
153
140
154
-
Current plan is to upgrade to the next major version of SBT and then to switch to cucumber-jvm as soon as there is a stable release.
155
-
156
141
## Release History ##
157
142
143
+
### 0.5.0 ###
144
+
Moved from ruby implementation of Cucumber to Cucumber-jvm. This changes many of the plugin settings and options. In particular, output options are significantly improved.
158
145
159
146
### 0.4.1 ###
160
147
Updated to build versions for xsbt 0.11.0, 0.11.1 and 0.11.2
0 commit comments