Background:
- I am setting up an automation framework
- Brand new project (i.e. no scripts)
(clarification: brand new project as in everything is brand new, new db, new code, new automation, everything - yay new projects!) - Stack is Java/Javascript/Mongo
I want these tests to be fast and independent. So I will be testing one item at a time. The question comes in when there's something I need existing data for. I cannot restore databases for these tests, so a DB snapshot is out of the question.
Example scripts:
- create user
- create new entry from a newly created user
The Questions:
Should I try to get developers to setup an API method for testing, or create a SQL query to just create the data. My gut reaction is that I don't want to run SQL queries like that to insert and delete data. But I am not sure I can justify asking for those API methods to be created.
What are the pitfalls/benefits of each way? Is there any other way to accomplish it other than running another 'create user' script before 'create new entry from a newly created user'?