@camunda/e2e-test-suite 0.0.338 → 0.0.340
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/deleteOrg.js +18 -0
- package/package.json +1 -1
package/dist/utils/deleteOrg.js
CHANGED
|
@@ -42,5 +42,23 @@ async function deleteOrganization(page, uuid) {
|
|
|
42
42
|
throw new Error(`Failed to delete organization. Status: ${deleteResponse.status()}. Response: ${errorBody}`);
|
|
43
43
|
}
|
|
44
44
|
console.log(`Organization with UUID ${uuid} deleted successfully.`);
|
|
45
|
+
// Verify the organization is actually deleted by checking it returns 404
|
|
46
|
+
const maxRetries = 3;
|
|
47
|
+
const retryDelay = 5000;
|
|
48
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
49
|
+
await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
50
|
+
const verifyResponse = await page.request.delete(deleteUrl, {
|
|
51
|
+
headers: {
|
|
52
|
+
'Content-Type': 'application/json',
|
|
53
|
+
Authorization: `Bearer ${token}`,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
if (verifyResponse.status() === 404) {
|
|
57
|
+
console.log(`Verified: organization ${uuid} is deleted (404 on attempt ${attempt}).`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
console.log(`Organization ${uuid} still exists (status ${verifyResponse.status()}), retry ${attempt}/${maxRetries}...`);
|
|
61
|
+
}
|
|
62
|
+
throw new Error(`Organization ${uuid} could not be deleted after ${maxRetries} verification attempts`);
|
|
45
63
|
}
|
|
46
64
|
exports.deleteOrganization = deleteOrganization;
|