pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

Pytest-bdd scenario- how to stop execution based on previous scenario failure

Open idea1002 opened this issue 4 years ago • 1 comments
trafficstars

Is there a way to execute pytest-bdd scenario only if previous scenario passed and skip execution if previous scenario failed.

For example: I have 2 pytest-bdd scenarios (Scn A and Scn B) with same marker as @set1 . I execute tests using this tag I want to stop execution of second scenario Scn B if Scn A failed.

idea1002 avatar Nov 03 '21 12:11 idea1002

Please check pytest plugin https://pytest-dependency.readthedocs.io/en/stable/usage.html In your case, you have to inject two tests by "scenario" and mark result tests as dependent. This has to work, but in case if wouldn't - please provide info

elchupanebrej avatar Jan 01 '22 23:01 elchupanebrej