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
70
votes
8 answers

No tasks available when executing JUnit runner class

I am trying to run Cucumber feature files in IntelliJ. Cucumber Options is pointing to the right folder, but I get the "No tasks available" notification when trying to execute the JUnit runner class. What am I doing wrong? Here is my…
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
33
votes
1 answer

what is the difference between io.cucumber and info.cukes

I am trying to integrate BDD using Cucumber. But I am really confused what is the difference between io.cucumber and info.cukes libraries. And which one to use and when. I tried to read and understand the github README.md file still can't make heads…
Alok
  • 1,441
  • 4
  • 20
  • 31
23
votes
9 answers

How do I set the path to my Cucumber features using cucumber-junit?

I try to build my first executable specifications with Java and Maven. I created a simple project with this structure: specification |-src |-test |-java |-mypackage |-MyFeatureTest.java |-resources …
cringe
  • 13,401
  • 15
  • 69
  • 102
23
votes
3 answers

Running Cucumber tests directly from executable jar

I have a project with cucumber and maven also I am using the JUnit. I am able to run and build my project successfully from Eclipse. Now I want to run the test from command line in another system which does(should) not have eclipse or cucumber…
Arpan Buch
  • 1,380
  • 5
  • 19
  • 41
17
votes
2 answers

How do I specify a separate maven goal for running (Cucumber) acceptance tests?

I have the following project structure: MyProject --src --test --acceptance --step_definitions --features --unit I would like to be able to run my cucumber tests (in test/acceptance) separately in Maven from the…
Rich Ashworth
  • 1,995
  • 4
  • 19
  • 29
16
votes
3 answers

How to organize the specs definition in Cucumber?

We are considering to use Cucumber on our project for acceptance testing. When we write a scenario in a Cucumber feature, we write a list of Given, When and Then statements. As we use cucumber-jvm project, the Given, When and Then statement are…
Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
15
votes
3 answers

Cucumber: Unable to find step definition

I have the following feature file: MacroValidation.feature @macroFilter Feature: Separating out errors and warnings Scenario: No errors or warnings when separating out error list Given I have 0 macros When I filter out errors and warnings…
Chun ping Wang
  • 3,879
  • 12
  • 42
  • 53
15
votes
3 answers

Can I use spring to autowire controller in cucumber test?

I am using Cucumber to automate the testing of services and controllers in my app. In addition, I am using the Cucumber Junit runner @RunWith(Cucumber.class) in the test steps. I need to instantiate my controller and was wondering if I could use…
Billy Sneddon
  • 239
  • 1
  • 3
  • 14
13
votes
3 answers

java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible:module

This is my first cucumber project and i followed a tutorial when setting everything up. It all seems to be the same but for some reason i get this: java.lang.ExceptionInInitializerError. Caused by: java.lang.reflect.InaccessibleObjectException:…
Ortero
  • 243
  • 2
  • 3
  • 12
13
votes
4 answers

How to exclude cucumber tags

I have a bunch of IT cases with various cucumber tags. In my main runner class I want to exclude all the scenarios which have either @one or @two. So, below are the options I tried Option 1 @CucumberOptions(tags=Array("~@one,~@two"), .....) or…
JavaMan
  • 351
  • 1
  • 3
  • 13
12
votes
2 answers

Cucumber `--tags` options from command line?

What i would like to do is to pass cucumber options from command line to execute scenarios with tag name @extecuteThese but also i wanted to exclude scenarios that are with tag name @WIP so what am i doing so far is -Dcucumber.options='--tags…
Ranjith's
  • 4,508
  • 5
  • 24
  • 40
12
votes
2 answers

How to run cucumber file from command line

I have cucumber feature file located at below location on my local: C:\ProjectWork\Workspace\Cucumber\DIT_Cucumber\src\cucumber\featureOne.feature and Junit jar at below location: C:\DurgeshProjectWork\Workspace\JarFiles\junit-4.11.jar When I have…
Durgesh
  • 585
  • 4
  • 12
  • 33
11
votes
3 answers

How to run cucumber-jvm tests with maven

How do I run the cucumber tests that I have in the following locations with Maven. Source folders 'src/main/java' and 'src/main/resources' include step definitions and feature files in package 'com.testing.TestProject.login' created in each source…
11
votes
6 answers

Rerunning failed cucumber tests using cucumber-jvm

I have a Cucumber-JVM, JUnit, Selenium setup. I initiate the run by running RunSmokeTests.java using JUnit within Eclipse. I have also set up a maven profile to run the tests from command line, and possibly Jenkins in the future. When the tests are…
shreyansp
  • 723
  • 1
  • 7
  • 16
11
votes
5 answers

Specify the feature file location in cucumber

I have created some cucumber test steps and a small Cucumber test case, which I run with JUnit like so: @RunWith(Cucumber.class) public class FuelCarTest { //executs cucumber steps in the class FuelCarSteps } The Cucumber features files are…
lanoxx
  • 12,249
  • 13
  • 87
  • 142
1
2 3
37 38