Lets say I have a set of tests which depends on a precondition.
Should I automate the precondition or manually perform the precondition data?
If I automate the precondition test and execute them before all dependent tests there is a problem that what if the precondition test itself failed due to some reason. So in that case all my dependent tests will fail.
Also even if precondition tests goes thorough and dependent tests passes, I still need to delete or reset my system, else I will have end of having lots of test data which is again a difficult task to manage.
What if my reset / delete test fails. How should I approach these challenges?
-- Update from comments --
Here is my test flow
- Create a Template.
- Link template to some Petition.
- Verify It is Linked.
If I create an independent test all 3 steps have to be included. But since I may have to run my test multiple times I will end up having lots of templates.
The other approach, to verify the linking part on a predefined template and unlink the petition to to avoid multiple creation but in this case what if unlinking fails? So next time when I come and try to link it will already be linked.