0

I'm currently implementing a behavior driven API test automation using Pytest with Pytest-bdd. My folder structure looks likes this

C:.
│   config.json
│   geckodriver.log
│   __init__.py    
├───.vscode
│       settings.json
│
├───features
│   |   test_scenarios1.feature
|   |   test_scenarios2.feature
│   |   test_scenarios3.feature
|
├───step_defs
│   │   conftest.py
│   │   givens.py
│   │   whens.py
│   │   thens.py
│   │   test_main.py

Using pytest with just one "test_main.py"

from pytest_bdd import scenarios  

scenarios('../features')

file will lead to pytest organizing the test in such a way

step_defs
│   test_a -- from test_scenarios3.feature
│   test_b -- from test_scenarios1.feature
│   test_c -- from test_scenarios2.feature
│   test_d -- from test_scenarios1.feature

I would like to have them organized like this

step_defs
│
├───test_scenarios1
│   |   test_b
|   |   test_d
|
├───test_scenarios2
│   |   test_c
|   
├───test_scenarios3
│   |   test_a

Is there any way apart of implementing test_scenarious1.py, test_scenarious2.py, test_scenarious3.py with the scenarios referenced in the specific file

Jose Manuel de Frutos
  • 1,040
  • 1
  • 7
  • 19
s kop
  • 196
  • 4
  • 18

0 Answers0