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
+37-3
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@ xsbt-cucumber-plugin
3
3
4
4
An [sbt 0.12.x](https://github.com/harrah/xsbt/wiki) plugin for running [Cucumber](http://cukes.info) features.
5
5
6
-
### IMPORTANT NOTES ABOUT THIS RELEASE (0.7.0) ###
7
-
It adds the ability to run cucumber as a standalone SBT task but also as a test runner within the standard 'test' task. To facilitate this, there has been one significant change that you should be aware of: the default location for feature files has changed from the src/test/features directory to the classpath. This is required as running as a test framework only has access to the test classpath. Features should therefore now live under src/test/resources. It is possible to change this back to another location by overriding the cucumberFeaturesLocation setting, but if you change this to anything other than the classpath then the 'test' task will not be able to find features.
6
+
### IMPORTANT NOTES ABOUT THIS RELEASE (0.7.x) ###
7
+
It adds the ability to run cucumber as a standalone SBT task but also as a test runner within the standard 'test' task (either within the Test or within the IntegrationTest configs). To facilitate this, there has been one significant change that you should be aware of: the default location for feature files has changed from the src/test/features directory to the classpath. This is required as running as a test framework only has access to the test classpath. Features should therefore now live under src/test/resources. It is possible to change this back to another location by overriding the cucumberFeaturesLocation setting, but if you change this to anything other than the classpath then the 'test' task will not be able to find features.
8
8
9
9
## Overview ##
10
10
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:
@@ -49,6 +49,24 @@ It is also possible to filter exactly which features get executed by using the t
49
49
test-only mypackage.CucumberSuite -- @demo
50
50
test-only mypackage.CucumberSuite -- "User admin"
51
51
52
+
## Usage - Integration Test Framework ##
53
+
Install the plugin and additional integration test framework integration (see later). Feature files MUST go in the 'src/it/resources' directory as only the classpath is visible to test frameworks. Step definitions go in 'src/it/scala'.
54
+
55
+
There must also be present somewhere in the test code the following class:
56
+
57
+
class CucumberSuite extends templemore.sbt.cucumber.RunCucumber
58
+
59
+
This is required to trigger cucumber to run (as SBT only runs tests that extends a specific base class or have a specific annotation). There MUST only be one instance of a class extending RunCucumber in the test code as we only want cucumber to be executed once! Finally from the sbt console call the task:
60
+
61
+
it:test
62
+
63
+
Note that none of the configuration options apply when running via a test framework. This is because the SBT integration test integration does not allow any access to these settings. Cucumber will be executed with pretty output to the console, searching the classpath from its root for features and executing all tests found in packages.
64
+
65
+
It is also possible to filter exactly which features get executed by using the test-only task. To do this, specify the CucumberSuite that you defined above as the test to run and then use either the tag or name approach already described as the test arguments:
Features are written in text format and are placed in .feature files inside the 'src/test/resources' directory. For more info on writing features please see the [Cucumber](http://cukes.info) website.
54
72
For example:
@@ -102,7 +120,7 @@ To install the cucumber plugin, add entries to the build plugins file (project/p
102
120
103
121
resolvers += "Templemore Repository" at "http://templemore.co.uk/repo"
This will ensure the necessary jars and test frameworks are installed in the IntegrationTest config as opposed to the normal Test config. For more information about setting up an IntegrationTest config see the testProjects/integrationTestIntegrationProject or http://www.scala-sbt.org/release/docs/Detailed-Topics/Testing.
173
+
145
174
## Customisation ##
146
175
The plugin supports a number of customisations and settings. Note that these setting customisations only apply to running using the standalone 'cucumber' task. Running cucumber as a test framework does not support any customisation options.
147
176
@@ -184,6 +213,11 @@ Requests for features can be posted to the issues list or emailed to the author.
184
213
185
214
## Release History ##
186
215
216
+
### 0.7.1 ###
217
+
218
+
Fix for issue #15. The templemore repository is now added as a resolver to the project when the plugin is added.
219
+
Fix for issue #14. It is now possible to run cucumber within the IntegrationTest config.
220
+
187
221
### 0.7.0 ###
188
222
189
223
Significant refactor to support running cucumber via the standalone 'cucumber' task or integrated as test framework that can run as part of the standard SBT 'test' task.
0 commit comments