bdd, cucumber framework code example

Example 1: components of cucumber bdd framework

Feature Files,
Cukes Runner,
Step Definition,
Pages

Example 2: components of Cucumber BDD framework

Cucumber is a tool for running automated acceptance tests 
written in a behavior driven development style. 
One of its wonderful main features is the ability to execute 
plain text functional description (written in language named Gherkin) 
as automated tests.
Feature Files,
Cukes Runner,
Step Definition,
Pages
1.Feature files 
Consists of scenarios that test a certain feature or functionality 
Feature is main story while scenarios are the test cases to the story(feature) 
2.Cukes Runner 
A class that strictly runs the tests, generates codes for step definition 
@smoketest 
3. Step definition 
A class that made of steps that starts withGherkin language 
Make sure the step definition is in the same package as cukes Runner, 
or child package (not parent or sibling)
4.Pages 
I have a Pages package where I identify and store web elements variables
and methods for each page of my application.
I also use PageFactory pattern to instantiate 
my web elements by using @FindBy

Tags:

Misc Example