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

Can we use regular expression to mention cucumber options feature files?

@CucumberOptions(features = {"src/test/resources/features/module*.feature"}, tags = "@E2e",) mvn clean verify -Dcucumber.features=”module*.feature” -Dcucumber.filter.tags="@E2E" Is there any way to use regex to identify feature files? It takes it up…
2
votes
2 answers

Can I create a spring bean as part of my cucumber step definitions?

For some context, my spring boot application makes calls to external APIs providing the current date using LocalDate.now() and retrieves various information back. We are using Cucumber for testing and the above presents a problem when writing step…
Eoin
  • 330
  • 1
  • 3
  • 15
2
votes
1 answer

Cucumber 6.9 java8, cannot convert from DataTable to custom type

I want to register my custom type in order to automatically get a list from datatable. Despite there are many sources refering to TypeRegistryConfigurer class, this appears to be deprecated in latest cucumber core version. I tried to look at this…
Fabrizio Stellato
  • 1,727
  • 21
  • 52
2
votes
0 answers

Set priority in cucumber scenarios by using tags

I am trying to execute the cucumber scenario's in sequential order. I have multiple feature files with different regions and want to execute my scenarios based on priority as per below. feature file:1 @IE priority=1 Scenario: A new user can…
SeleniumUser
  • 4,065
  • 2
  • 7
  • 30
2
votes
1 answer

TM4J Java does not generate json result

I'm trying to make the integration between JUnit, Jenkins and TM4J (Jira) using this tutorial: https://support.smartbear.com/tm4j-cloud/docs/api-and-test-automation/junit-integration.html. The problem is that the tm4j_result.json file is NOT…
2
votes
0 answers

How to attach the screenshot to each step in ExtentReport?

I'm trying to use ExtentReport with Cucumber v4. I'm able to generate the execution report at the end of the test case, including the proper step list (for all steps that were executed) with their screenshots. However, although the screenshots are…
2
votes
2 answers

Maven-surefire plugin excluding parallel test

i am using maven-surefire, cucumber and testng to run a few cucumber test in parallel, I would like to execute a few test in parallel and a few in serial order. PS- i am not using testng.xml but using testrunner.java to run my test. Regards
2
votes
1 answer

"path must exist" for Cucumber + Spring Boot

I made a Spring Boot 2 application with one endpoint to execute Cucumber test for 5.7.0 version @PostMapping("/integration") public Object runCucumber(@RequestBody List request) { try { String pathDirectory =…
TuGordoBello
  • 4,350
  • 9
  • 52
  • 78
2
votes
3 answers

Got the output as 0 Scenarios when run the test runner

I am trying to run some test as part of learing cucumber. But I got the result as 0 scenarios. Here I am adding the code I have written: Login.feature with- Feature: Application Login S Scenario : Home page default login Given User is on Net…
2
votes
5 answers

Cucumber .feature file is not getting linked to stepDefinition.java in Eclipse

I have installed Natural 0.7.6 plug-in from eclipse marketplace and I have Windows 10. Eclipse version: Eclipse IDE for Java Developers Version: 2020-03 (4.15.0) Build id: 20200313-1211 Maven dependencies related to Cucumber:
user3166602
  • 31
  • 1
  • 1
  • 3
2
votes
2 answers

Can you save a result (Given) to a variable in a Gherkin feature file, and then compare the variable with another result (Then)? (Cucumber for Java)

I am new to Cucumber for Java and trying to automate testing of a SpringBoot server backed by a MS SQL Server. I have an endpoint "Get All Employees". Writing the traditional feature file, I will have to list all the Employees in the @Then…
likejudo
  • 3,396
  • 6
  • 52
  • 107
2
votes
1 answer

Cucumber undefined step reference in Intellij

I have problem with Intellij 2019.2.4 Ultimate where I am unable to navigate from Cucumber feature file to glue code. Intellj is complaining of "Undefined Step Reference". Executing the cucumber test from console or via run configuration is however…
MrM
  • 389
  • 1
  • 8
  • 23
2
votes
2 answers

Problems with the variable Webdriver driver when I use PageObjects

I want to use: Login_Page Login = PageFactory.initElements(driver, Login_Page.class); in a unique way in all steps. When I use it for each step I have no problems, but on the contrary Java shows me the error: " Value driver is always 'null'". I…
2
votes
2 answers

Cucumber: Why do I fail to pass Java enum value?

Given the following code: public enum Roles { ADMIN("admin"), OPERATOR("operator"), SYSTEM_ADMIN("system-admin"), SYSTEM_VIEWER("system-viewer"), TENANT_ADMIN("admin"), TENANT_OPERATOR("operator"), …
dushkin
  • 1,939
  • 3
  • 37
  • 82
2
votes
1 answer

How to configure PicoContainer in Cucumber?

I would like to manually configure my picocontainer to have configured instances of configuration objects for my cucumber build. I.E, providing configuration objects a-la @ConfigurationProperties in Spring. However, it is not clear how to do so.…
Snappawapa
  • 1,697
  • 3
  • 20
  • 42