Closed chunji08 closed 10 months ago
Does it work fine without parallel execution? And how to you share the steps? I can not seem to make it work to have an individual step in each py file and still share it with another feature file in a scenario decorator. Would also be interesting, if you share the steps via conftest or imported module, whatever is the other option of what you have implemented.
From what I understand this should not work without parallel either.
Sharing steps in pytest-bdd
can be tricky, you need to import the step functions in your test_x.py
for them to be available in x.future
. The issue for me was when I imported steps from a file that has scenario("...feature")
in it, resulted in tests running twice.
My solution was to defined feature steps in another file next to test_x.py
and import all steps.py
files in conftest.py
- which made all steps available on any feature file across my project, beside those in test_x.py
(which I use for assertions on x.feature
only). I have made a small project in my github showing this.
please provide an MVCE to reproduce the issue, otherwise I won't be able to help.
Closing this until you can provide more info.
BACKGROUND:
I am exploring the possibility to use this framework for my scalability checking on my project.
DETAILS:
let's say I have these 2 feature file, which are checking different key-word on the DuckDuckGo page.
panda.feature
goose.feature
And I want to have both cases executed in parallel way.
These are the extra steps:
"scenarios('../features/panda.feature')"
"scenarios('../features/goose.feature')"
So I did, and both test feature are executed in parallel.
But what I have realized is, although there is only the searching key-word difference in both cases, they could not share the same python step file, if I want both cases running in parallel ?
comments ?
Thanks,
Jack