Questions tagged [cucumber-java]

Cucumber-JVM is a pure Java implementation of Cucumber that supports the most popular programming languages for the JVM. Cucumber-JVM supports the following JVM languages: - Java - Groovy - Scala - Clojure - Jython - JRuby - Rhino JavaScript - Gosu

Cucumber is basically Ruby based. But Java can be used by using Cucumber JVM.

Running You can run it with the tool of your choice. There are several ways to run scenarios with Cucumber-JVM:

  • JUnit Runner
  • CLI Runner
  • Android Runner
  • Third party runners

Cucumber-JVM also integrates with all the popular Dependency Injection containers. For details Dependency Injection

1140 questions
4
votes
1 answer

Cucumber in Spring Boot main scope : Autowire not working

Working off of this post: Cucumber: no backend found when running from Spring Boot jar I am attempting to get Cucumber to work full within a live Spring Boot app. I currently have a POC app using the aforementioned post's code to create a Cucumber…
4
votes
0 answers

How to consume cucumber step class from imported library?

I made a java lib project with all steps classes to be used in other project package ulala.aop.integration.steps; public class KafkaSteps { @Autowired private BinderAwareChannelResolver resolver; @Autowired private MessageChannel localOutput,…
TuGordoBello
  • 4,350
  • 9
  • 52
  • 78
4
votes
0 answers

Cucumber Spring DI two Step classes loading Spring context

I'm using cucumber-spring to create my integration tests and use DI provided by Spring. The way it's done: there is a separate project that defines all the necessary cucumber dependencies: io.cucumber
user2101310
  • 115
  • 1
  • 2
  • 10
4
votes
2 answers

Modify CucumberOptions tags when running Cucumber in Java

I was wondering if there was a way to modify CucumberOptions tags while Cucumber is running? I'm not sure if this is possible or not but I was wondering if there was a way to modify tags while Cucumber is running. In my example code, I would like to…
jimbaker
  • 105
  • 2
  • 6
4
votes
4 answers

Cucumber features are not being recognized by Eclipse

I have installed Natural 0.7.6 version plugin from Eclipse Market and the installation was successful. I tried Cucumber feature and Eclipse is not recognising the same. After installing Natural 0.7.6, I created a "Features" package and added a file…
4
votes
2 answers

How to change Jenkins build status if failed scenarios were successfully reruned

I have two TestNG runners to run main and failed scopes of cucumber scenarios. In case MainTestRunner was successfull, Jenkins build status is "success" and FailedTestRunner will not find any failed scenarios into rerun.txt. But in case…
razenkov55
  • 41
  • 5
4
votes
1 answer

Cucumber 3: How to define a regular expression

In Cucumber 2 a regular expression is expressed as (.*) to get a parameter for the glue code. The expressions documentation of Cucumber 3 says that "You can use Regular Expressions or Cucumber Expressions." but sadly it does not mention the…
Marc von Renteln
  • 1,229
  • 15
  • 34
4
votes
1 answer

Cucumber not identifying scenario without examples

I have a gherkin scenario similar to following: Scenario Outline: Test some behaviour Given a set of preconditions When an event occurs Then my application has to behave in a particular manner And respond as expected When I execute…
4
votes
2 answers

How to set multiple plugins for Cucumber Options from terminal of cucumber?

I set Cucumber options into my cucumber project below: And I run test by mvn command line with -Dcucumber.options to override options of my prject: mvn -f "pom.xml" -Dcucumber.options="--plugin…
Tam Vo
  • 301
  • 4
  • 13
4
votes
1 answer

How to embed a screenshot in Cucumber report for each action taken?

I see a post was made for this here How to capture a screenshot after each step in tests with JAVA and Cucumber? But, what I would like to do is be able to take a screenshot after every single action taken even within a single Cucumber step and…
ihossain
  • 343
  • 1
  • 8
  • 19
4
votes
2 answers

How to execute Cucumber Spring Boot Packaged Jar from command line?

I am fairly new to cucumber-jvm world. Trying to package cucumber spring boot app as Jar. app runs fine from Eclipse. But when I package as executable jar it fails with Exception : Exception in Main Thread, No backend Module found. Make sure that…
4
votes
3 answers

After Scenario Outline hook in Cucumber

I'm using Java and Cucumber. I need to do some actions after every scenario outline. I know there are @Before and @After hooks, but they are applicable to every scenario in Scenario Outline. Is there any possibility to launch some actions exactly…
Solarsoul
  • 43
  • 1
  • 1
  • 6
4
votes
3 answers

How to make a scenario that depends on another scenario using cucumber, selenium and java

I am learning cucumber through some tutorials and there is something that I don't know how to do.. I need to make a scenario that depends on another scenario (for example log out scenario I have to be logged in first before logging out) so what…
4
votes
1 answer

Running Cucumber and Spring boot in Main class

My requirement is to run Cucumber test cases using Spring boot to run through a Custom java main class. I am able to run Cucumber test suite fine if i am using following config class:- @RunWith(Cucumber.class) @CucumberOptions( plugin = { …
Vikram Pathania
  • 873
  • 2
  • 8
  • 15
4
votes
3 answers

How to get scenario name from a scenario outline in cucumber using java

Suppose I have a test case like - *Scenario: Facebook login test GIVEN I am a Facebook user WHEN I enter my user name & password THEN login should be successful* How could I get the scenario name from the step definition methods corresponding to "I…
bpa.mdl
  • 396
  • 1
  • 5
  • 19