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
6
votes
3 answers

How to get multiline strings in Examples in Scenario Outline in cucumber tests to work?

I would like to use multiline strings in the Examples section of The Scenario Outline. How to do that ? eg Scenario Outline: Given something When `` happens I should get elaborative `` Examples: |action|duuh| |""" …
Cyryl Płotnicki
  • 473
  • 6
  • 12
6
votes
1 answer

Cucumber 2.4.0 tags not working with Gradle 4.6

I am trying to run Cucumber from Gradle using tags to run different sets of tests In dev I want to run the Eat cukes scenario: ./gradlew -Dcucumber.options="--tags @dev" clean test And in pro I want to run the Eat mushrooms scenario: ./gradlew…
codependent
  • 23,193
  • 31
  • 166
  • 308
6
votes
2 answers

Cucumber-JVM: Cucumber's @After hook is executed twice

I'm implementing Cucumber Testng for learning purposes. I've realized that the @After hook method is executed twice. I can confirm it with debugging set and a test report output. I only run 1 feature file and my test report shows two entries with…
nicholas
  • 2,581
  • 14
  • 66
  • 104
6
votes
3 answers

Cucumber Ordered Tagged Hooks

I am trying to use an ordered, tagged hook using Java cucumber. For example: @Before("@quicklink", order = 20) The compiler doesn't seem to like it. Is it not possible to have an ordered, tagged hook ? Seems like a reasonable combination of…
Walter Kelt
  • 2,199
  • 1
  • 18
  • 22
6
votes
0 answers

Trouble getting cucumber rerun plugin to work through terminal

I am using cucumber for ui testing written in java. I am trying to implement the cucumber plugin for rerunning failed scenarios, and created a second class to be the runner for those scenarios: first class @RunWith(Cucumber.class) @CucumberOptions( …
1ak31sha
  • 501
  • 7
  • 18
6
votes
1 answer

Is there any After keyword is available like Background for running cucumber steps

I know Background keyword is available for running a common steps before running each scenario. Likewise is there anything like "After" keyword is available for the commons steps after each scenario, not the logical steps in java code like after…
mmar
  • 1,840
  • 6
  • 28
  • 41
6
votes
2 answers

@DirtiesContext tears context down after every cucumber test scenario, not class

Integration test executed by cucumber tends to leave behind context that causes problems with subsequent tests. Obvious solution appeared to be Spring's @DirtiesContext, but instead of tearing down the context after all the cucumber features have…
laur
  • 498
  • 9
  • 17
6
votes
1 answer

How to represent nested json objects in a cucumber feature file

I have a need to represent JSON object in the feature file. I could use a json file for this for the code to pick up. But this would mean that i cant pass values from the feature file. Scenario: Test Given a condition is met Then the following…
trial999
  • 1,646
  • 6
  • 21
  • 36
6
votes
1 answer

Spring dependenices not injected with Cucumber

< TL;DR > The problem: I'm using Cucumber-JVM and Spring for integration tests. An autowired class in the test steps class is not being created and is null. < / TL;DR> The tests work locally but fail on the build server, with a null pointer when a…
AfterWorkGuinness
  • 1,780
  • 4
  • 28
  • 47
6
votes
0 answers

Spring + Cucumber: Conditional execution of local server

At this moment I have the following feature class: @ContextConfiguration(classes = MainApplication.class, loader = SpringApplicationContextLoader.class) @IntegrationTest @WebAppConfiguration public abstract class AbstractFeature { protected…
6
votes
2 answers

Programmatically execute Gatling tests

I want to use something like Cucumber JVM to drive performance tests written for Gatling. Ideally the Cucumber features would somehow build a scenario dynamically - probably reusing predefined chain objects similar to the method described in the…
SilentICE
  • 700
  • 8
  • 25
6
votes
3 answers

Cucumber Exception: java.lang.ClassNotFoundException: cucumber.io.ResourceLoader

I am facing an error whenever I run the cucumber test by Junit. Here is the following Exception. Any help will be awesome NOTE: THERE IS NO ERROR IN THE PROJECT java.lang.NoClassDefFoundError: cucumber/io/ResourceLoader at…
Zain
  • 5,391
  • 11
  • 34
  • 34
6
votes
2 answers

java - Cucumber on JUnit Test Failure Hook

We use Cucumber-JVM to script our acceptance tests and JUnit to execute them (via the JUnit Cucumber runner). As these tests involve Selenium WebDriver, I want to be able to take a screenshot should my test fail (which I have the code for). If I…
Smoke
  • 275
  • 3
  • 11
6
votes
1 answer

Setting cucumber-jvm format options in Maven to append all test execution results

The question is regarding the cucumber format option in maven: In every Junit I have something like: @Cucumber.Options(format = { "pretty", "html:target/cucumber-html-report/foo" }) I added the following option to the pom file:
Kummo
  • 3,602
  • 5
  • 24
  • 29
6
votes
3 answers

continue running cucumber steps after a failure

Is there any way to continue executing Cucumber Steps even when one of the steps fails. In my current setup when a step fails , cucumber skips remaining steps....I wonder if there is some way to twick cucumber runner setup.. I could comment out…
Manish
  • 191
  • 2
  • 4
  • 12