Skip to content Skip to sidebar Skip to footer

Pytest-bdd: Importing Common Steps

Edit: I am no longer working on this project, but I will leave this question open until answered in case it is of use to anyone. I am working on implementing pytest-bdd and I am tr

Solution 1:

Add the following lines inside your conftest.py

pytest_plugins = [
   "lib.ui_shared"
]

This way all fixtures or pytest-bdd steps inside ui_shared.py will be available to every other file as if it was inside conftest.py

NOTElib must be a package, meaning there should be a __init__.py file inside the lib folder

Solution 2:

You can try something like this:

from .ui_fileimport *

That is what I wrote for my project:

from .devices_stepsimport *

Post a Comment for "Pytest-bdd: Importing Common Steps"