Questions tagged [cucumber-jvm]

Cucumber-JVM is a Cucumber implementation for the most popular JVM languages. Cucumber-JVM currently supports Java. There are also implementations for the following JVM languages, but as of version 2.1.0, they are unsupported: Groovy Scala Clojure Jython JRuby Rhino JavaScript Gosu

Cucumber-jvm is a Java-based tool for behavior-driven development.

Cucumber-JVM is a pure Java implementation of Cucumber, with native support for the most popular JVM languages: Java, Scala, Groovy, Clojure, Rhino, Jython and JRuby.

Cucumber-JVM is the successor of Cuke4Duke, which was the Ruby implementation of Cucumber, running on JRuby. It is faster and also easier to run than its predecessor.

See GitHub project

1356 questions
58
votes
7 answers

How to pass variables between cucumber-jvm steps

To pass variables between steps I have the step methods belong to the same class, and use fields of the class for the passed information. Here is an example as follows: Feature: Demo Scenario: Create user Given User creation form management …
troig
  • 7,072
  • 4
  • 37
  • 63
37
votes
5 answers

Execute Cucumber step before/after a specific feature

I want to specify certain setup and tear down steps for each specific feature file. I've seen hooks that allows code to execute before every scenario, and hooks to execute code before each feature, but I want to specify code to run once before and…
Dave Novelli
  • 2,086
  • 4
  • 32
  • 42
30
votes
4 answers

How to get name of scenario in cucumber java?

I would like to get name of scenario to have meaningful logs and to generate custom report at run-time in java. Scenario class have only has getStatus() and getSourceTagNames() methods. I don't find a way to get scenario name. Can someone help me…
user2365105
  • 325
  • 2
  • 5
  • 8
26
votes
9 answers

Dcucumber.options, how to have multiple tags

I am trying run cucumber tests using maven with following command mvn test -Dcucumber.options="--tag @debug1" This command works fine, however if i try something like following, i get error mvn test -Dcucumber.options="--tag @debug1 @debug2" Is…
Rahul Lodha
  • 3,601
  • 7
  • 25
  • 34
26
votes
5 answers

Cucumber Test a Spring Boot Application

Does anyone know where I can find a sample application where Cucumber is used to test a Spring Boot application through Gradle? I can run the tests fine starting the server on the cmd line and using my IDE, but I need to be able to run them all…
jakehschwartz
  • 1,005
  • 2
  • 13
  • 32
25
votes
7 answers

Cucumber JVM: Test if the correct exception is thrown

How to test that the correct exception is thrown when using Cucumber JVM? When using JUnit, I would do something like this: @Test(expected = NullPointerException.class) public void testExceptionThrown(){ taskCreater.createTask(null); } As you…
samach
  • 3,244
  • 10
  • 42
  • 54
23
votes
9 answers

How do I set the path to my Cucumber features using cucumber-junit?

I try to build my first executable specifications with Java and Maven. I created a simple project with this structure: specification |-src |-test |-java |-mypackage |-MyFeatureTest.java |-resources …
cringe
  • 13,401
  • 15
  • 69
  • 102
23
votes
3 answers

Running Cucumber tests directly from executable jar

I have a project with cucumber and maven also I am using the JUnit. I am able to run and build my project successfully from Eclipse. Now I want to run the test from command line in another system which does(should) not have eclipse or cucumber…
Arpan Buch
  • 1,380
  • 5
  • 19
  • 41
21
votes
4 answers

Cucumber JVM undefined step

I can't execute a simple test with cucumber for a project. I am on Intellij 13 Community, with cucumber plugin. I wrote my feature file in my features directory, I have also implemented my steps, creating them with the help of the plugin. And my…
Thibault
  • 568
  • 3
  • 10
  • 21
19
votes
6 answers

How to pass List of strings from Cucumber Scenario

I need to pass the List of strings from cucumber scenario which works fine as below Scenario Outline: Verify some scenario Given something When user do something Then user should have some "" Examples: Some example |data| |Test1, Test2,…
Yogiraj
  • 223
  • 1
  • 4
  • 15
19
votes
5 answers

How to run single cucumber feature files through command prompt and through jenkins using Maven?

I am bit new to Cucumber / Maven, so require help on running test cases. I have developed an automation suite in eclipse using Cucumber and Selenium. To run specific feature files / Junit runner class, I right-click on the files in Eclipse and run…
Ronnie
  • 251
  • 1
  • 3
  • 17
18
votes
4 answers

How to continue an Android instrumentation test run after exception?

Apparently an instrumentation test run is stopped when on exception occurs in the instrumented application: Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Exception''. Check device logcat for details Is this the…
André Diermann
  • 2,725
  • 23
  • 28
18
votes
3 answers

Is there a way to directly generate Step Definitions in Eclipse without Running Cucumber?

Im doing integration testing with cucumber and Gradle in Eclipse. For now my workflow is Write a feature file Run it to generate step skeletons Copy and implement them This works good for new features and so on, but becomes quite bothersome…
Dude
  • 692
  • 1
  • 4
  • 25
18
votes
3 answers

Cucumber options annotation

The cucumber-jvm javadocs states that purpose of the glue element is to specify the location of the stepdefinitions and hooks. However, this doesn't seem to work for me. Lets say I have my features in directory a, and my step definitions in…
JustDanyul
  • 13,813
  • 7
  • 53
  • 71
17
votes
1 answer

Maven running cucumber specific feature files or folders

How is it possible to use the cucumber feature option from maven command line. Of a tree full of features (tests), I'm trying to run only individual features. In my case - all feature files in a selected folder. I've tried to use the following…
Eldad Assis
  • 10,464
  • 11
  • 52
  • 78
1
2 3
90 91