- Add Cucumber dependencies to pom.xml
- In test/resources create the feature file. Feature is the behavior which is implementation of user story.
- Write the feature file. With details like Feature, Scenario: Given When Then
Feature: FizzBuzz Game play
Scenario: Play FizzBuzz to get Fizz
Given Create a FizzBuzz game play
When I play with number 3
Then The result is "Fizz"
Scenario: Play FizzBuzz to get Buzz
Given Create a FizzBuzz game play
When I play with number 5
Then The result is "Buzz"
Scenario: Play FizzBuzz to get FizzBuzz
Given Create a FizzBuzz game play
When I play with number 15
Then The result is "FizzBuzz"
- Create Step definitions. These are steps for each steps written in feature file like given, when, then.
- Use IntelliJ feature to create step definition for each steps.
- Add logic to each step definition.