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
- added support for specifying tags and names as part of the test-only task
- added publishing settings to the build
- cross builds to Scala 2.10.0-RCx
- testes with a Scala 2.10 project
Copy file name to clipboardExpand all lines: README.markdown
+8-12Lines changed: 8 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,12 @@ An [sbt 0.12.x](https://github.com/harrah/xsbt/wiki) plugin for running [Cucumbe
6
6
### IMPORTANT NOTES ABOUT THIS RELEASE (0.7.0) ###
7
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.
8
8
9
-
### EXPERIMENTAL RELEASE ###
10
-
This is currently an experimental release of the ability to run cucumber as a standard SBT test framework. The basic mechanisms are in place, but currently the following are broken / do not work:
11
-
12
-
* Currently MAY not work with Scala 2.10.0-RC1 (I've only been testing against 2.9.2 projects and need to cross-build the integration project to allow it to work)
13
-
* There is currently no support for 'test-only' and no way to just run features with specific names or tags
14
-
* When running in a multi-project setup, the cucumbers for each project are run in parallel and the output is interleaved and thus unreadable.
15
-
16
-
This version is not published to any repository. You can build it locally using the SBT tasks: package and publish-local.
17
-
18
9
## Overview ##
19
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:
20
11
21
12
* Works with xsbt 0.12.0
22
-
* Works with cucumber-jvm (version 1.0.9 for Scala 2.9.x and version 1.1.1 for Scala 2.10.0-RC1)
23
-
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-RC1
13
+
* Works with cucumber-jvm (version 1.0.9 for Scala 2.9.x and version 1.1.1 for Scala 2.10.0-RC1/RC2)
14
+
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-RC1/RC2
24
15
25
16
## Usage - Standalone Task ##
26
17
Install the plugin (see later). By default features files go in the 'src/test/resources' directory. Step definitions go in 'src/test/scala'. Finally from the sbt console call the task:
@@ -53,7 +44,10 @@ This is required to trigger cucumber to run (as SBT only runs tests that extends
53
44
54
45
Note that none of the configuration options apply when running via a test framework. This is because the SBT 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.
55
46
56
-
TODO: Support for test-only that runs cucumber just once but supporting tag and name arguments.
47
+
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:
48
+
49
+
test-only mypackage.CucumberSuite -- @demo
50
+
test-only mypackage.CucumberSuite -- "User admin"
57
51
58
52
## Writing Features ##
59
53
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.
@@ -139,6 +133,8 @@ To add the cucumber plugin settings to a full configuration (often a multi-modul
139
133
140
134
The testProjects/multiModuleTestProject in the plugin source repository shows this setup in a multi-module project.
141
135
136
+
Note that because SBT runs builds for different projects in parallel it will often try to run cucumber/test goals for multiple modules at once. This results in interleaving of the output written to the console. For multi-module builds using the cucumber task it is best to change the output settings to generate reports rather than console output. Unfortunately this is not possible when using the test task, so the recommended approach is to run the test task against each project module individually.
137
+
142
138
#### Running as a test framework ####
143
139
If you wish to support cucumber running as a test framework (via the test task) then the following settings should be placed in the build file instead:
0 commit comments