how to use background in cucumber code example

Example 1: background in cucumber

Background in Cucumber is used to define
a step or series of steps which are common 
to all the tests in the feature file.
It allows you to add some context to the 
scenarios for a feature where it is defined.
A Background is much like a scenario containing 
a number of steps. But it runs before 
each and every scenario where for a feature in which it is defined.

Example 2: what is background in cucumber

Background in Cucumber is used to define
a step or series of steps which are common 
to all the tests in the feature file.
It allows you to add some context to the 
scenarios for a feature where it is defined.
A Background is much like a scenario containing 
a number of steps. But it runs before 
each and every scenario where for a feature in which it is defined.

Tags:

Misc Example