Questions tagged [cucumber-junit]

The JUnit integration provided by the Cucumber-Jvm project.

Cucumber-Jvm is the pure java rewrite of Cuke4Duke which just a port of Cucumber from Ruby to JRuby. Cucumber-JUnit provides integration with JUnit so that Gherkin tests can be run alongside other JUnit tests.

562 questions
10
votes
10 answers

cucumber jvm CucumberException: No features found at []

In my cucumber -jvm, Maven, junit Setup I have my testRunner file as package com.lebara.testrunner; import cucumber.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @Cucumber.Options( glue =…
TestAutomationEng
  • 101
  • 1
  • 1
  • 4
9
votes
1 answer

How to pass an array of Integers from Cucumber features file to step definition while writing unit test cases

I am learning Cucumber for unit testing and was trying to write unit tests for the Radix Sort code. But I am unable to figure out how to provide array of integers as an input to radix sort code from feature file. I tried providing below input: …
8
votes
2 answers

Feature files discovery in cucumber-junit-platform-engine

In cucumber-junit library I use @CucumberOptions to define feature files location: package com.mycompany.cucumber; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import…
makozaki
  • 3,772
  • 4
  • 23
  • 47
8
votes
2 answers

java.lang.NoClassDefFoundError exception while running cucumber test using JUnit

I'm trying to run a cucumber test with JUnit and I'm getting java.lang.NoClassDefFoundError exception. JUnit code: package ctest; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import…
justcurious
  • 839
  • 3
  • 12
  • 29
8
votes
2 answers

How to pass variable values between steps in Cucumber Java?

I have a variable and I want to pass this variable across all the steps. Anyone can suggest with an code snippet example please on how to pass a variable value between the steps please. Any help will be highly appreciated.
Sayom
  • 147
  • 1
  • 2
  • 7
7
votes
3 answers

Is additional context configuration required when upgrading cucumber-jvm from version 4 to version 6?

I am using cucumber-jvm to perform some functional tests in Kotlin. I have the standard empty runner class: @RunWith(Cucumber::class) @CucumberOptions(features=[foo], glue=[bar], plugin=[baz], strict=true, monochrome=true) class…
sam.flahive
  • 109
  • 1
  • 1
  • 4
7
votes
3 answers

Getting error during running Cucumber feature file Unknown option: --plugin

Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+ Options: -g, --glue PATH Where glue code (step definitions and hooks) is loaded from. -f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to…
Pankaj Kumar
  • 151
  • 1
  • 3
  • 9
7
votes
4 answers

Cucumber JVM: How do I use a double as an input value?

For a Behavior test that I'm trying to write, I require inputs that are floating point. How do I set up my gherkin string to look for these values?
user321605
  • 846
  • 2
  • 7
  • 20
6
votes
1 answer

Cucumber Java - JUnit set monochrome over command line

What is the best way to disable color output for my Cucumber JUnit tests when they are run by a build machine? It is possible to set monochrome = true in the @CucumberOptions annotation. The problem with that is, running the Tests locally should…
Marcel
  • 1,606
  • 16
  • 29
6
votes
3 answers

@CucumberOptions in cucumber-junit-platform-engine

I'm trying to migrate my cucumber tests from cucumber-junit to cucumber-junit-platform-engine to be able to use new platform features. How do I redefine my runner to use old @CucumberOptions. I'm investigating the issue but can't seem to find the…
makozaki
  • 3,772
  • 4
  • 23
  • 47
6
votes
1 answer

Java Cucumber does not recognize my string parameter

Cucumber doesn't recognize the String parameter what I would like to use it as currency. It only recognise int value. (It finds the steps because other steps works) @When("I deposit {int} of {string}") public void testDeposit(int value, String…
user2695543
  • 81
  • 4
  • 22
6
votes
3 answers

Calling one feature file from another feature in cucumber

Consider I have below feature files: Login.feature Feature: Login on website Scenario: Login verification on site Given Navigate to site login page When User enters username 'admin1' And User enters password 'admin1' And User clicks on login…
Megha Dalvi
  • 91
  • 1
  • 1
  • 8
6
votes
6 answers

Java Cucumber: Take @CucumberOptions from external source like a property file

Is it possible to take cucumber option values from a java .properties file? In this SO post, it shows that it is being passed from CLI. Here's my sample class: @RunWith(Cucumber.class) @CucumberOptions( features = {"resources/features/"}, …
iamkenos
  • 1,446
  • 8
  • 24
  • 49
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
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
1
2
3
37 38