pytest-bdd
pytest-bdd copied to clipboard
Background steps stopped working after adding another Given - StepDefinitionNotFoundError
- put common steps out of feature step_def file for re-usability purposes
- run tests
Result: step definitions are not found. IDE (like Pycharm) has no problem to localize these steps. pytest-bdd can see common steps only in conftest.py. In case to place them to any other file with completely correct definitions (like common_steps.py), it is not working.
you should import those steps in your conftest.py:
# conftest.py
from tests.common_steps import *
you should import those steps in your conftest.py:
# conftest.py from tests.common_steps import *
thanks a lot, very useful for me