1

I have POST requests in my tests and resources are created with dynamic id, which I have to delete at the end of scenarios. If I put the appropriate delete call at the end of the scenario, and any assertion fails during execution of the scenario, the POST request succeeds, the item gets created but the test stops execution at the failed assertion, so the created item won't be deleted. Also I can't pass any data to afterScenario from within scenarios, so I really don't have any idea besides writing the ids to a file and read them for a delete feature in afterScenario. Any other suggestion?

0 Answers0