Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cucumber/cucumber-java-skeleton
This is the simplest possible setup for Cucumber-JVM using Java.
https://github.com/cucumber/cucumber-java-skeleton
Last synced: 27 days ago
JSON representation
This is the simplest possible setup for Cucumber-JVM using Java.
- Host: GitHub
- URL: https://github.com/cucumber/cucumber-java-skeleton
- Owner: cucumber
- License: mit
- Created: 2014-03-12T10:06:15.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T09:23:10.000Z (7 months ago)
- Last Synced: 2024-04-14T00:33:42.622Z (7 months ago)
- Language: Java
- Size: 1010 KB
- Stars: 450
- Watchers: 109
- Forks: 606
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cucumber-Java Skeleton
This is the simplest possible build script setup for Cucumber using Java.
There is nothing fancy like a webapp or browser testing. All this does is to show
you how to install and run Cucumber!There is a single feature file with one scenario. The scenario has three steps,
two of them pending. See if you can make them all pass!## Get the code
Git:
git clone https://github.com/cucumber/cucumber-java-skeleton.git
cd cucumber-java-skeletonSubversion:
svn checkout https://github.com/cucumber/cucumber-java-skeleton/trunk cucumber-java-skeleton
cd cucumber-java-skeletonOr [download a zip](https://github.com/cucumber/cucumber-java-skeleton/archive/main.zip) file.
## Use Maven
Open a command window and run:
cd maven
./mvnw testThis runs Cucumber features using Cucumber's JUnit Platform Engine. The `Suite`
annotation on the `RunCucumberTest` class tells JUnit to kick off Cucumber.## Use Gradle
Open a command window and run:
cd gradle
./gradlew test --rerun-tasks --infoThis runs Cucumber features using Cucumber's JUnit Platform Engine. The `Suite`
annotation on the `RunCucumberTest` class tells JUnit to kick off Cucumber.## Configuration
The [Cucumber JUnit Platform Engine](https://github.com/cucumber/cucumber-jvm/tree/main/cucumber-junit-platform-engine) uses configuration parameters to know what features to run,
where the glue code lives, what plugins to use, etc. When using JUnit, these
configuration parameters are provided through the `@ConfigurationParameter`
annotation on your test.For available parameters see: `io.cucumber.junit.platform.engine.Constants`
### Run a subset of Features or Scenarios
Specify a particular scenario by *line*
@SelectClasspathResource(value = "io/cucumber/skeleton/belly.feature", line = 3)
In case you have multiple feature files or scenarios to run against repeat the
annotation.You can also specify what to run by *tag*:
@IncludeTags("zucchini")
## Running a single scenario or feature
Maven and Gradle do not (yet) support selecting single features or scenarios
with JUnit selectors. As a work around the `cucumber.features` property can be
used. Because this property will cause Cucumber to ignore any other selectors
from JUnit it is prudent to only execute the Cucumber engine.### With Maven
To select the scenario on line 3 of the `belly.feature` file use:
```
./mvnw test -Dsurefire.includeJUnit5Engines=cucumber -Dcucumber.features=src/test/resources/io/cucumber/skeleton/belly.feature:3
```Note: Add `-Dcucumber.plugin=pretty` to get a more detailed output during test execution.
### With Gradle
TODO: (I don't know how to do this. Feel free to send a pull request. ;))