This is a test-authoring question about how to organize tests. I have a dozen examples of places where I want to go through a data-creation process (users, forms, etc.) but I want to test and validate 3 things:
- Successful creation
- Failed creation (expecting certain blocks/failures)
- Random data input (conditionally reacting to success or failures)
Should I be creating different tests for every single kind of scenario, so that each test has only one particular purpose, or is it good practice to have a single test that has IF/ELSE blocks to handle successes and failures based on data-driven input? My programming instincts are telling me to stick with single-purpose cohesive tests, nesting them with "Test As Step" when needed, but my ease-of-use side is making me think it's a reasonable solution to have fairly conditional tests rather than creating a vast number of tests handling every unique situation.
...or maybe it's a hybrid case-by-case thing that I have to evaluate based on the application's testing needs?
Any advice is welcome!
-Steve