My automated tests (at the GUI/API levels) require to have already existing test data - like users or privileges assigned to them. I want them to be stable and able to run independently every time so I cannot hardcode this data. Also, I wouldn't like to create them as a part of test as it could make my tests more brittle.
Lets assume that a system is a basic CRUD for books management. I'd like to automate test case like "modify book name". In order to do this, first I need to have already created book and user with privilege to modify it. Similar situation occurs for most of other test cases.
Should I prepare this test data before tests, e.g. using API interface? Or maybe I should mock it somehow?