Configuring the naming conventions

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.

How to do it…

  1. If you want to use camel case, then add the following code to @CucumberOptions:
    snippets=SnippetType.CAMELCASE
  2. If you want to use underscore, then add the following code to @CucumberOptions.
    snippets=SnippetType.UNDERSCORE
  3. This is what the code for RunCukeTest.Java ...

Get Cucumber Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.