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): add mandates, payment_methods, rewards, crypto payments tests refactoring (#11326)

CHALLA NISHANTH BABU8155178eb8e1
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingPMID.cy.js
index 2650df6273..15be6ff568 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingPMID.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingPMID.cy.js
@@ -18,83 +18,109 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
context(
"Card - NoThreeDS Create and Confirm Automatic CIT and MIT payment flow test",
() => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("customer-create-call-test", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
-
- it("Create No 3DS Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntentOffSession"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSAutoCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- "new_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ it("customer-create-call-test -> Create No 3DS Payment Intent -> Confirm No 3DS CIT -> retrieve-payment-call-test -> Confirm No 3DS MIT -> retrieve-payment-call-test", () => {
+ let shouldContinue = true;
+
+ cy.step("customer-create-call-test", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
+
+ cy.step("Create No 3DS Payment Intent", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Create No 3DS Payment Intent");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntentOffSession"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS CIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS CIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
}
);
@@ -102,90 +128,117 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
context(
"Card - NoThreeDS Create and Confirm Manual CIT and MIT payment flow test",
() => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create No 3DS Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntentOffSession"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "manual",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSManualCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "manual",
- "new_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("cit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.captureCallTest(fixtures.captureBody, data, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ it("Create No 3DS Payment Intent -> Confirm No 3DS CIT -> cit-capture-call-test -> retrieve-payment-call-test -> Confirm No 3DS MIT -> retrieve-payment-call-test", () => {
+ let shouldContinue = true;
+
+ cy.step("Create No 3DS Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntentOffSession"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS CIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS CIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSManualCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("cit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: cit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
}
);
@@ -193,85 +246,118 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
context(
"Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
() => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSAutoCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- "new_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ it("Confirm No 3DS CIT -> retrieve-payment-call-test -> Confirm No 3DS MIT -> retrieve-payment-call-test -> Confirm No 3DS MIT -> retrieve-payment-call-test", () => {
+ let shouldContinue = true;
+
+ cy.step("Confirm No 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
}
);
@@ -279,199 +365,200 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
context(
"Card - NoThreeDS Create + Confirm Manual CIT and MIT payment flow test",
() => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSManualCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "manual",
- "new_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("cit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.captureCallTest(fixtures.captureBody, data, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT 1", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITManualCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "manual",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
+ it("Confirm No 3DS CIT -> cit-capture-call-test -> retrieve-payment-call-test -> Confirm No 3DS MIT 1 -> mit-capture-call-test -> retrieve-payment-call-test -> Confirm No 3DS MIT 2 -> mit-capture-call-test -> retrieve-payment-call-test", () => {
+ let shouldContinue = true;
+
+ cy.step("Confirm No 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSManualCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("cit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: cit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT 1", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT 1");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITManualCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("mit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: mit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT 2", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT 2");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITManualCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("mit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: mit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
+ }
+ );
- it("mit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.captureCallTest(fixtures.captureBody, data, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ context("Card - MIT without billing address", () => {
+ it("Create No 3DS Payment Intent -> Confirm No 3DS CIT -> Confirm No 3DS MIT", () => {
+ let shouldContinue = true;
- it("Confirm No 3DS MIT 2", () => {
+ cy.step("Create No 3DS Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
- ]["MITManualCapture"];
+ ]["PaymentIntentOffSession"];
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
data,
- 6000,
- true,
- "manual",
+ "no_three_ds",
+ "automatic",
globalState
);
- });
-
- it("mit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.captureCallTest(fixtures.captureBody, data, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
- cy.retrievePaymentCallTest({ globalState, data });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
});
- }
- );
-
- context("Card - MIT without billing address", () => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
- it("Create No 3DS Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntentOffSession"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandateNo3DSAutoCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- "new_mandate",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITWithoutBillingAddress"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
- });
-
- context(
- "Card - ThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
- () => {
- let shouldContinue = true;
-
- beforeEach(function () {
+ cy.step("Confirm No 3DS CIT", () => {
if (!shouldContinue) {
- this.skip();
+ cy.task("cli_log", "Skipping step: Confirm No 3DS CIT");
+ return;
}
- });
-
- it("Confirm 3DS CIT", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
- ]["PaymentMethodIdMandate3DSAutoCapture"];
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
cy.citForMandatesCallTest(
fixtures.citConfirmBody,
@@ -483,27 +570,19 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
globalState
);
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expected_redirection = fixtures.citConfirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandate3DSAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
});
- it("Confirm No 3DS MIT", () => {
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
- ]["MITAutoCapture"];
+ ]["MITWithoutBillingAddress"];
cy.mitUsingPMId(
fixtures.pmIdConfirmBody,
@@ -514,20 +593,101 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
globalState
);
});
+ });
+ });
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
+ context(
+ "Card - ThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ it("Confirm 3DS CIT -> Handle redirection -> retrieve-payment-call-test -> Confirm No 3DS MIT -> Confirm No 3DS MIT", () => {
+ let shouldContinue = true;
+
+ cy.step("Confirm 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandate3DSAutoCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.citConfirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandate3DSAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
});
}
);
@@ -535,70 +695,88 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
context(
"Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow",
() => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Confirm 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentMethodIdMandate3DSManualCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "manual",
- "new_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expected_redirection = fixtures.citConfirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- });
-
- it("cit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.captureCallTest(fixtures.captureBody, data, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitUsingPMId(
- fixtures.pmIdConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
+ it("Confirm 3DS CIT -> Handle redirection -> cit-capture-call-test -> retrieve-payment-call-test -> Confirm No 3DS MIT", () => {
+ let shouldContinue = true;
+
+ cy.step("Confirm 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandate3DSManualCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.citConfirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ cy.step("cit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: cit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingPMId(
+ fixtures.pmIdConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
});
}
);
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00021-MandatesUsingNTIDProxy.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00021-MandatesUsingNTIDProxy.cy.js
index 6377323bbf..3ec666902c 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00021-MandatesUsingNTIDProxy.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00021-MandatesUsingNTIDProxy.cy.js
@@ -7,14 +7,12 @@ let connector;
describe("Card - Mandates using Network Transaction Id flow test", () => {
before(function () {
- // Changed to regular function instead of arrow function
let skip = false;
cy.task("getGlobalState")
.then((state) => {
globalState = new State(state);
connector = globalState.get("connectorId");
-
// Skip the test if the connector is not in the inclusion list
// This is done because only cybersource is known to support at present
if (
@@ -80,33 +78,46 @@ describe("Card - Mandates using Network Transaction Id flow test", () => {
context(
"Card - NoThreeDS Create and Confirm Automatic multiple MITs payment flow test",
() => {
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
+ it("Confirm No 3DS MIT -> Confirm No 3DS MIT", () => {
+ let shouldContinue = true;
- cy.mitUsingNTID(
- fixtures.ntidConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
+ cy.step("Confirm No 3DS MIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
- cy.mitUsingNTID(
- fixtures.ntidConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
+ cy.mitUsingNTID(
+ fixtures.ntidConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingNTID(
+ fixtures.ntidConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
});
}
);
@@ -114,58 +125,78 @@ describe("Card - Mandates using Network Transaction Id flow test", () => {
context(
"Card - NoThreeDS Create and Confirm Manual multiple MITs payment flow test",
() => {
- let shouldContinue = true;
+ it("Confirm No 3DS MIT 1 -> mit-capture-call-test -> Confirm No 3DS MIT 2 -> mit-capture-call-test", () => {
+ let shouldContinue = true;
- it("Confirm No 3DS MIT 1", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITManualCapture"];
+ cy.step("Confirm No 3DS MIT 1", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITManualCapture"];
- cy.mitUsingNTID(
- fixtures.ntidConfirmBody,
- data,
- 6000,
- true,
- "manual",
- globalState
- );
- });
+ cy.mitUsingNTID(
+ fixtures.ntidConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ globalState
+ );
- it("mit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ cy.step("mit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: mit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
- it("Confirm No 3DS MIT 2", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITManualCapture"];
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.mitUsingNTID(
- fixtures.ntidConfirmBody,
- data,
- 6000,
- true,
- "manual",
- globalState
- );
- });
+ cy.step("Confirm No 3DS MIT 2", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT 2");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITManualCapture"];
- it("mit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ cy.mitUsingNTID(
+ fixtures.ntidConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ globalState
+ );
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
+ cy.step("mit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: mit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+ });
});
}
);
@@ -173,33 +204,46 @@ describe("Card - Mandates using Network Transaction Id flow test", () => {
context(
"Card - ThreeDS Create and Confirm Automatic multiple MITs payment flow test",
() => {
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
+ it("Confirm No 3DS MIT -> Confirm No 3DS MIT", () => {
+ let shouldContinue = true;
- cy.mitUsingNTID(
- fixtures.ntidConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
+ cy.step("Confirm No 3DS MIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
- cy.mitUsingNTID(
- fixtures.ntidConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
+ cy.mitUsingNTID(
+ fixtures.ntidConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitUsingNTID(
+ fixtures.ntidConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
});
}
);
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00022-UPI.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00022-UPI.cy.js
index 21290d45d5..5c43eac077 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00022-UPI.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00022-UPI.cy.js
@@ -5,8 +5,6 @@ import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
let globalState;
describe("UPI Payments - Hyperswitch", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
context("[Payment] [UPI - UPI Collect] Create & Confirm + Refund", () => {
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
@@ -18,76 +16,98 @@ describe("UPI Payments - Hyperswitch", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("Create payment intent -> List Merchant payment methods -> Confirm payment -> Handle UPI Redirection -> Retrieve payment -> Refund payment", () => {
+ let shouldContinue = true;
- it("Create payment intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["PaymentIntent"];
+ cy.step("Create payment intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["PaymentIntent"];
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "three_ds",
- "automatic",
- globalState
- );
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("List Merchant payment methods", () => {
- cy.paymentMethodsCallTest(globalState);
- });
+ cy.step("List Merchant payment methods", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List Merchant payment methods");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
- it("Confirm payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["UpiCollect"];
+ cy.step("Confirm payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["UpiCollect"];
- cy.confirmUpiCall(fixtures.confirmBody, data, true, globalState);
+ cy.confirmUpiCall(fixtures.confirmBody, data, true, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle UPI Redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- const payment_method_type = globalState.get("paymentMethodType");
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.handleUpiRedirection(
- globalState,
- payment_method_type,
- expected_redirection
- );
- });
+ cy.step("Handle UPI Redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle UPI Redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+
+ cy.handleUpiRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["UpiCollect"];
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["UpiCollect"];
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.retrievePaymentCallTest({ globalState, data });
- it("Refund payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["Refund"];
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.refundCallTest(fixtures.refundBody, data, globalState);
+ cy.step("Refund payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Refund payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["Refund"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.refundCallTest(fixtures.refundBody, data, globalState);
+ });
});
});
// Skipping UPI Intent intentionally as connector is throwing 5xx during redirection
context.skip("[Payment] [UPI - UPI Intent] Create & Confirm", () => {
- shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -98,59 +118,77 @@ describe("UPI Payments - Hyperswitch", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("Create payment intent -> List Merchant payment methods -> Confirm payment -> Handle UPI Redirection -> Retrieve payment", () => {
+ let shouldContinue = true;
- it("Create payment intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["PaymentIntent"];
+ cy.step("Create payment intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["PaymentIntent"];
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "three_ds",
- "automatic",
- globalState
- );
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("List Merchant payment methods", () => {
- cy.paymentMethodsCallTest(globalState);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Confirm payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["UpiIntent"];
+ cy.step("List Merchant payment methods", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List Merchant payment methods");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
- cy.confirmUpiCall(fixtures.confirmBody, data, true, globalState);
+ cy.step("Confirm payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["UpiIntent"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.confirmUpiCall(fixtures.confirmBody, data, true, globalState);
- it("Handle UPI Redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- const payment_method_type = globalState.get("paymentMethodType");
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.handleUpiRedirection(
- globalState,
- payment_method_type,
- expected_redirection
- );
- });
+ cy.step("Handle UPI Redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle UPI Redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+
+ cy.handleUpiRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "upi_pm"
- ]["UpiIntent"];
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "upi_pm"
+ ]["UpiIntent"];
- cy.retrievePaymentCallTest({ globalState, data });
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js
index 236e2732c8..3ce9e9eddd 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js
@@ -7,14 +7,6 @@ let paymentIntentBody;
let paymentCreateConfirmBody;
describe("Corner cases", () => {
- // This is needed to get flush out old data
- beforeEach("seed global state", () => {
- paymentIntentBody = Cypress._.cloneDeep(fixtures.createPaymentBody);
- paymentCreateConfirmBody = Cypress._.cloneDeep(
- fixtures.createConfirmPaymentBody
- );
- });
-
context("[Payment] Invalid Info", () => {
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
@@ -26,6 +18,13 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
+ beforeEach("seed global state", () => {
+ paymentIntentBody = Cypress._.cloneDeep(fixtures.createPaymentBody);
+ paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ });
+
it("[Payment] Invalid card number", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
@@ -203,32 +202,45 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- it("Create payment intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
+ it("Create payment intent -> Confirm payment intent", () => {
+ let shouldContinue = true;
- cy.createPaymentIntentTest(
- paymentIntentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
- });
+ cy.step("Create payment intent", () => {
+ const paymentIntentBody = Cypress._.cloneDeep(
+ fixtures.createPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
- it("Confirm payment intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntentErrored"];
+ cy.createPaymentIntentTest(
+ paymentIntentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ cy.step("Confirm payment intent", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm payment intent");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntentErrored"];
+
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ });
});
});
context("[Payment] Capture greater amount", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -239,50 +251,57 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSManualCapture"];
+ it("Create payment intent and confirm -> Retrieve payment -> Capture call", () => {
+ let shouldContinue = true;
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "no_three_ds",
- "manual",
- globalState
- );
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSManualCapture"];
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
+ data,
+ "no_three_ds",
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
- it("Capture call", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["CaptureGreaterAmount"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ cy.step("Capture call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Capture call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["CaptureGreaterAmount"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+ });
});
});
context("[Payment] Capture successful payment", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -293,50 +312,57 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("Create payment intent and confirm -> Retrieve payment -> Capture call", () => {
+ let shouldContinue = true;
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Capture call", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["CaptureCapturedAmount"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ cy.step("Capture call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Capture call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["CaptureCapturedAmount"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+ });
});
});
context("[Payment] Confirm successful payment", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -347,50 +373,57 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
-
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
+ it("Create payment intent and confirm -> Retrieve payment -> Confirm call", () => {
+ let shouldContinue = true;
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Confirm call", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["ConfirmSuccessfulPayment"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ cy.step("Confirm call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ConfirmSuccessfulPayment"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ });
});
});
context("[Payment] Void successful payment", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -401,62 +434,69 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
-
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ it("Create payment intent and confirm -> Retrieve payment -> Void call", () => {
+ let shouldContinue = true;
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Void call", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Void"];
- const commonData = getConnectorDetails(globalState.get("commons"))[
- "card_pm"
- ]["Void"];
-
- const newData = {
- ...data,
- Response: utils.getConnectorFlowDetails(
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
data,
- commonData,
- "ResponseCustom"
- ),
- };
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.voidCallTest(fixtures.voidBody, newData, globalState);
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.step("Void call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Void call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Void"];
+ const commonData = getConnectorDetails(globalState.get("commons"))[
+ "card_pm"
+ ]["Void"];
+
+ const newData = {
+ ...data,
+ Response: utils.getConnectorFlowDetails(
+ data,
+ commonData,
+ "ResponseCustom"
+ ),
+ };
+
+ cy.voidCallTest(fixtures.voidBody, newData, globalState);
+ });
});
});
context("[Payment] 3DS with greater capture", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -467,63 +507,78 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("Create payment intent and confirm -> Retrieve payment -> Handle redirection -> Retrieve payment -> Capture call", () => {
+ let shouldContinue = true;
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSManualCapture"];
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "three_ds",
- "manual",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSManualCapture"];
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
+ data,
+ "three_ds",
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
- it("Handle redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- });
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSManualCapture"];
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
- it("Capture call", () => {
- const data = getConnectorDetails(globalState.get("commons"))["card_pm"][
- "CaptureGreaterAmount"
- ];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ cy.step("Capture call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Capture call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("commons"))["card_pm"][
+ "CaptureGreaterAmount"
+ ];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+ });
});
});
context("[Payment] Refund exceeds captured Amount", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -534,49 +589,57 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("Create payment intent and confirm -> Retrieve payment -> Refund call", () => {
+ let shouldContinue = true;
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
-
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- it("Refund call", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["RefundGreaterAmount"];
+ cy.step("Refund call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Refund call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RefundGreaterAmount"];
- cy.refundCallTest(fixtures.refundBody, data, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.refundCallTest(fixtures.refundBody, data, globalState);
+ });
});
});
context("[Payment] Refund unsuccessful payment", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -587,50 +650,57 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create payment intent and confirm", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ it("Create payment intent and confirm -> Retrieve payment -> Refund call", () => {
+ let shouldContinue = true;
- cy.createConfirmPaymentTest(
- paymentCreateConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
+ cy.step("Create payment intent and confirm", () => {
+ const paymentCreateConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.createConfirmPaymentTest(
+ paymentCreateConfirmBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Refund call", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["RefundGreaterAmount"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.refundCallTest(fixtures.refundBody, data, globalState);
+ cy.step("Refund call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Refund call");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RefundGreaterAmount"];
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.refundCallTest(fixtures.refundBody, data, globalState);
+ });
});
});
context("[Payment] Recurring mandate with greater mandate amount", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -641,65 +711,79 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("No 3DS CIT -> cit-capture-call-test -> Retrieve payment -> Confirm No 3DS MIT", () => {
+ let shouldContinue = true;
- it("No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MandateSingleUseNo3DSManualCapture"];
+ cy.step("No 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSManualCapture"];
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "manual",
- "new_mandate",
- globalState
- );
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("cit-capture-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ cy.step("cit-capture-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: cit-capture-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
- cy.captureCallTest(fixtures.captureBody, data, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- data,
- 60000,
- true,
- "manual",
- globalState
- );
+ cy.step("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 60000,
+ true,
+ "manual",
+ globalState
+ );
+ });
});
});
context("Card-NoThreeDS fail payment flow test", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -710,151 +794,188 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ it("create-payment-call-test -> Confirm No 3DS", () => {
+ let shouldContinue = true;
- it("create-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
+ cy.step("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Confirm No 3DS", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSFailPayment"];
+ cy.step("Confirm No 3DS", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm No 3DS");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSFailPayment"];
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ });
});
});
context("Duplicate Payment ID", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
- let createConfirmBody;
-
- beforeEach(function () {
- createConfirmBody = Cypress._.cloneDeep(
- fixtures.createConfirmPaymentBody
- );
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create new payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
-
- cy.createConfirmPaymentTest(
- createConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Retrieve payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Create a payment with a duplicate payment ID", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["DuplicatePaymentID"];
+ it("Create new payment -> Retrieve payment -> Create a payment with a duplicate payment ID", () => {
+ let shouldContinue = true;
+
+ cy.step("Create new payment", () => {
+ const createConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
+
+ cy.createConfirmPaymentTest(
+ createConfirmBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- data.Request.payment_id = globalState.get("paymentID");
+ cy.step("Retrieve payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- cy.createConfirmPaymentTest(
- createConfirmBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.step("Create a payment with a duplicate payment ID", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: Create a payment with a duplicate payment ID"
+ );
+ return;
+ }
+ const createConfirmBody = Cypress._.cloneDeep(
+ fixtures.createConfirmPaymentBody
+ );
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["DuplicatePaymentID"];
+
+ data.Request.payment_id = globalState.get("paymentID");
+
+ cy.createConfirmPaymentTest(
+ createConfirmBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ });
});
});
context("Duplicate Refund ID", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+ it("Create new payment -> retrieve-payment-call-test -> Create new refund -> Sync refund -> Create a refund with a duplicate refund ID", () => {
+ let shouldContinue = true;
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ cy.step("Create new payment", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Create new payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.createConfirmPaymentTest(
+ fixtures.createConfirmPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.createConfirmPaymentTest(
- fixtures.createConfirmPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("retrieve-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: retrieve-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Create new refund", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Create new refund");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialRefund"];
- it("Create new refund", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PartialRefund"];
+ cy.refundCallTest(fixtures.refundBody, data, globalState);
- cy.refundCallTest(fixtures.refundBody, data, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Sync refund", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["SyncRefund"];
+ cy.step("Sync refund", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Sync refund");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SyncRefund"];
- cy.syncRefundCallTest(data, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
- it("Create a refund with a duplicate refund ID", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["DuplicateRefundID"];
+ cy.syncRefundCallTest(data, globalState);
- data.Request.refund_id = globalState.get("refundId");
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.refundCallTest(fixtures.refundBody, data, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.step("Create a refund with a duplicate refund ID", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: Create a refund with a duplicate refund ID"
+ );
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["DuplicateRefundID"];
+
+ data.Request.refund_id = globalState.get("refundId");
+
+ cy.refundCallTest(fixtures.refundBody, data, globalState);
+ });
});
});
@@ -869,99 +990,107 @@ describe("Corner cases", () => {
cy.task("setGlobalState", globalState.data);
});
- it("Create new customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ it("Create new customer -> Create a customer with a duplicate customer ID", () => {
+ cy.step("Create new customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Create a customer with a duplicate customer ID", () => {
- const customerData = fixtures.customerCreateBody;
- customerData.customer_id = globalState.get("customerId");
+ cy.step("Create a customer with a duplicate customer ID", () => {
+ const customerData = fixtures.customerCreateBody;
+ customerData.customer_id = globalState.get("customerId");
- cy.createCustomerCallTest(customerData, globalState);
+ cy.createCustomerCallTest(customerData, globalState);
+ });
});
});
context("Confirm Payment with Invalid Publishable Key", () => {
- let shouldContinue = true;
+ it("Create Payment Intent -> Confirm payment with invalid publishable key", () => {
+ let shouldContinue = true;
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Confirm payment with invalid publishable key", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["InvalidPublishableKey"];
-
- const originalKey = globalState.get("publishableKey");
- //set invalid publishable key
- cy.then(() => globalState.set("publishableKey", "pk_snd_invalid_key"));
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
-
- // Restore key synchronously after test
- cy.then(() => globalState.set("publishableKey", originalKey));
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.step("Confirm payment with invalid publishable key", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: Confirm payment with invalid publishable key"
+ );
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["InvalidPublishableKey"];
+
+ const originalKey = globalState.get("publishableKey");
+ //set invalid publishable key
+ cy.then(() => globalState.set("publishableKey", "pk_snd_invalid_key"));
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+
+ // Restore key synchronously after test
+ cy.then(() => globalState.set("publishableKey", originalKey));
+ });
});
});
context("Retrieve session token with invalid publishable key", () => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Session call with invalid publishable key", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["InvalidPublishableKey"];
+ it("Create Payment Intent -> Session call with invalid publishable key", () => {
+ let shouldContinue = true;
- const originalKey = globalState.get("publishableKey");
- // set invalid publishable key
- cy.then(() => globalState.set("publishableKey", "pk_snd_invalid_key"));
- cy.sessionTokenCall(fixtures.sessionTokenBody, data, globalState);
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
- // Restore key synchronously after test
- cy.then(() => globalState.set("publishableKey", originalKey));
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ cy.step("Session call with invalid publishable key", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: Session call with invalid publishable key"
+ );
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["InvalidPublishableKey"];
+
+ const originalKey = globalState.get("publishableKey");
+ // set invalid publishable key
+ cy.then(() => globalState.set("publishableKey", "pk_snd_invalid_key"));
+ cy.sessionTokenCall(fixtures.sessionTokenBody, data, globalState);
+
+ // Restore key synchronously after test
+ cy.then(() => globalState.set("publishableKey", originalKey));
+ });
});
});
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00024-PaymentMethods.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00024-PaymentMethods.cy.js
index 77018f9c70..163e282055 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00024-PaymentMethods.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00024-PaymentMethods.cy.js
@@ -3,7 +3,6 @@ import State from "../../../utils/State";
import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
let globalState;
-let saveCardBody;
describe("Payment Methods Tests", () => {
before("seed global state", () => {
@@ -12,263 +11,320 @@ describe("Payment Methods Tests", () => {
});
});
- after("flush global state", () => {
+ afterEach("flush global state", () => {
cy.task("setGlobalState", globalState.data);
});
context("Create payment method for customer", () => {
- it("Create customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ it("Create customer -> Create Payment Method -> List PM for customer", () => {
+ cy.step("Create customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Create Payment Method", () => {
- const data = getConnectorDetails("commons")["card_pm"]["PaymentMethod"];
+ cy.step("Create Payment Method", () => {
+ const data = getConnectorDetails("commons")["card_pm"]["PaymentMethod"];
- cy.createPaymentMethodTest(globalState, data);
- });
+ cy.createPaymentMethodTest(globalState, data);
+ });
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
+ cy.step("List PM for customer", () => {
+ cy.listCustomerPMCallTest(globalState);
+ });
});
});
context("Set default payment method", () => {
- let shouldContinue = true;
+ it("List PM for customer -> Create Payment Method -> create-payment-call-test -> confirm-payment-call-test -> List PM for customer -> Set default payment method", () => {
+ let shouldContinue = true;
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ cy.step("List PM for customer", () => {
+ cy.listCustomerPMCallTest(globalState);
+ });
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
- });
+ cy.step("Create Payment Method", () => {
+ const data = getConnectorDetails("commons")["card_pm"]["PaymentMethod"];
- it("Create Payment Method", () => {
- const data = getConnectorDetails("commons")["card_pm"]["PaymentMethod"];
+ cy.createPaymentMethodTest(globalState, data);
+ });
- cy.createPaymentMethodTest(globalState, data);
- });
+ cy.step("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntentOffSession"];
- it("create-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntentOffSession"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
- it("confirm-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["SaveCardUseNo3DSAutoCaptureOffSession"];
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("confirm-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: confirm-payment-call-test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCaptureOffSession"];
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
- });
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("List PM for customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List PM for customer");
+ return;
+ }
+ cy.listCustomerPMCallTest(globalState);
+ });
- it("Set default payment method", () => {
- cy.setDefaultPaymentMethodTest(globalState);
+ cy.step("Set default payment method", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Set default payment method");
+ return;
+ }
+ cy.setDefaultPaymentMethodTest(globalState);
+ });
});
});
context("Delete payment method for customer", () => {
- it("Create customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ it("Create customer -> Create Payment Method -> List PM for customer -> Delete Payment Method for a customer", () => {
+ cy.step("Create customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Create Payment Method", () => {
- const data = getConnectorDetails("commons")["card_pm"]["PaymentMethod"];
- cy.createPaymentMethodTest(globalState, data);
- });
+ cy.step("Create Payment Method", () => {
+ const data = getConnectorDetails("commons")["card_pm"]["PaymentMethod"];
+ cy.createPaymentMethodTest(globalState, data);
+ });
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
- });
+ cy.step("List PM for customer", () => {
+ cy.listCustomerPMCallTest(globalState);
+ });
- it("Delete Payment Method for a customer", () => {
- cy.deletePaymentMethodTest(globalState);
+ cy.step("Delete Payment Method for a customer", () => {
+ cy.deletePaymentMethodTest(globalState);
+ });
});
});
context("'Last Used' off-session token payments", () => {
let shouldContinue = true;
- beforeEach(function () {
- saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
- if (!shouldContinue) {
- this.skip();
- }
- });
afterEach("flush global state", () => {
cy.task("setGlobalState", globalState.data);
});
it("Create customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ cy.step("Create customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
});
context("Create No 3DS off session save card payment", () => {
- it("create+confirm-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["SaveCardUseNo3DSAutoCaptureOffSession"];
-
- cy.createConfirmPaymentTest(
- fixtures.createConfirmPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
+ it("create+confirm-payment-call-test -> List PM for customer", () => {
+ cy.step("create+confirm-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCaptureOffSession"];
+
+ cy.createConfirmPaymentTest(
+ fixtures.createConfirmPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("List PM for customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List PM for customer");
+ return;
+ }
+ cy.listCustomerPMCallTest(globalState);
+ });
});
});
context("Create 3DS off session save card payment", () => {
- it("create+confirm-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["SaveCardUse3DSAutoCaptureOffSession"];
-
- cy.createConfirmPaymentTest(
- fixtures.createConfirmPaymentBody,
- data,
- "three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expectedRedirection = fixtures.confirmBody["return_url"];
- cy.handleRedirection(globalState, expectedRedirection);
- });
-
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
+ it("create+confirm-payment-call-test -> Handle redirection -> List PM for customer", () => {
+ cy.step("create+confirm-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUse3DSAutoCaptureOffSession"];
+
+ cy.createConfirmPaymentTest(
+ fixtures.createConfirmPaymentBody,
+ data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expectedRedirection = fixtures.confirmBody["return_url"];
+ cy.handleRedirection(globalState, expectedRedirection);
+ });
+
+ cy.step("List PM for customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List PM for customer");
+ return;
+ }
+ cy.listCustomerPMCallTest(globalState);
+ });
});
});
context("Create 3DS off session save card payment with token", () => {
- beforeEach(function () {
- saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("confirm-save-card-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["SaveCardUseNo3DSAutoCapture"];
-
- const newData = {
- ...data,
- Response: {
- ...data.Response,
- body: {
- ...data.Response.body,
- status: "requires_customer_action",
+ it("create-payment-call-test -> confirm-save-card-payment-call-test -> Handle redirection -> List PM for customer", () => {
+ const saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
+
+ cy.step("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("confirm-save-card-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: confirm-save-card-payment-call-test"
+ );
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCapture"];
+
+ const newData = {
+ ...data,
+ Response: {
+ ...data.Response,
+ body: {
+ ...data.Response.body,
+ status: "requires_customer_action",
+ },
},
- },
- };
-
- cy.saveCardConfirmCallTest(saveCardBody, newData, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expectedRedirection = fixtures.confirmBody["return_url"];
- cy.handleRedirection(globalState, expectedRedirection);
- });
-
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState, 1 /* order */);
+ };
+
+ cy.saveCardConfirmCallTest(saveCardBody, newData, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expectedRedirection = fixtures.confirmBody["return_url"];
+ cy.handleRedirection(globalState, expectedRedirection);
+ });
+
+ cy.step("List PM for customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List PM for customer");
+ return;
+ }
+ cy.listCustomerPMCallTest(globalState, 1 /* order */);
+ });
});
});
context("Create No 3DS off session save card payment with token", () => {
- beforeEach(function () {
- saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
- if (!shouldContinue) {
- this.skip();
- }
- });
afterEach("flush global state", () => {
cy.task("setGlobalState", globalState.data);
});
- it("create-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("confirm-save-card-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["SaveCardUseNo3DSAutoCapture"];
-
- cy.saveCardConfirmCallTest(saveCardBody, data, globalState);
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("List PM for customer", () => {
- cy.listCustomerPMCallTest(globalState);
+ it("create-payment-call-test -> confirm-save-card-payment-call-test -> List PM for customer", () => {
+ const saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
+
+ cy.step("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("confirm-save-card-payment-call-test", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: confirm-save-card-payment-call-test"
+ );
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCapture"];
+
+ cy.saveCardConfirmCallTest(saveCardBody, data, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("List PM for customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List PM for customer");
+ return;
+ }
+ cy.listCustomerPMCallTest(globalState);
+ });
});
});
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00027-DeletedCustomerPsyncFlow.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00027-DeletedCustomerPsyncFlow.cy.js
index 18d2eeb958..6330819abe 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00027-DeletedCustomerPsyncFlow.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00027-DeletedCustomerPsyncFlow.cy.js
@@ -11,82 +11,92 @@ describe("Card - Customer Deletion and Psync", () => {
});
});
- after("flush global state", () => {
+ afterEach("flush global state", () => {
cy.task("setGlobalState", globalState.data);
});
context("Card - Psync after Customer Deletion for Automatic Capture", () => {
context("No3DS Card - Psync after Customer Deletion ", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+ it("Create Customer -> Create Payment Intent -> Confirm Payment -> Retrieve Payment -> Delete Customer -> Retrieve Payment", () => {
+ let shouldContinue = true;
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ cy.step("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Create Customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Confirm Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.retrievePaymentCallTest({ globalState, data });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Delete Customer", () => {
- cy.customerDeleteCall(globalState);
- });
+ cy.step("Delete Customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Delete Customer");
+ return;
+ }
+ cy.customerDeleteCall(globalState);
+ });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- cy.retrievePaymentCallTest({ globalState, data });
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
context("3DS Card - Psync after Customer Deletion ", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -97,156 +107,209 @@ describe("Card - Customer Deletion and Psync", () => {
cy.task("setGlobalState", globalState.data);
});
- it("Create Customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ it("Create Customer -> Create Payment Intent -> Confirm Payment -> Handle redirection -> Retrieve Payment -> Delete Customer -> Retrieve Payment", () => {
+ let shouldContinue = true;
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Confirm Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSAutoCapture"];
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSAutoCapture"];
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
- it("Handle redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
- it("Delete Customer", () => {
- cy.customerDeleteCall(globalState);
- });
+ cy.retrievePaymentCallTest({ globalState, data });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSAutoCapture"];
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.retrievePaymentCallTest({ globalState, data });
+ cy.step("Delete Customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Delete Customer");
+ return;
+ }
+ cy.customerDeleteCall(globalState);
+ });
+
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
});
context("Card - Psync after Customer Deletion for Manual Capture", () => {
context("No3DS Card - Psync after Customer Deletion ", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+ it("Create Customer -> Create Payment Intent -> Confirm Payment -> Retrieve Payment -> Capture Payment -> Retrieve Payment -> Delete Customer -> Retrieve Payment", () => {
+ let shouldContinue = true;
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ cy.step("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Create Customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "manual",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
- it("Confirm Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSManualCapture"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSManualCapture"];
+ cy.retrievePaymentCallTest({ globalState, data });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Capture Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ cy.step("Capture Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Capture Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.retrievePaymentCallTest({ globalState, data });
- it("Delete Customer", () => {
- cy.customerDeleteCall(globalState);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["No3DSManualCapture"];
+ cy.step("Delete Customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Delete Customer");
+ return;
+ }
+ cy.customerDeleteCall(globalState);
+ });
+
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
- cy.retrievePaymentCallTest({ globalState, data });
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
context("3DS Card - Psync after Customer Deletion ", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
@@ -257,80 +320,123 @@ describe("Card - Customer Deletion and Psync", () => {
cy.task("setGlobalState", globalState.data);
});
- it("Create Customer", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
+ it("Create Customer -> Create Payment Intent -> Confirm Payment -> Handle redirection -> Retrieve Payment -> Capture Payment -> Retrieve Payment -> Delete Customer -> Retrieve Payment", () => {
+ let shouldContinue = true;
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "three_ds",
- "manual",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
- it("Confirm Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSManualCapture"];
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "three_ds",
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
- it("Handle redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSManualCapture"];
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
- it("Capture Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ cy.retrievePaymentCallTest({ globalState, data });
- cy.captureCallTest(fixtures.captureBody, data, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
+ cy.step("Capture Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Capture Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
- cy.retrievePaymentCallTest({ globalState, data });
- });
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
- it("Delete Customer", () => {
- cy.customerDeleteCall(globalState);
- });
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Delete Customer", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Delete Customer");
+ return;
+ }
+ cy.customerDeleteCall(globalState);
+ });
- it("Retrieve Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["3DSManualCapture"];
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
- cy.retrievePaymentCallTest({ globalState, data });
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00037-RewardPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00037-RewardPayment.cy.js
index 4ebe5cbbd1..6e84760564 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00037-RewardPayment.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00037-RewardPayment.cy.js
@@ -20,118 +20,150 @@ describe("Reward Payment - Cashtocode", () => {
});
context("Evoucher payment method flow", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create Payment Intent for Evoucher", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "reward_pm"
- ]["PaymentIntentUSD"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Payment Methods Call Test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm Evoucher Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "reward_pm"
- ]["Evoucher"];
-
- cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- const payment_method_type = globalState.get("paymentMethodType");
- cy.handleRewardRedirection(
- globalState,
- payment_method_type,
- expected_redirection
- );
- });
-
- it("Retrieve Payment Call Test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "reward_pm"
- ]["Evoucher"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ it("Create Payment Intent for Evoucher -> Payment Methods Call Test -> Confirm Evoucher Payment -> Handle redirection -> Retrieve Payment Call Test", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent for Evoucher", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "reward_pm"
+ ]["PaymentIntentUSD"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Payment Methods Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Payment Methods Call Test");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ cy.step("Confirm Evoucher Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Evoucher Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "reward_pm"
+ ]["Evoucher"];
+
+ cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ cy.handleRewardRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ cy.step("Retrieve Payment Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment Call Test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "reward_pm"
+ ]["Evoucher"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
context("Classic payment method flow", () => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create Payment Intent for Classic", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "reward_pm"
- ]["PaymentIntentEUR"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Payment Methods Call Test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm Classic Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "reward_pm"
- ]["Classic"];
-
- cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle Redirection for Classic", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- const payment_method_type = globalState.get("paymentMethodType");
- cy.handleRewardRedirection(
- globalState,
- payment_method_type,
- expected_redirection
- );
- });
-
- it("Retrieve Payment Call Test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "reward_pm"
- ]["Classic"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ it("Create Payment Intent for Classic -> Payment Methods Call Test -> Confirm Classic Payment -> Handle Redirection for Classic -> Retrieve Payment Call Test", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent for Classic", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "reward_pm"
+ ]["PaymentIntentEUR"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Payment Methods Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Payment Methods Call Test");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ cy.step("Confirm Classic Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Classic Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "reward_pm"
+ ]["Classic"];
+
+ cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle Redirection for Classic", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle Redirection for Classic");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ cy.handleRewardRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ cy.step("Retrieve Payment Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment Call Test");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "reward_pm"
+ ]["Classic"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
});
});
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00038-CryptoPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00038-CryptoPayment.cy.js
index 7567dd4c73..b9d9c3f4d1 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00038-CryptoPayment.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00038-CryptoPayment.cy.js
@@ -20,110 +20,142 @@ describe("Crypto Payment", () => {
});
context("Crypto Currency Payment flow", () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "crypto_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "automatic",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Payment Methods Call Test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm Crypto Currency Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "crypto_pm"
- ]["CryptoCurrency"];
-
- cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- const payment_method_type = globalState.get("paymentMethodType");
- cy.handleCryptoRedirection(
- globalState,
- payment_method_type,
- expected_redirection
- );
- });
-
- it("Retrieve Payment Call Test", () => {
- cy.retrievePaymentCallTest({ globalState });
+ it("Create Payment Intent -> Payment Methods Call Test -> Confirm Crypto Currency Payment -> Handle redirection -> Retrieve Payment Call Test", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "crypto_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Payment Methods Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Payment Methods Call Test");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ cy.step("Confirm Crypto Currency Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Crypto Currency Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "crypto_pm"
+ ]["CryptoCurrency"];
+
+ cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ cy.handleCryptoRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ cy.step("Retrieve Payment Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment Call Test");
+ return;
+ }
+ cy.retrievePaymentCallTest({ globalState });
+ });
});
});
context("Crypto Currency manual capture flow", () => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Create Payment Intent", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "crypto_pm"
- ]["PaymentIntent"];
-
- cy.createPaymentIntentTest(
- fixtures.createPaymentBody,
- data,
- "no_three_ds",
- "manual",
- globalState
- );
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Payment Methods Call Test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm Crypto Currency Payment", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "crypto_pm"
- ]["CryptoCurrencyManualCapture"];
-
- cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
-
- if (shouldContinue) shouldContinue = utils.should_continue_further(data);
- });
-
- it("Handle redirection", () => {
- const expected_redirection = fixtures.confirmBody["return_url"];
- const payment_method_type = globalState.get("paymentMethodType");
- cy.handleCryptoRedirection(
- globalState,
- payment_method_type,
- expected_redirection
- );
- });
-
- it("Retrieve Payment Call Test", () => {
- cy.retrievePaymentCallTest({ globalState });
+ it("Create Payment Intent -> Payment Methods Call Test -> Confirm Crypto Currency Payment -> Handle redirection -> Retrieve Payment Call Test", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "crypto_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "manual",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Payment Methods Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Payment Methods Call Test");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ cy.step("Confirm Crypto Currency Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Crypto Currency Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "crypto_pm"
+ ]["CryptoCurrencyManualCapture"];
+
+ cy.confirmRewardCallTest(fixtures.confirmBody, data, true, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Handle redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle redirection");
+ return;
+ }
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ cy.handleCryptoRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ cy.step("Retrieve Payment Call Test", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment Call Test");
+ return;
+ }
+ cy.retrievePaymentCallTest({ globalState });
+ });
});
});
});