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
4
votes
6 answers

Take a screenshot with Cucumber

I just learn how to use cucumber. Can you tell me how to complete this code? You can implement step definitions for undefined steps with these snippets: Then /^I take a screenshot$/ do pending # express the regexp above with the code you wish…
Sokhom Ratanak
  • 5,836
  • 4
  • 14
  • 11
3
votes
1 answer

Gradle doesn't pick up Cucumber-jvm

I am trying to run Cucumber-jvm from Gradle. However no matter what I do I cannot get the features to actually run. They are always skipped while other JUnit tests are run. My features are in src/test/resources and I have a JUnit test in…
Gp De Ciantis
  • 103
  • 1
  • 8
3
votes
1 answer

maven-surefire-plugin doesnot work in SpringBoot 2.2.2.RELEASE and above

I have used maven-surefire-plugin in my Maven project to execute the tests in parallel. everything work great. When I have upgraded to SpringBoot 2.2.2.RELEASE and above, tests stop running in parallel. This is how I use the plugin :
3
votes
3 answers

java.lang.NoClassDefFoundError: gherkin/IGherkinDialectProvider while running Selenium-Cucumber test

Before I start, I have asked a similar question here and the answer (Changing 'Gherkin' version) fixed it for me that time. But this time I'm using pom.xml instead of jars and with the newer versions I'm not able to rectify the error. Also, I'm…
justcurious
  • 839
  • 3
  • 12
  • 29
3
votes
1 answer

run cucumber tests parallel using cucumber-jvm 4

Java v8.x - spring v5.x cucumber v4.2.0 i tried temyers/cucumber-jvm-parallel-plugin and it works fine, but when i get to their gitihub page they announced to stop using this plugin b/c cucumber already have start supporting parallel test running…
d-man
  • 57,473
  • 85
  • 212
  • 296
3
votes
4 answers

Maven/Junit Parallel Execution - Cucumber-JVM v4.0.0

I'm struggling to get the new parallel execution feature of Cucumber-JVM v4.0.0 working with JUnit/Maven. As specified here, if you configure and accordingly in your POM, and use dependency injection to share state (I'm…
Rusty Shackleford
  • 337
  • 1
  • 6
  • 18
3
votes
1 answer

Getting Parser Error: inconsistent cell count within the table - while running tests in Parallel - Selenium Cucumber Maven framework with Junit

I have configured Selenium-cucumber maven framework with Junit. After adding the cucumber-jvm-parallel plugin & maven-surefire plugin , commented the statements inside @CucumberOptions which we have written inside TestRunnerTest.java file .After…
Milu
  • 135
  • 1
  • 3
  • 13
3
votes
1 answer

How to ignore stepdefinition variable declaration in cucumber for same value

How to ignore stepdefination variable declaration in cucmber for same value? So suppose I have example as below: Scenario Outline: Looking up the definition of fruits Given the user is on the Wikionary home page When the user looks up…
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
3
votes
1 answer

How to map gherkin step definition data to a Java object in Cucumber?

I have following three classes: class City { String name; String code; } class Address { String street; City city; } class Person { String name; int age; Address address; } Now, I have a REST API to POST a person. POST /person { …
3
votes
3 answers

Cucumber tests - break example table of scenario outline into smaller chunks

I have a big example table in scenario outline with around 20 columns Scenario Outline: .... Given .... When ... Then .... Examples: |col1|col2|col3|col4|col5|........|col20| |val1|val2|val3|val4|val5|........|val20| Is it…
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 remove an attribute from testing in XMLUnit in Java?

I wanted to skip two attributes from my acceptance test.So I added following part to remove that two attributes.This is given me a error: junit.framework.AssertionFailedError: org.custommonkey.xmlunit.Diff [different] Expected number of element…
user2490093
  • 69
  • 10
3
votes
3 answers

Cucumber Step Definition from dependency jars

I have multiple projects using similar step definition across the different projects. Hence using all step definition in single project and added as dependency jar in maven. When I run using maven command it says : You can implement missing steps…
Komal
  • 31
  • 1
  • 3
3
votes
3 answers

Step does not have a matching glue code error in cucumber eclipse

I am trying to run a feature file which mentioned follows. Feature: Prove the concept of my script Scenario: My first Test Given This is my first step When This is my second step Then This is my third step and when I run this…
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