Behave – Feature Testing Setup

Behave - Feature Testing Setup

In this chapter, we will discuss Behave feature testing setup works with three different file types, which are as follows −

  • Feature files which are created by a Business analyst or any project stakeholder and contains behaviour related use cases.
  • Step Implementation file for the scenarios defined in the feature file.

Behave Feature Testing Setup File

Also, there should be a sub-directory step within the features directory.

Behave - Feature Testing Setup

Launching Feature file

We can launch the feature file with various command-line arguments. Explained below −

  • If the path of the features directory is provided, then it is mandatory to have at least one feature file (with .feature extension) and a sub-directory named steps within the features directory.
  • Also, if the environment.py is present, it should be within the directory that has the steps directory and not within the steps directory.
  • If the path to a feature file is provided, then it instructs Behave to search for it.
  • If not found in the current parent directory, then it searches its parents. This shall continue until it reaches the file system root. Also, if the environment.py is present, it should be within the directory that has the steps directory and not within the steps directory.

Next Topic – Click Here

This Post Has One Comment

Leave a Reply