lundi 21 décembre 2020

How can I save API response body or property in an environment variable or json to use it later in other requests in Cypress

API runs locally(and in future in a circleCI container) so I don't need to stub responses, only real requests and real responses.

When I send a POST request, it creates an event and returns a big response body containing a unique ID. I need to store that unique ID somewhere(as env variable, json or worst case scenario a const) so that I can access and use it in UPDATE request later and in the end in DELETE request to delete that Event from the system.

Is there a way to do this?

There is a way to retrieve that ID from the DB, but I really don't want to do it that way

Aucun commentaire:

Enregistrer un commentaire