I want to create a series of tests that can run sequentially, the idea is that if the test before the one running does not pass, then all the suite shall not pass.
It sounds as anti pattern, but I need to test that user flow.
I tried with datasets but it restart the flow each time it runs the test.
I am not sure if what I am going to share is what you are looking for. You have to use
@depends
, that will allow you to not run a test when the test it depends on did not pass.This is the official documentation about it.
This is an example:
If
test_user_is_saved
fails,test_error_is_thrown_on_invalid_input
will not be run. You can chain this with any test.