diff --git a/cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js b/cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js index 613e0702f3d8..16ba0721ef7b 100644 --- a/cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js +++ b/cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js @@ -40,14 +40,15 @@ describe("Auto Retries & Step Up 3DS", () => { cy.merchantRetrieveCall(globalState); }); }); - context("Auto retries", () => { - context("[ON] Auto retries", () => { + + context("Auto Retries", () => { + context("[Config: enable] Auto retries", () => { it("Enable auto retries", () => { cy.autoRetryConfig(fixtures.configs.gsm, globalState, "true"); }); - context("Adyen -> Stripe auto retries", () => { - context("Max auto retries", () => { + context("Max auto retries", () => { + context("Adyen -> Stripe auto retries", () => { context("Enable routing configs", () => { before("seed global state", () => { cy.task("getGlobalState").then((state) => { @@ -96,8 +97,8 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); - context("Max auto retries = 1", () => { - const max_auto_retries = 1; + context("Max auto retries = 2", () => { + const max_auto_retries = 2; it("Update max auto retries", () => { cy.setMaxAutoRetries( fixtures.configs.max_auto_retries, @@ -127,7 +128,7 @@ describe("Auto Retries & Step Up 3DS", () => { it("Payment confirm call", () => { let data = utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmSuccess" + "BluesnapConfirm" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -149,8 +150,9 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); }); - context("Max auto retries = 0", () => { - const max_auto_retries = 0; + + context("Max auto retries = 1", () => { + const max_auto_retries = 1; it("Update max auto retries", () => { cy.setMaxAutoRetries( fixtures.configs.max_auto_retries, @@ -180,7 +182,7 @@ describe("Auto Retries & Step Up 3DS", () => { it("Payment confirm call", () => { let data = utils.getConnectorDetails("autoretries")["card_pm"][ - "AdyenConfirmFail" + "StripeConfirmSuccess" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -202,9 +204,8 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); }); - - context("Max auto retries = 2", () => { - const max_auto_retries = 2; + context("Max auto retries = 0", () => { + const max_auto_retries = 0; it("Update max auto retries", () => { cy.setMaxAutoRetries( fixtures.configs.max_auto_retries, @@ -234,7 +235,7 @@ describe("Auto Retries & Step Up 3DS", () => { it("Payment confirm call", () => { let data = utils.getConnectorDetails("autoretries")["card_pm"][ - "BluesnapConfirm" + "AdyenConfirmFail" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -257,10 +258,8 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); }); - }); - context("Stripe -> Adyen auto retries", () => { - context("Max auto retries", () => { + context("Stripe -> Adyen auto retries", () => { context("Enable routing configs", () => { before("seed global state", () => { cy.task("getGlobalState").then((state) => { @@ -309,8 +308,8 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); - context("Max auto retries = 1", () => { - const max_auto_retries = 1; + context("Max auto retries = 2", () => { + const max_auto_retries = 2; it("Update max auto retries", () => { cy.setMaxAutoRetries( fixtures.configs.max_auto_retries, @@ -340,7 +339,7 @@ describe("Auto Retries & Step Up 3DS", () => { it("Payment confirm call", () => { let data = utils.getConnectorDetails("autoretries")["card_pm"][ - "AdyenConfirm" + "BluesnapConfirm" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -362,8 +361,9 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); }); - context("Max auto retries = 0", () => { - const max_auto_retries = 0; + + context("Max auto retries = 1", () => { + const max_auto_retries = 1; it("Update max auto retries", () => { cy.setMaxAutoRetries( fixtures.configs.max_auto_retries, @@ -393,7 +393,7 @@ describe("Auto Retries & Step Up 3DS", () => { it("Payment confirm call", () => { let data = utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmFail" + "AdyenConfirm" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -416,8 +416,8 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); - context("Max auto retries = 2", () => { - const max_auto_retries = 2; + context("Max auto retries = 0", () => { + const max_auto_retries = 0; it("Update max auto retries", () => { cy.setMaxAutoRetries( fixtures.configs.max_auto_retries, @@ -447,7 +447,7 @@ describe("Auto Retries & Step Up 3DS", () => { it("Payment confirm call", () => { let data = utils.getConnectorDetails("autoretries")["card_pm"][ - "BluesnapConfirm" + "StripeConfirmFail" ]; let req_data = data["Request"]; let res_data = data["Response"]; @@ -471,260 +471,154 @@ describe("Auto Retries & Step Up 3DS", () => { }); }); }); - }); - context("[OFF] Auto retries", () => { - it("Disable auto retries", () => { - cy.autoRetryConfig(fixtures.configs.gsm, globalState, "false"); - }); - context("[Failed] Make payment", () => { - it("Payment create call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "PaymentIntent" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createPaymentIntentTest( - fixtures.createPaymentBody, - req_data, - res_data, - "no_three_ds", - "automatic", - globalState - ); - }); + context("Step up 3DS", () => { + context("[Config: set] GSM", () => { + it("[Config: enable] Step up GSM", () => { + cy.updateGsmConfig(fixtures.gsmBody.gsm_update, globalState, true); + }); - it("Payment confirm call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmFail" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.confirmCallTest( - fixtures.confirmBody, - req_data, - res_data, - true, - globalState - ); + it("[Config: enable] Setup up for Stripe", () => { + cy.stepUp(fixtures.configs.step_up, globalState, '["stripe"]'); + }); }); - it("Payment retrieve call", () => { - cy.retrievePaymentCallTest(globalState, true); - }); - }); - context("[Success] Make payment", () => { - it("Payment create call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "PaymentIntent" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createPaymentIntentTest( - fixtures.createPaymentBody, - req_data, - res_data, - "no_three_ds", - "automatic", - globalState - ); - }); + context("Make Payment", () => { + const max_auto_retries = 1; + it("Update max auto retries", () => { + cy.setMaxAutoRetries( + fixtures.configs.max_auto_retries, + globalState, + `${max_auto_retries}` + ); + }); - it("Payment confirm call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmSuccess" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.confirmCallTest( - fixtures.confirmBody, - req_data, - res_data, - true, - globalState - ); - }); + it("Payment create call", () => { + let data = + utils.getConnectorDetails("autoretries")["card_pm"][ + "PaymentIntent" + ]; + let req_data = data["Request"]; + let res_data = data["Response"]; + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + req_data, + res_data, + "no_three_ds", + "automatic", + globalState + ); + }); - it("Payment retrieve call", () => { - cy.retrievePaymentCallTest(globalState, true); - }); - }); - }); - }); + it("Payment confirm call", () => { + let data = + utils.getConnectorDetails("autoretries")["card_pm"][ + "StripeConfirm3DS" + ]; + let req_data = data["Request"]; + let res_data = data["Response"]; + cy.confirmCallTest( + fixtures.confirmBody, + req_data, + res_data, + true, + globalState + ); + }); - context("Step up 3DS", () => { - context("[ON] Step up", () => { - context("Setup GSM", () => { - it("[Step up] GSM Config enable", () => { - cy.updateGsmConfig(fixtures.gsmBody.gsm_update, globalState, true); - }); - it("Enable step up", () => { - cy.stepUp(fixtures.configs.step_up, globalState, '["stripe"]'); + it("Payment retrieve call", () => { + cy.retrievePaymentCallTest(globalState, true, max_auto_retries + 1); + }); }); }); + }); - context("[Failed] Make payment", () => { - it("Payment create call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "PaymentIntent" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createPaymentIntentTest( - fixtures.createPaymentBody, - req_data, - res_data, - "no_three_ds", - "automatic", - globalState - ); - }); - - it("Payment confirm call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmFail" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.confirmCallTest( - fixtures.confirmBody, - req_data, - res_data, - true, - globalState - ); - }); - - it("Payment retrieve call", () => { - cy.retrievePaymentCallTest(globalState, true); - }); + context("[OFF] Auto retries", () => { + it("[Config: disable] Auto retries", () => { + cy.autoRetryConfig(fixtures.configs.gsm, globalState, "false"); }); - context("[Success] Make payment", () => { - it("Payment create call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "PaymentIntent" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createPaymentIntentTest( - fixtures.createPaymentBody, - req_data, - res_data, - "no_three_ds", - "automatic", - globalState - ); - }); - - it("Payment confirm call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmSuccess" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.confirmCallTest( - fixtures.confirmBody, - req_data, - res_data, - true, - globalState - ); - }); - - it("Payment retrieve call", () => { - cy.retrievePaymentCallTest(globalState, true); - }); - }); - }); - context("[OFF] Step up", () => { - it("[Step up] GSM Config disable", () => { + it("[Config: disable] Step up GSM", () => { cy.updateGsmConfig(fixtures.gsmBody.gsm_update, globalState, false); }); - context("[Failed] Make payment", () => { - it("Payment create call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "PaymentIntent" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createPaymentIntentTest( - fixtures.createPaymentBody, - req_data, - res_data, - "no_three_ds", - "automatic", - globalState - ); - }); + context("Make payment", () => { + context("[Failed] Make payment", () => { + it("Payment create call", () => { + let data = + utils.getConnectorDetails("autoretries")["card_pm"][ + "PaymentIntent" + ]; + let req_data = data["Request"]; + let res_data = data["Response"]; + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + req_data, + res_data, + "no_three_ds", + "automatic", + globalState + ); + }); - it("Payment confirm call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmFail" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.confirmCallTest( - fixtures.confirmBody, - req_data, - res_data, - true, - globalState - ); - }); + it("Payment confirm call", () => { + let data = + utils.getConnectorDetails("autoretries")["card_pm"][ + "StripeConfirmFail" + ]; + let req_data = data["Request"]; + let res_data = data["Response"]; + cy.confirmCallTest( + fixtures.confirmBody, + req_data, + res_data, + true, + globalState + ); + }); - it("Payment retrieve call", () => { - cy.retrievePaymentCallTest(globalState, true); + it("Payment retrieve call", () => { + cy.retrievePaymentCallTest(globalState, true); + }); }); - }); - context("[Success] Make payment", () => { - it("Payment create call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "PaymentIntent" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createPaymentIntentTest( - fixtures.createPaymentBody, - req_data, - res_data, - "no_three_ds", - "automatic", - globalState - ); - }); + context("[Succeeded] Make payment", () => { + it("Payment create call", () => { + let data = + utils.getConnectorDetails("autoretries")["card_pm"][ + "PaymentIntent" + ]; + let req_data = data["Request"]; + let res_data = data["Response"]; + cy.createPaymentIntentTest( + fixtures.createPaymentBody, + req_data, + res_data, + "no_three_ds", + "automatic", + globalState + ); + }); - it("Payment confirm call", () => { - let data = - utils.getConnectorDetails("autoretries")["card_pm"][ - "StripeConfirmSuccess" - ]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.confirmCallTest( - fixtures.confirmBody, - req_data, - res_data, - true, - globalState - ); - }); + it("Payment confirm call", () => { + let data = + utils.getConnectorDetails("autoretries")["card_pm"][ + "StripeConfirmSuccess" + ]; + let req_data = data["Request"]; + let res_data = data["Response"]; + cy.confirmCallTest( + fixtures.confirmBody, + req_data, + res_data, + true, + globalState + ); + }); - it("Payment retrieve call", () => { - cy.retrievePaymentCallTest(globalState, true); + it("Payment retrieve call", () => { + cy.retrievePaymentCallTest(globalState, true); + }); }); }); });