Skip to content

Commit

Permalink
Ci(Cypress): Enhance Cybersource Testcases (#6285)
Browse files Browse the repository at this point in the history
Co-authored-by: likhinbopanna <likhin.bopanna@juspay.in>
  • Loading branch information
Gnanasundari24 and likhinbopanna authored Nov 11, 2024
1 parent 42bdf47 commit b9f640b
Show file tree
Hide file tree
Showing 40 changed files with 1,727 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,68 +123,65 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
}
);

context(
"Card - void payment in Requires_payment_method state flow test",
() => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
context("Card - void payment in success state flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails

beforeEach(function () {
if (!should_continue) {
this.skip();
}
});
beforeEach(function () {
if (!should_continue) {
this.skip();
}
});

it("create-payment-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
]["PaymentIntent"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"manual",
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("create-payment-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"PaymentIntent"
];
let req_data = data["Request"];
let res_data = data["Response"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
req_data,
res_data,
"no_three_ds",
"manual",
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});

it("payment_methods-call-test", () => {
cy.paymentMethodsCallTest(globalState);
});
it("payment_methods-call-test", () => {
cy.paymentMethodsCallTest(globalState);
});

it("confirm-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
]["No3DSManualCapture"];
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.confirmCallTest(
fixtures.confirmBody,
req_data,
res_data,
false,
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
it("confirm-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"No3DSManualCapture"
];
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.confirmCallTest(
fixtures.confirmBody,
req_data,
res_data,
false,
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});

it("void-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
]["VoidAfterConfirm"];
let req_data = data["Request"];
let res_data = data["Response"];
cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
}
);
it("void-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"VoidAfterConfirm"
];
let req_data = data["Request"];
let res_data = data["Response"];
cy.voidCallTest(fixtures.voidBody, req_data, res_data, globalState);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ describe("Card - Refund flow - No 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -526,7 +526,7 @@ describe("Card - Refund flow - No 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"PartialRefund"
"manualPaymentPartialRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand All @@ -542,7 +542,7 @@ describe("Card - Refund flow - No 3DS", () => {
});
it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"PartialRefund"
"manualPaymentPartialRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -650,7 +650,7 @@ describe("Card - Refund flow - No 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -755,7 +755,7 @@ describe("Card - Refund flow - No 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"PartialRefund"
"manualPaymentPartialRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -1297,7 +1297,7 @@ describe("Card - Refund flow - 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -1405,7 +1405,7 @@ describe("Card - Refund flow - 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentPartialRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand All @@ -1421,7 +1421,7 @@ describe("Card - Refund flow - 3DS", () => {
});
it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentPartialRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -1529,7 +1529,7 @@ describe("Card - Refund flow - 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down Expand Up @@ -1637,7 +1637,7 @@ describe("Card - Refund flow - 3DS", () => {

it("refund-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"Refund"
"manualPaymentRefund"
];
let req_data = data["Request"];
let res_data = data["Response"];
Expand Down
Loading

0 comments on commit b9f640b

Please sign in to comment.