automated-testscypressweb-api-testing

Handle DELETE request in Cypress API Test


I have some confusion about API automation testing in Cypress. If we use a real database to handle the DELETE request without mocking data, How to test with the same data set to run the tests again or how it works in ci/cd?

I tried to mock data and test but it does not seem to be the best way to test some complex queries. Could any one give me any solution on this?


Solution

  • If you desire to run E2E tests, to be as consistent as possible, you need to always have the same initialization of the data.

    To get always the same data, you have multiple options. I will only present 3 possible solutions:

    Of course, there is many other possiblities