+let createdResources = [];
+
+// Clean up on a 'before' hook to allow post-mortem analysis on individual tests.
+beforeEach(function () {
+ if (createdResources.length === 0) {
+ return;
+ }
+ cy.log(`Cleaning ${createdResources.length} previously created resource(s)`);
+ createdResources.forEach(function({suffix, uuid}) {
+ // Don't fail when a resource isn't already there, some objects may have
+ // been removed, directly or indirectly, from the test that created them.
+ cy.deleteResource(systemToken, suffix, uuid, false);
+ });
+ createdResources = [];
+});