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

refactor(cypress): unify fixtures in tests & follow conventions (#5180)

Pa1NarK1adcf0150458
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js
index 821a22bed3..5753421a74 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js
@@ -1,6 +1,5 @@
-import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
-import merchantCreateBody from "../../fixtures/merchant-create-body.json";
import State from "../../utils/State";
+import * as fixtures from "../../fixtures/imports";
let globalState;
describe("Account Create flow test", () => {
@@ -15,10 +14,10 @@ describe("Account Create flow test", () => {
});
it("merchant-create-call-test", () => {
- cy.merchantCreateCallTest(merchantCreateBody, globalState);
+ cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState);
});
it("api-key-create-call-test", () => {
- cy.apiKeyCreateTest(apiKeyCreateBody, globalState);
+ cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState);
});
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js
index d51a2f78ae..cfc55ceef9 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js
@@ -1,4 +1,4 @@
-import customerCreateBody from "../../fixtures/create-customer-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
let globalState;
@@ -15,6 +15,6 @@ describe("Customer Create flow test", () => {
});
it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js
index 439850d4cc..0174fd4ef6 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js
@@ -1,4 +1,4 @@
-import createConnectorBody from "../../fixtures/create-connector-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
import { payment_methods_enabled } from "../PaymentUtils/Commons";
@@ -16,7 +16,7 @@ describe("Connector Account Create flow test", () => {
it("connector-create-call-test", () => {
cy.createConnectorCallTest(
- createConnectorBody,
+ fixtures.createConnectorBody,
payment_methods_enabled,
globalState
);
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js
index 49250e68d6..e8c719cebc 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js
@@ -1,9 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -34,7 +31,7 @@ describe("Card - NoThreeDS payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -55,7 +52,13 @@ describe("Card - NoThreeDS payment flow test", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -82,7 +85,7 @@ describe("Card - NoThreeDS payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js
index c9fb1339b1..91dc2b1c38 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js
@@ -1,8 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -32,7 +30,7 @@ describe("Card - ThreeDS payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -53,13 +51,19 @@ describe("Card - ThreeDS payment flow test", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js
index bcd65753ac..6a74e6fb91 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js
@@ -1,10 +1,6 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -36,7 +32,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -59,7 +55,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -75,7 +77,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -103,7 +111,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -125,7 +133,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -155,7 +169,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -179,7 +193,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.confirmCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -199,7 +213,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
]["PartialCapture"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -227,7 +247,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -249,7 +269,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
index 35f230a3f5..9735a74adf 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
@@ -1,8 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import voidBody from "../../fixtures/void-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -33,7 +31,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -56,7 +54,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -67,7 +71,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.voidCallTest(voidBody, req_data, res_data, globalState);
+ cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -91,7 +95,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -112,7 +116,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
]["Void"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.voidCallTest(voidBody, req_data, res_data, globalState);
+ cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -137,7 +141,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -160,7 +164,13 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, false, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ false,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -171,7 +181,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
]["Void"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.voidCallTest(voidBody, req_data, res_data, globalState);
+ cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js
index 2d6174efbb..95d86a6227 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js
@@ -1,8 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -31,7 +29,7 @@ describe("Card - Sync payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -54,7 +52,13 @@ describe("Card - Sync payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
index 857584fd1b..70157e06ec 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
@@ -1,13 +1,6 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import listRefundCall from "../../fixtures/list-refund-call-body.json";
-import refundBody from "../../fixtures/refund-flow-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -38,7 +31,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -61,7 +54,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -76,7 +75,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -109,7 +114,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -132,7 +137,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -147,7 +158,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 1200,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -158,7 +175,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 1200,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -194,7 +217,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -215,7 +238,13 @@ describe("Card - Refund flow - No 3DS", () => {
]["Refund"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -252,7 +281,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -273,7 +302,13 @@ describe("Card - Refund flow - No 3DS", () => {
]["PartialRefund"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 3000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -284,7 +319,13 @@ describe("Card - Refund flow - No 3DS", () => {
]["PartialRefund"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 3000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -318,7 +359,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -341,7 +382,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -357,7 +404,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -372,7 +425,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -405,7 +464,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -428,7 +487,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -444,7 +509,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -459,7 +530,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 3000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -469,7 +546,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 3000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -485,7 +568,7 @@ describe("Card - Refund flow - No 3DS", () => {
should_continue = utils.should_continue_further(res_data);
});
it("list-refund-call-test", () => {
- cy.listRefundCallTest(listRefundCall, globalState);
+ cy.listRefundCallTest(fixtures.listRefundCall, globalState);
});
});
@@ -505,7 +588,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -528,7 +611,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -544,7 +633,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -559,7 +654,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -592,7 +693,7 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -615,7 +716,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -631,7 +738,13 @@ describe("Card - Refund flow - No 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -646,7 +759,13 @@ describe("Card - Refund flow - No 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -682,7 +801,7 @@ describe("Card - Refund flow - No 3DS", () => {
let res_data = data["Response"];
console.log("det -> " + req_data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -697,7 +816,7 @@ describe("Card - Refund flow - No 3DS", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -707,7 +826,7 @@ describe("Card - Refund flow - No 3DS", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -721,7 +840,13 @@ describe("Card - Refund flow - No 3DS", () => {
]["Refund"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 7000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 7000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -767,7 +892,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -788,13 +913,19 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -808,7 +939,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -841,7 +978,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -863,13 +1000,19 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -883,7 +1026,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 1200,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -894,7 +1043,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 1200,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -927,7 +1082,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"three_ds",
@@ -939,7 +1094,7 @@ describe("Card - Refund flow - 3DS", () => {
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -953,7 +1108,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -988,7 +1149,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"three_ds",
@@ -1000,7 +1161,7 @@ describe("Card - Refund flow - 3DS", () => {
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -1014,7 +1175,13 @@ describe("Card - Refund flow - 3DS", () => {
]["PartialRefund"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 3000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1025,7 +1192,13 @@ describe("Card - Refund flow - 3DS", () => {
]["PartialRefund"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 3000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1059,7 +1232,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -1081,13 +1254,19 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -1101,7 +1280,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1116,7 +1301,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1149,7 +1340,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -1171,13 +1362,19 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -1191,7 +1388,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1206,7 +1409,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 5000, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 5000,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1216,7 +1425,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 1500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1249,7 +1464,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -1271,13 +1486,19 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -1291,7 +1512,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1306,7 +1533,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1339,7 +1572,7 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -1361,13 +1594,19 @@ describe("Card - Refund flow - 3DS", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -1381,7 +1620,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -1396,7 +1641,13 @@ describe("Card - Refund flow - 3DS", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 50, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 50,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js
index 630f8e7070..617a0e721b 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js
@@ -1,9 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import refundBody from "../../fixtures/refund-flow-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -33,7 +30,7 @@ describe("Card - Sync Refund flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -56,7 +53,13 @@ describe("Card - Sync Refund flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -71,7 +74,13 @@ describe("Card - Sync Refund flow test", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00010-CreateSingleuseMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00010-CreateSingleuseMandate.cy.js
index b03b74e2da..5c14091382 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00010-CreateSingleuseMandate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00010-CreateSingleuseMandate.cy.js
@@ -1,9 +1,6 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -38,7 +35,7 @@ describe("Card - SingleUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -53,7 +50,7 @@ describe("Card - SingleUse Mandates flow test", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -83,7 +80,7 @@ describe("Card - SingleUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -103,14 +100,20 @@ describe("Card - SingleUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
6500,
true,
"manual",
@@ -125,7 +128,13 @@ describe("Card - SingleUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -156,7 +165,7 @@ describe("Card - SingleUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -176,14 +185,20 @@ describe("Card - SingleUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js
index b7ca7b1493..3596af70fe 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js
@@ -1,9 +1,6 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -38,7 +35,7 @@ describe("Card - MultiUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -53,7 +50,7 @@ describe("Card - MultiUse Mandates flow test", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -62,7 +59,7 @@ describe("Card - MultiUse Mandates flow test", () => {
});
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -92,7 +89,7 @@ describe("Card - MultiUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -112,14 +109,20 @@ describe("Card - MultiUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT 1", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
6500,
true,
"manual",
@@ -134,14 +137,20 @@ describe("Card - MultiUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT 2", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
6500,
true,
"manual",
@@ -156,7 +165,13 @@ describe("Card - MultiUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -183,7 +198,7 @@ describe("Card - MultiUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -203,14 +218,20 @@ describe("Card - MultiUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
6500,
true,
"automatic",
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js
index 29327cc039..9091135d53 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js
@@ -1,9 +1,6 @@
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
-
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -38,7 +35,7 @@ describe("Card - SingleUse Mandates flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -53,7 +50,7 @@ describe("Card - SingleUse Mandates flow test", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js
index ef9f47d262..f4d479bbdd 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js
@@ -1,12 +1,7 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import customerCreateBody from "../../fixtures/create-customer-body.json";
-import SaveCardConfirmBody from "../../fixtures/save-card-confirm-body.json";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
+
let globalState;
describe("Card - SaveCard payment flow test", () => {
@@ -28,7 +23,7 @@ describe("Card - SaveCard payment flow test", () => {
});
it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("create+confirm-payment-call-test", () => {
@@ -38,7 +33,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -64,7 +59,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -82,7 +77,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.saveCardConfirmCallTest(
- SaveCardConfirmBody,
+ fixtures.saveCardConfirmBody,
req_data,
res_data,
globalState
@@ -105,7 +100,7 @@ describe("Card - SaveCard payment flow test", () => {
});
it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("create+confirm-payment-call-test", () => {
@@ -115,7 +110,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -141,7 +136,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -159,7 +154,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.saveCardConfirmCallTest(
- SaveCardConfirmBody,
+ fixtures.saveCardConfirmBody,
req_data,
res_data,
globalState
@@ -178,7 +173,13 @@ describe("Card - SaveCard payment flow test", () => {
]["Capture"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -197,7 +198,7 @@ describe("Card - SaveCard payment flow test", () => {
});
it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("create+confirm-payment-call-test", () => {
@@ -207,7 +208,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -233,7 +234,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -251,7 +252,7 @@ describe("Card - SaveCard payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.saveCardConfirmCallTest(
- SaveCardConfirmBody,
+ fixtures.saveCardConfirmBody,
req_data,
res_data,
globalState
@@ -269,7 +270,13 @@ describe("Card - SaveCard payment flow test", () => {
]["PartialCapture"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 100,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js
index af3aff9408..a6e085658c 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js
@@ -1,8 +1,6 @@
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -35,7 +33,7 @@ describe("Card - SingleUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
0,
@@ -50,7 +48,7 @@ describe("Card - SingleUse Mandates flow test", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -77,7 +75,7 @@ describe("Card - SingleUse Mandates flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
0,
@@ -92,7 +90,7 @@ describe("Card - SingleUse Mandates flow test", () => {
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
@@ -101,7 +99,7 @@ describe("Card - SingleUse Mandates flow test", () => {
});
it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
- mitConfirmBody,
+ fixtures.mitConfirmBody,
7000,
true,
"automatic",
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js
index 2d11186247..3c9fca1428 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js
@@ -1,10 +1,7 @@
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import getConnectorDetails from "../PaymentUtils/utils";
-import State from "../../utils/State";
import captureBody from "../../fixtures/capture-flow-body.json";
-import * as utils from "../PaymentUtils/utils";
+import * as fixtures from "../../fixtures/imports";
+import State from "../../utils/State";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -36,7 +33,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -57,13 +54,19 @@ describe("Card - ThreeDS Manual payment flow test", () => {
]["3DSManualCapture"];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmCallTest(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -103,7 +106,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"three_ds",
@@ -115,7 +118,8 @@ describe("Card - ThreeDS Manual payment flow test", () => {
});
it("Handle redirection", () => {
- let expected_redirection = createConfirmPaymentBody["return_url"];
+ let expected_redirection =
+ fixtures.createConfirmPaymentBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -159,7 +163,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -181,7 +185,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -192,7 +196,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {
});
it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -232,7 +236,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"three_ds",
@@ -244,7 +248,8 @@ describe("Card - ThreeDS Manual payment flow test", () => {
});
it("Handle redirection", () => {
- let expected_redirection = createConfirmPaymentBody["return_url"];
+ let expected_redirection =
+ fixtures.createConfirmPaymentBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js
index 0ff9eceda6..ee83f1aa44 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js
@@ -1,7 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -32,7 +31,7 @@ describe("Bank Transfers", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -54,7 +53,7 @@ describe("Bank Transfers", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankTransferCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -65,7 +64,7 @@ describe("Bank Transfers", () => {
});
it("Handle bank transfer redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleBankTransferRedirection(
globalState,
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
index 3d2a070490..921ab856bb 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
@@ -1,7 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -32,7 +31,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -54,7 +53,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankRedirectCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -87,7 +86,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -109,7 +108,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankRedirectCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -121,7 +120,7 @@ describe("Bank Redirect tests", () => {
it("Handle bank redirect redirection", () => {
// return_url is a static url (https://hyperswitch.io) taken from confirm-body fixture and is not updated
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleBankRedirectRedirection(
globalState,
@@ -153,7 +152,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -175,7 +174,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankRedirectCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -187,7 +186,7 @@ describe("Bank Redirect tests", () => {
it("Handle bank redirect redirection", () => {
// return_url is a static url (https://hyperswitch.io) taken from confirm-body fixture and is not updated
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleBankRedirectRedirection(
globalState,
@@ -218,7 +217,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -240,7 +239,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankRedirectCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -252,7 +251,7 @@ describe("Bank Redirect tests", () => {
it("Handle bank redirect redirection", () => {
// return_url is a static url (https://hyperswitch.io) taken from confirm-body fixture and is not updated
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleBankRedirectRedirection(
globalState,
@@ -283,7 +282,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -305,7 +304,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankRedirectCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -317,7 +316,7 @@ describe("Bank Redirect tests", () => {
it("Handle bank redirect redirection", () => {
// return_url is a static url (https://hyperswitch.io) taken from confirm-body fixture and is not updated
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleBankRedirectRedirection(
globalState,
@@ -348,7 +347,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -370,7 +369,7 @@ describe("Bank Redirect tests", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmBankRedirectCallTest(
- confirmBody,
+ fixtures.confirmBody,
req_data,
res_data,
true,
@@ -381,7 +380,7 @@ describe("Bank Redirect tests", () => {
});
it("Handle bank redirect redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleBankRedirectRedirection(
globalState,
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
index f7c0fcc984..b2951e3758 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
@@ -1,9 +1,6 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import createPaymentBody from "../../fixtures/create-payment-body";
-import pmIdConfirmBody from "../../fixtures/create-pm-id-mit.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -36,7 +33,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -56,7 +53,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -70,7 +67,13 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
}
);
@@ -93,7 +96,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
@@ -113,7 +116,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -133,13 +136,25 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
}
);
@@ -164,7 +179,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -178,10 +193,22 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
}
);
@@ -206,7 +233,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -226,13 +253,25 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT 1", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 6500, true, "manual", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 6500,
+ true,
+ "manual",
+ globalState
+ );
});
it("mit-capture-call-test", () => {
@@ -242,13 +281,25 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT 2", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 6500, true, "manual", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 6500,
+ true,
+ "manual",
+ globalState
+ );
});
it("mit-capture-call-test", () => {
@@ -258,7 +309,13 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
@@ -285,7 +342,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
7000,
@@ -299,15 +356,27 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
});
it("Handle redirection", () => {
- let expected_redirection = citConfirmBody["return_url"];
+ let expected_redirection = fixtures.citConfirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
}
);
@@ -332,7 +401,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let res_data = data["Response"];
cy.citForMandatesCallTest(
- citConfirmBody,
+ fixtures.citConfirmBody,
req_data,
res_data,
6500,
@@ -346,7 +415,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
});
it("Handle redirection", () => {
- let expected_redirection = citConfirmBody["return_url"];
+ let expected_redirection = fixtures.citConfirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
});
@@ -357,13 +426,25 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ cy.captureCallTest(
+ fixtures.captureBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Confirm No 3DS MIT", () => {
- cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState
+ );
});
}
);
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00019-UPI.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00019-UPI.cy.js
index 331f36c0c2..72c99d2d19 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00019-UPI.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00019-UPI.cy.js
@@ -1,8 +1,6 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import refundBody from "../../fixtures/refund-flow-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState;
@@ -34,7 +32,7 @@ describe("UPI Payments - Hyperswitch", () => {
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -57,14 +55,20 @@ describe("UPI Payments - Hyperswitch", () => {
let req_data = data["Request"];
let res_data = data["Response"];
- cy.confirmUpiCall(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmUpiCall(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle UPI Redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleUpiRedirection(
globalState,
@@ -83,7 +87,13 @@ describe("UPI Payments - Hyperswitch", () => {
];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ cy.refundCallTest(
+ fixtures.refundBody,
+ req_data,
+ res_data,
+ 6500,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -118,7 +128,7 @@ describe("UPI Payments - Hyperswitch", () => {
let res_data = data["Response"];
cy.createPaymentIntentTest(
- createPaymentBody,
+ fixtures.createPaymentBody,
req_data,
res_data,
"three_ds",
@@ -141,14 +151,20 @@ describe("UPI Payments - Hyperswitch", () => {
let req_data = data["Request"];
let res_data = data["Response"];
- cy.confirmUpiCall(confirmBody, req_data, res_data, true, globalState);
+ cy.confirmUpiCall(
+ fixtures.confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("Handle UPI Redirection", () => {
- let expected_redirection = confirmBody["return_url"];
+ let expected_redirection = fixtures.confirmBody["return_url"];
let payment_method_type = globalState.get("paymentMethodType");
cy.handleUpiRedirection(
globalState,
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js
index 25305cc4fc..75cc93a498 100644
--- a/cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js
@@ -1,8 +1,8 @@
-import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
-import merchantCreateBody from "../../fixtures/merchant-create-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
let globalState;
+
describe("Account Create flow test", () => {
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
@@ -14,10 +14,10 @@ describe("Account Create flow test", () => {
});
it("merchant-create-call-test", () => {
- cy.merchantCreateCallTest(merchantCreateBody, globalState);
+ cy.merchantCreateCallTest(fixtures.merchantCreateBody, globalState);
});
it("api-key-create-call-test", () => {
- cy.apiKeyCreateTest(apiKeyCreateBody, globalState);
+ cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState);
});
});
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js
index d51a2f78ae..cfc55ceef9 100644
--- a/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js
@@ -1,4 +1,4 @@
-import customerCreateBody from "../../fixtures/create-customer-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
let globalState;
@@ -15,6 +15,6 @@ describe("Customer Create flow test", () => {
});
it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
});
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js
index e60049af24..0ff3fab06c 100644
--- a/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js
@@ -1,4 +1,4 @@
-import createConnectorBody from "../../fixtures/create-connector-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
let globalState;
@@ -14,6 +14,6 @@ describe("Connector Account Create flow test", () => {
});
it("connector-create-call-test", () => {
- cy.createPayoutConnectorCallTest(createConnectorBody, globalState);
+ cy.createPayoutConnectorCallTest(fixtures.createConnectorBody, globalState);
});
});
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js
index 5e97e2ede8..2caa6030c5 100644
--- a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js
@@ -1,6 +1,6 @@
-import createPayoutBody from "../../fixtures/create-payout-confirm-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import * as utils from "../PayoutUtils/utils";
+import * as utils from "../PayoutUtils/Utils";
let globalState;
@@ -44,7 +44,7 @@ describe("[Payout] Cards", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPayoutTest(
- createPayoutBody,
+ fixtures.createPayoutBody,
req_data,
res_data,
true,
@@ -77,7 +77,7 @@ describe("[Payout] Cards", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPayoutTest(
- createPayoutBody,
+ fixtures.createPayoutBody,
req_data,
res_data,
true,
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js
index 1a19847983..887152c3a6 100644
--- a/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js
@@ -1,6 +1,6 @@
-import createPayoutBody from "../../fixtures/create-payout-confirm-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import * as utils from "../PayoutUtils/utils";
+import * as utils from "../PayoutUtils/Utils";
let globalState;
@@ -97,7 +97,7 @@ describe("[Payout] [Bank Transfer - SEPA]", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPayoutTest(
- createPayoutBody,
+ fixtures.createPayoutBody,
req_data,
res_data,
true,
@@ -129,7 +129,7 @@ describe("[Payout] [Bank Transfer - SEPA]", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPayoutTest(
- createPayoutBody,
+ fixtures.createPayoutBody,
req_data,
res_data,
true,
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js
index f945a9b5a3..edcb89d06f 100644
--- a/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js
@@ -1,10 +1,9 @@
-import customerCreateBody from "../../fixtures/create-customer-body.json";
-import initialCreatePayoutBody from "../../fixtures/create-payout-confirm-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import * as utils from "../PayoutUtils/utils";
+import * as utils from "../PayoutUtils/Utils";
let globalState;
-let createPayoutBody;
+let payoutBody;
describe("[Payout] Saved Card", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
@@ -35,11 +34,11 @@ describe("[Payout] Saved Card", () => {
// This is needed to get customer payment methods
beforeEach("seed global state", () => {
- createPayoutBody = Cypress._.cloneDeep(initialCreatePayoutBody);
+ payoutBody = Cypress._.cloneDeep(fixtures.createPayoutBody);
});
it("create customer", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("create payment method", () => {
@@ -62,7 +61,7 @@ describe("[Payout] Saved Card", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmWithTokenPayoutTest(
- createPayoutBody,
+ payoutBody,
req_data,
res_data,
true,
@@ -91,7 +90,7 @@ describe("[Payout] Saved Card", () => {
});
it("create customer", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("confirm-payout-call-with-auto-fulfill-test", () => {
@@ -101,7 +100,7 @@ describe("[Payout] Saved Card", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPayoutTest(
- createPayoutBody,
+ payoutBody,
req_data,
res_data,
true,
@@ -124,7 +123,7 @@ describe("[Payout] Saved Card", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmWithTokenPayoutTest(
- createPayoutBody,
+ payoutBody,
req_data,
res_data,
true,
@@ -171,12 +170,12 @@ describe("[Payout] Saved Bank transfer", () => {
"[Payout] [Bank Transfer] Onboard Customer Prior to Transaction",
() => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
- beforeEach("reset createPayoutBody", () => {
- createPayoutBody = Cypress._.cloneDeep(initialCreatePayoutBody);
+ beforeEach("reset payoutBody", () => {
+ payoutBody = Cypress._.cloneDeep(fixtures.createPayoutBody);
});
it("create customer", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("create payment method", () => {
@@ -199,7 +198,7 @@ describe("[Payout] Saved Bank transfer", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmWithTokenPayoutTest(
- createPayoutBody,
+ payoutBody,
req_data,
res_data,
true,
@@ -229,7 +228,7 @@ describe("[Payout] Saved Bank transfer", () => {
});
it("create customer", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("confirm-payout-call-with-auto-fulfill-test", () => {
@@ -239,7 +238,7 @@ describe("[Payout] Saved Bank transfer", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPayoutTest(
- createPayoutBody,
+ payoutBody,
req_data,
res_data,
true,
@@ -262,7 +261,7 @@ describe("[Payout] Saved Bank transfer", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmWithTokenPayoutTest(
- createPayoutBody,
+ payoutBody,
req_data,
res_data,
true,
diff --git a/cypress-tests/cypress/e2e/RoutingTest/00000-PaymentRoutingTest.cy.js b/cypress-tests/cypress/e2e/RoutingTest/00000-PaymentRoutingTest.cy.js
index 16f7458eaa..16b84462a9 100644
--- a/cypress-tests/cypress/e2e/RoutingTest/00000-PaymentRoutingTest.cy.js
+++ b/cypress-tests/cypress/e2e/RoutingTest/00000-PaymentRoutingTest.cy.js
@@ -1,9 +1,6 @@
-import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import customerCreateBody from "../../fixtures/create-customer-body.json";
-import routingConfigBody from "../../fixtures/routing-config-body.json";
+import * as fixtures from "../../fixtures/imports";
import State from "../../utils/State";
-import * as utils from "../RoutingUtils/utils";
+import * as utils from "../RoutingUtils/Utils";
let globalState;
@@ -42,11 +39,11 @@ describe("Routing Test", () => {
});
it("api-key-create-call-test", () => {
- cy.apiKeyCreateTest(apiKeyCreateBody, globalState);
+ cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState);
});
it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
});
it("add-routing-config", () => {
@@ -65,7 +62,7 @@ describe("Routing Test", () => {
},
];
cy.addRoutingConfig(
- routingConfigBody,
+ fixtures.routingConfigBody,
req_data,
res_data,
"priority",
@@ -99,7 +96,7 @@ describe("Routing Test", () => {
let req_data = data["Request"];
let res_data = data["Response"];
cy.createConfirmPaymentTest(
- createConfirmPaymentBody,
+ fixtures.createConfirmPaymentBody,
req_data,
res_data,
"no_three_ds",
diff --git a/cypress-tests/cypress/e2e/RoutingUtils/Common.js b/cypress-tests/cypress/e2e/RoutingUtils/Commons.js
similarity index 100%
rename from cypress-tests/cypress/e2e/RoutingUtils/Common.js
rename to cypress-tests/cypress/e2e/RoutingUtils/Commons.js
diff --git a/cypress-tests/cypress/e2e/RoutingUtils/utils.js b/cypress-tests/cypress/e2e/RoutingUtils/utils.js
index 5b0c656796..9d21338bb5 100644
--- a/cypress-tests/cypress/e2e/RoutingUtils/utils.js
+++ b/cypress-tests/cypress/e2e/RoutingUtils/utils.js
@@ -1,4 +1,4 @@
-import { connectorDetails as commonConnectorDetails } from "./Common.js";
+import { connectorDetails as commonConnectorDetails } from "./Commons.js";
const connectorDetails = {
common: commonConnectorDetails,
diff --git a/cypress-tests/cypress/fixtures/imports.js b/cypress-tests/cypress/fixtures/imports.js
new file mode 100644
index 0000000000..e70e926d86
--- /dev/null
+++ b/cypress-tests/cypress/fixtures/imports.js
@@ -0,0 +1,37 @@
+import captureBody from "./capture-flow-body.json";
+import confirmBody from "./confirm-body.json";
+import apiKeyCreateBody from "./create-api-key-body.json";
+import createConfirmPaymentBody from "./create-confirm-body.json";
+import createConnectorBody from "./create-connector-body.json";
+import customerCreateBody from "./create-customer-body.json";
+import citConfirmBody from "./create-mandate-cit.json";
+import mitConfirmBody from "./create-mandate-mit.json";
+import createPaymentBody from "./create-payment-body.json";
+import createPayoutBody from "./create-payout-confirm-body.json";
+import pmIdConfirmBody from "./create-pm-id-mit.json";
+import listRefundCall from "./list-refund-call-body.json";
+import merchantCreateBody from "./merchant-create-body.json";
+import refundBody from "./refund-flow-body.json";
+import routingConfigBody from "./routing-config-body.json";
+import saveCardConfirmBody from "./save-card-confirm-body.json";
+import voidBody from "./void-payment-body.json";
+
+export {
+ apiKeyCreateBody,
+ captureBody,
+ citConfirmBody,
+ confirmBody,
+ createConfirmPaymentBody,
+ createConnectorBody,
+ createPaymentBody,
+ createPayoutBody,
+ customerCreateBody,
+ listRefundCall,
+ merchantCreateBody,
+ mitConfirmBody,
+ pmIdConfirmBody,
+ refundBody,
+ routingConfigBody,
+ saveCardConfirmBody,
+ voidBody,
+};