This is a practical scenario we are facing in using karate for testing -
We have a graph API which we test using karate.
Imagine this - each karate feature creates a parent and child nodes in graph to validate certain business logic.
Then imagine that there's a suite of 100 tests which means 100 small graphs are created (database records).
We want to cleanup all of these 100 small graphs to avoid polluting the system with stale test data.
Could anyone suggest a cleanup strategy here? AfterFeature which is supposed to help in cleanup is of no use because there's no state/variable sharing between any 2 features i.e. we would never know the IDs of the parents/children who were created in previous feature
Assigning values to a global variable(defined in Background section) in each Scenario also gets reset and can not maintain IDs to be cleaned up.