Book Image

Cucumber Cookbook

By : Shankar Garg
Book Image

Cucumber Cookbook

By: Shankar Garg

Overview of this book

Table of Contents (13 chapters)
Cucumber Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running Cucumber from the Terminal


Now we have integrated Cucumber with Maven, running Cucumber from the Terminal will not be a problem. Running any test framework from the Terminal has its own advantages, such as overriding the run configurations mentioned in the code.

So how do we run Cucumber test cases from the Terminal? Let's find out in our next section.

How to do it…

  1. Open the command prompt and cd until the project root directory.

  2. First, let's run all the Cucumber Scenarios from the command prompt. Since it's a Maven project and we have added Cucumber in test scope dependency and all features are also added in test packages, run the following command in the command prompt:

    mvn test
    

    This is the output:

  3. The previous command runs everything as mentioned in the JUnit Runner class. However, if we want to override the configurations mentioned in the Runner, then we need to use following command:

    mvn test –DCucumber.options="<<OPTIONS>>"
    
  4. If you need help on these Cucumber options...