- Scenario outline:
The Scenario Outline keyword can be used to run the same Scenario multiple times, with different combinations of values.
- Background:
Since it is repeated in every scenario, this is an indication that those steps are not essential to describe the scenarios. You can literally move such Given steps to the background, by grouping them under a Background section.
- Monochrome:
Display console output in readable way
- Glue:
it helps Cucumber to locate theStep Definition file.Whenever Cucumber encounters a Step, it looks for a Step Definition inside all the files present in the folder mentioned in Glue Option.
- Feature:
- plugin:
plugin Option is used to specify different formatting options for the output reports.
- Format:
It will define the format of the reports. Options are pretty,html,json,junit.
Note – Format option is deprecated . Use Plugin in place of that.
- RunWith:
This is a JUnit annotation that specifies which runner it has to use to execute this class
- CucumberOptions:
This annotation provides some important information which will be used to run your cucumber feature file.
- Given:
It is for pre condition
- When:
- Then:
It defines the expected result.
- Add:
- But:
It is used to add negative type comments
- Strict:
- dryRun: Check if all steps have step definition
- tag:
The tags can be used when specifying what tests to run through any of the running mechanism.
@RunWith(Cucumber.class)
@CucumberOptions(
features = “src/test/“,
tags ={“@Web“},... )
Cucumber can exclude scenarios with a particular tag by inserting the tilde character before the tag.
For the following command will run all Scenarios without the UI tag.
@RunWith(Cucumber.class)
@CucumberOptions(
features = “src/test/features“,
tags ={“~@UI“},... )
Want to learn more ! Below is the best interview question for Docker:
This comment has been removed by a blog administrator.
ReplyDelete