As Cucumber can be implemented in multiple languages, developers with multiple language knowledge and background can work on the same project. So, sometimes it might be difficult for teams to manage the naming conventions, such as underscore or camel case.
Cucumber lets the team choose the naming convention. Depending on the naming convention, Cucumber generates the method names for Step Definitions. Let's see how it can be done in the next section.
If you want to use camel case, then add the following code to
@CucumberOptions
:snippets=SnippetType.CAMELCASE
If you want to use underscore, then add the following code to
@CucumberOptions
.snippets=SnippetType.UNDERSCORE
This is what the code for
RunCukeTest.Java
looks like:package com.CucumberOptions; import org.junit.runner.RunWith; import Cucumber.api.CucumberOptions; import Cucumber.api.SnippetType; import Cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( Features ...