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

regular expression with cucumber doesn't match the string giving error but would match the same string if the test is written more than once

I'm writing in java and using cucumber with eclipse to search for an IP-like string with the following requirements should accept four-digit sequences separated by periods where a digit sequence is defined as follows: Any single digit, Any…
A.Mahmoud
  • 65
  • 7
5
votes
1 answer

io.cucumber.junit.CucumberOptions vs io.cucumber.testng.CucumberOptions vs cucumber.api.CucumberOptions which one should i choose

I am new to cucumber.I am trying to run cucumber feature files using testng in maven project. for which, in my pom.xml file, I have dependencies for TestNG,cucumber,junit,cucumber junit,cucumber java,selenium java I have imported CucumberOptions…
Rajaji
  • 133
  • 2
  • 14
5
votes
1 answer

Getting Exception field - $jacocoData Exception while running Jenkins build

I am getting below exception while running build on Jenkins, the scenario where my build get failed is Integration-test section of my project. However all of my junit and cucumber test-cases working fine on my localmachine. Exception which I…
Simmant
  • 1,477
  • 25
  • 39
5
votes
0 answers

How to add RunListener and TestExecutionListeners when running with Cucumber

Our current testing framework is running with junit + spring + selenium. Our tests use both junit's org.junit.runner.notification.RunListeners and spring org.springframework.test.context.TestExecutionListeners. This is how the test definition looks…
Dana Shalev
  • 1,894
  • 1
  • 13
  • 13
5
votes
3 answers

How to resolve deprecated @CucumberOptions?

In the following code i was using @cucumber.options.But it says it is deprecated. So i am trying to use @cucumberoptions which requires an import of "cucumber.api.CucumberOptions". But when i checked in my maven dependencies , cucumber.api does not…
Sapna
  • 391
  • 2
  • 3
  • 19
5
votes
7 answers

cucumber-java and cucumber-junit after version 1.0.14 does not work

I am using Cucumber-JVM and Selenium WebDriver together. I have a Maven project in eclipse and dependency of pom.xml file is as below: info.cukes cucumber-java
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
5
votes
2 answers

cucumber jvm varargs support in step definition

How to use power of varargs while defining step definitions in cucumber java bindings. I have below step Given I have following product: prod1, prod2, prod3 My Step definition @Given("^I have following product [(exhaustive list of products or…
Mrunal Gosar
  • 4,595
  • 13
  • 48
  • 71
5
votes
4 answers

How to link feature and step definition in cucumber

I'm new to Cucumber java and had this problem in initial stages: I'm not using MAVEN project for some reason. I just created a simple java project in eclipse. I have my features under "src/dummy/pkg/features", and my implementation "StepDef.java" is…
user85
  • 1,526
  • 5
  • 26
  • 42
5
votes
6 answers

Error while running cucumber in junit

Hi i am new to cucumber java. i am trying to run a simple cucumber feature test. below are my feature file, step definition file and junit runner file. but i am not able to run the test succesfully in cucumber-java,cucumber-junit 1.1.6…
Mrunal Gosar
  • 4,595
  • 13
  • 48
  • 71
5
votes
2 answers

How to suppress Cucumber/Junit assertion stack trace

I have a cucumber scenario and the step uses assertEquals. My results report shows the stack trace which is not end user friendly. How can I suppress it Scenario: Add two numbers Given I have two inputs "3" and "2" When I add them …
Bala
  • 11,068
  • 19
  • 67
  • 120
4
votes
2 answers

Cucumber With JUnit java.lang.ExceptionInInitializerError

I'm new to the UnitTesting and Cucumber, and today I tried to implement a simple example from a tutorial in Intelij and Eclipse and I got the same error when I try run the TestRunner.java. My pom.xml:
Lnoob
  • 97
  • 2
  • 2
  • 10
4
votes
6 answers

Cucumber No features found with JUnit5

I am trying to setup Cucumber in my project. I am following the same configuration from my previous projects but I still have issues with running the tests. Now I am starting to suspect that the issue might be that this project is using JUnit 5…
mka
  • 91
  • 1
  • 1
  • 4
4
votes
1 answer

How to get the Cucumber steps and attachments in Allure report?

I am able to generate allure report in a java-cucumber-Junit based Project. However, I am unable to get the cucumber steps in the execution section. Also, The attachments are not getting attached to the reports. I am able to generate the…
user7645022
  • 53
  • 1
  • 1
  • 7
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
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
1 2
3
37 38