Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

ci(cypress): remove Create Business Profile from 43-DynamicFields test cases (#11862)

HS-QUALIBOT9af7e7d78c2b
diff --git a/cypress-tests/cypress/e2e/spec/Payment/43-DynamicFields.cy.js b/cypress-tests/cypress/e2e/spec/Payment/43-DynamicFields.cy.js
index d3bf75525c..0058b484d5 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/43-DynamicFields.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/43-DynamicFields.cy.js
@@ -12,8 +12,9 @@ describe("Dynamic Fields Verification", () => {
});
});
- after("flush global state", () => {
+ after("flush global state and cleanup", () => {
cy.task("setGlobalState", globalState.data);
+ cy.deleteBusinessProfileTest(globalState);
});
context(
@@ -171,4 +172,3 @@ describe("Dynamic Fields Verification", () => {
});
});
});
-1;
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index fb5f7f3f1e..94c7ef28c9 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -255,6 +255,42 @@ function createUcsConfigs(globalState, flow, type) {
});
}
+Cypress.Commands.add("deleteBusinessProfileTest", (globalState) => {
+ const apiKey = globalState.get("apiKey");
+ const baseUrl = globalState.get("baseUrl");
+ const profileId = globalState.get("profileId");
+ const merchantId = globalState.get("merchantId");
+ const url = `${baseUrl}/account/${merchantId}/business_profile/${profileId}`;
+
+ if (!profileId) {
+ cy.log("No profileId found in globalState, skipping delete");
+ return;
+ }
+
+ cy.request({
+ method: "DELETE",
+ url: url,
+ headers: {
+ Accept: "application/json",
+ "Content-Type": "application/json",
+ "api-key": apiKey,
+ },
+ failOnStatusCode: false,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ cy.log(`Business profile ${profileId} deleted successfully`);
+ } else {
+ cy.log(
+ `Failed to delete business profile: ${response.body.error?.message || response.statusText}`
+ );
+ }
+ });
+ });
+});
+
function storeRequestId(xRequestId, globalState) {
if (xRequestId && globalState) {
// Get existing request IDs array or initialize empty array