Cucumber Options And Their Parameters
- Testing acharya
- Jul 2, 2021
- 1 min read
Updated: Jul 17, 2021
Lets first discuss about JUnit TestRunner file. It has an extension of .java. The main purpose of testrunner class is to link step definition and the features file. The TestRunner class will use the Junit annotation @RunWith(), which tells JUnit what is the test runner class.

First import statement ‘org.junit.runner.RunWith‘ imports @RunWith annotation from the Junit class. @RunWith annotation tells JUnit that tests should run using Cucumber class present in ‘Cucumber.api.junit‘ package.
Second import statement ‘cucumber.api.CucumberOptions‘ imports the @CucumberOptions annotation. This annotation tells Cucumber a lot of things like where to look for feature files, what reporting system to use and some other things also. But as of now in the above test, we have just told it for the Feature file folder.
@CucumberOptions are like property files or settings for your test. Basically it enables us to do all the things that we could have done if we have used cucumber command line.

Comments