Step definitions not found when using centralized test_features.py with scenarios("features") #787
Unanswered
fatemeh137326
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi pytest-bdd team,
I'm running into an issue with step definitions not being found when using a centralized test_features.py to include all feature files.
My project structure is as follows:
integration_test/
├─ pytest.ini
├─ conftest.py
└─ tests/
├─ test_features.py
├─ features/
│ ├─ user/
│ │ ├─ user_login.feature
│ │ └─ user_profile.feature
│ └─ group/
│ └─ create_group.feature
├─ steps/
│ ├─ user_login_steps.py
│ ├─ user_profile_steps.py
│ ├─ group_steps.py
│ └─ common_steps.py
└─ manager/
└─ user/
├─ test_add_user.py
└─ test_edit_user.py
In test_features.py I have
When I run pytest, I get:
step definition is not foundHowever, if I move the feature files into the same folder as their corresponding test file and prefix the test files with test_, everything works as expected.
My expectation is that using a centralized test_features.py with scenarios("features") should discover all steps automatically, since my test file starts with test_.
I'm using:
pytest-bdd>=7.0.0Could you clarify if this is the intended behavior, or if I'm missing something in the project structure or configuration?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions