Behave – Exclude Tests

Behave - Exclude Tests

We can Behave exclude tests the executing files by their filename from execution.

Suppose, we have more than one feature file within the features folder. The following screen can be seen on the computer −

Behave - Exclude Tests

On executing the command behave exclude tests, the output will be as follows −

Behave - Exclude Tests

If we have to only run the feature file Payment. feature and exclude Payment1.feature, we have to pass the command line argument –e or –exclude followed by the pattern of the regular expression.

On executing the command behave –exclude *1.feature, the output is as follows −

Behave - Exclude Tests

The output shows one feature passed along with the Payment. feature file name. Also, Payment1.feature is not included in the run.

Next Topic – Click Here

This Post Has 2 Comments

  1. Looking forward to reading more. Great article post.Really looking forward to read more. Keep writing.

Leave a Reply