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 ...

Get Cucumber Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.