https://cypress.io logo
Hello, I just joined the cypress world ~1.5 months...
# best-practices
b
Hello, I just joined the cypress world ~1.5 months ago and I have a question that I was hoping one of you guys might answer. So here it is.. I have to create custom test data for an SAP/ERP application and analyzing the possibilities, also highlighted by @gray-kilobyte-89541, I decided that the one that fits the most is by using the API's to create it then at the end of each test run delete it by using the DELETE endpoint of these api's. Now, when we create custom data via the API's usually the body of the api contains the json object in a custom shape (representing the data). I am therefore not sure what is the best way of keeping this data because as I see I have two alternatives: 1. either use constants to define an object in JS (export const paymentCodeData = {}) 2. use simple JSON files and append them to a method's param that represents the body in a for each loop How do you do it? How do the fixtures play a role in this given that the data will be created via an api (POST) then read the data in via a GET and at the end use the created data retrieved with the GET request? Many thanks in advance!