pytest-bdd
pytest-bdd copied to clipboard
Pytest-bdd scenario- how to stop execution based on previous scenario failure
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.
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