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
2
votes
1 answer

RestAssured: How can I get the RequestSpecification fields or parameters after sending a request?

I'm doing cucumber bdd tests i have a class [MyClient] that wraps restassured methods and I have multiple classes that calls [MyClient]. I can do methods like put, post etc. just fine but I am wondering whether there is a way for me to get the…
iamkenos
  • 1,446
  • 8
  • 24
  • 49
2
votes
3 answers

Provide request and response body in cucumber report

I use java-cucumber and rest-assured. Currently I try to create report in which I wont to provide full request and response information for each request in report. So the question is: If it's possible to save in variable all request and response…
lexa2395
  • 21
  • 1
  • 2
2
votes
1 answer

Passing Cucumber Tags/values for JUnit Runner in maven command

I am trying to set the cucumber tags from maven command(through command line maven command). I am using Junit runner and cucumber options to specify the run and specify cucumber options(format,features,...).For before the maven invokes my Junit…
Gopinath V S
  • 91
  • 1
  • 11
2
votes
1 answer

cucumber - [31mFailed scenarios:[0m Console message

I have created a java-Cucumber test suite and its integrated in Jenkin and works fime. Mu Question is when any script fails. I am getting below message in console. [31mFailed scenarios:[0m [31mfeatures/XXXXXX.feature:5 [0m# Scenario: XXXXX…
nivek
  • 21
  • 2
2
votes
1 answer

Maven cucumber reporting with multi-module maven project

Background info: Maven version: 3.2.5 Java version: 1.8 Cucumber reporting version: 3.8.0 I have a multi-module maven java project. I have cucumber tests and the maven-cucumber-reporting plugin running and working for each module. Question: I…
wrslatz
  • 403
  • 2
  • 8
  • 25
2
votes
1 answer

Cucumber HTML reports folder with timestamp

net.masterthought maven-cucumber-reporting ${masterThougth.version}
jena84
  • 311
  • 1
  • 3
  • 20
2
votes
1 answer

cucumber giving null pointer exception with multiple scenario in feature file

Test Steps public class TestSmoke { WebDriver driver; @Given("^open firefox and start application$")jjj public void open_firefox_and_start_application() throws Throwable { driver=new FirefoxDriver(); …
2
votes
3 answers

How to write Tests with multiple steps in cucumber

If you have a simple form, you enter your name, Gender and save it. When you select the Gender drop-down it will list [Male | Female]. So when writing test scenarios for the above, the typical way is to Write it in steps. Precondition : User Loged…
ycr
  • 12,828
  • 2
  • 25
  • 45
2
votes
3 answers

How to run Cucumber scenario in different @Test or xml with Cucumber & TestNG

I'm looking at running Cucumber tests with TestNG. However I am having a issue where all my Scenario are running as one TestNG @Test session. Is there a way to run each Scenario as a separate @Test sessions? Here is my TestNG xml:
2
votes
1 answer

How to run Cucumber scenario as a step?

I have one scenario that has many steps, and its whole purpose is data generation, for example: Scenario: Data generation Given dataGen statement 1 And dataGen statement 2 ... And dataGen statement 100 I want to use this entire scenario (i.e. all…
user1559625
  • 2,583
  • 5
  • 37
  • 75
2
votes
1 answer

Java program exits before thread has finished. How do I make Cucumber-JVM wait for the thread to exit?

I am trying to create a new thread in my Cucumber-JVM program, when I reach a certain BDD step. Then, one thread should be doing something, while the original main thread continues running through the cucumber steps. The program shouldn't exit…
Katie
  • 45,622
  • 19
  • 93
  • 125
2
votes
2 answers

How do I insert a string variable into my step definition in Cucumber-JVM?

I'd want to insert a predefined string into my step definition in Cucumber using java. Here's what I have: Java Code public String temp = "hello"; //insert temp into my step: @Then("^the "+temp+" should be empty$") public void the_should_be_empty()…
Katie
  • 45,622
  • 19
  • 93
  • 125
2
votes
2 answers

How to structure sequential test with cucumber tags and JUnit?

I have a dream I would like to achive with Cucumber. I would like to combine cucumber with selenium (<= so far so good) AND optimize the test execution with tags. In my dream I'm able to tag my szenarios with Strings which represent a database…
MarcelHodan
  • 580
  • 1
  • 7
  • 27
2
votes
4 answers

How do I define "I Want" steps in cucumber using Java?

How do I define the "I Want" steps from my feature using java? I have my cucumber project setup like this: Login.feature Feature: User Login I want to test on "www.google.com" Scenario: Successfully log in Given I am logged out When I…
Katie
  • 45,622
  • 19
  • 93
  • 125
2
votes
2 answers

How to stop execution of a Cucumber feature if any of the scenarios had failed

If I have 10 scenarios in a feature file and if one scenario fails then I want to stop executing or proceeding with next scenario. I want to terminate the execution for that particular feature file. How can I do that in Java?
Samantha
  • 357
  • 2
  • 7
  • 17