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

Define a list of strings in a Datatable cell for a field inside a Cucumber step in Java

What I want I am working with DataTables in Cucumber. I have the following situation: Step in the feature file: I set the ingredients necessary for a meal | name | ingredients | | mac and cheese | pasta,cheese | |…
Inês
  • 882
  • 3
  • 13
  • 28
3
votes
1 answer

Cucumber Stopping Execution after Time in Steps

One of my tests waits until an event happens in the Then step. If the test works fine there is no issue but if the test is failing (i.e. no event is triggered) then it just hangs. How can I set a timeout in Cucumber? I know JUnit has a timeout…
Vlad Schnakovszki
  • 8,434
  • 6
  • 80
  • 114
3
votes
3 answers

RESTAssured Multipart content-type

I started using RESTAssured recently and am making a REST call using the RESTAssured library. I have an attachment in the request which I am attaching using the "multipart()" method. For my API I should be passing "application/x-abc-xyz+xml" as the…
Coder12345
  • 179
  • 3
  • 11
3
votes
3 answers

Cucumber: repeat only one step several times

If I have a scenario outilne like this: Scenario Outline: test Given I am on page X When I fill the on field And I click on Ok button Then I should see something Examples: name | fieldID | "Jhon" | "name1"| "Max" | "name2"…
Mucida
  • 603
  • 9
  • 24
3
votes
1 answer

Asynchronous steps execution with Cucumber (and/or Citrus)

Suppose I have a test like below (using cucumber) - Scenario: Login successfully to Facebook Given the user test exists And user name and password is entered When the login form is submitted Then I expose a HTTP-Rest service to validate the…
bpa.mdl
  • 396
  • 1
  • 5
  • 19
3
votes
1 answer

Karate API Tests - Escaping '?' in the url in a feature file

I am using the path keyword from Karate API framework to concatenate strings to form a url. However, I am not able to pass '?'. Here is what I am doing: Background: * url 'https://api.cloud.abcde.com/animal/' Scenario: Verify the get status …
Saurabh
  • 930
  • 2
  • 17
  • 39
3
votes
2 answers

Cucumber Java - How to use returned String from a step in next step?

I need to automate some webservices, i create some methods for that and i want to use Cucumber for that but i can't figure how to use returned value in next step. So, i have this Feature: Feature: Create Client and place order Scenario: Syntax …
DET66
  • 183
  • 2
  • 2
  • 8
3
votes
2 answers

SpringBoot load SQL on cucumber step

Im using SpringBoot, Cucumber and RestAssured for my Integration/Functional Tests, the problem is @Sql does not work on @Given annotation. Is there a way to execute SQL between steps? Here's my…
3
votes
2 answers

How to make "the" optional in my cucumber BDD Step Definitions?

I'd like to match either of the following BDD: Then the response status should be "200" Then response status should be "200" I want to make "the" optional. I want these two rules to map to the SAME step. Here is my attempt, but it doesn't…
Katie
  • 45,622
  • 19
  • 93
  • 125
3
votes
1 answer

Test Framework quit unexpectedly Error - Cucumber Java IntelliJ

I am strugling to run a simple Cucumber script in IntelliJ. After resolving all dependancy issue now when i run scenario I am getting error as : Test Framework quit unexpectedly Testing started at 4:34 PM ... Testing started at 4:34 PM…
3
votes
2 answers

Class has no public constructor TestCase(String name) or TestCase() while running my Cucumber scenario

I'm using Green Coffee library to run Cucumber scenarios in my instrumentation tests. I followed example provided by repo step-by-step, but here's the error: junit.framework.AssertionFailedError: Class pi.survey.features.MembersFeatureTest has no…
getsadzeg
  • 640
  • 3
  • 9
  • 19
3
votes
2 answers

Cucumber Java screenshots

Is there a way to take screenshots in between steps in Java Cucumber ? I have the following scenario : @Scenario_1 Given I log into url And I see the home page is displayed in English //Take screenshot And I click on 'Edit Profile' And I see the…
sanaku
  • 309
  • 2
  • 6
  • 18
3
votes
3 answers

Cucumber-JVM - Java 8 - Step definitions not found

I try to add Cucumber to test my Java project, I wrote a feature file: Feature: I visit the website Scenario: I read the home page Given I am on the "home" page I wrote a class to run the cukes import…
Fla
  • 536
  • 6
  • 23
3
votes
0 answers

How to remove obsolete step functions that no longer exist in feature files in Cucumber JVM?

I am new to Cucumber JVM using Eclipse IDE. Normally after writing feature file using Gherkin, I use Junit Runner to run the feature file like below: @RunWith(Cucumber.class) @CucumberOptions( features = "Feature" ,glue={"stepDefinition"} …
user1559625
  • 2,583
  • 5
  • 37
  • 75
3
votes
1 answer

Reading parameter values from Testng.xml file in cucumber stepdefs

I'm able to run testng scripts upon integrating with cucumber. I've followed the exact steps defined in http://automatictester.co.uk/2015/06/11/basic-cucumberjvm-selenium-webdriver-test-automation-framework/ link. Now I’ve one more requirement. can…
Vikas
  • 669
  • 3
  • 10
  • 21