From 012fb96683545846354632bb830040f8f7a922d8 Mon Sep 17 00:00:00 2001 From: PiX <69745008+pixincreate@users.noreply.github.com> Date: Fri, 5 Jul 2024 16:43:34 +0530 Subject: [PATCH 1/2] fix(cypress): fix payouts --- .../e2e/PayoutTest/00003-CardTest.cy.js | 48 ---------- .../e2e/PayoutTest/00004-BankTransfer.cy.js | 96 ------------------- 2 files changed, 144 deletions(-) diff --git a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js index 54fa7f31d286..c048180a5c0b 100644 --- a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js +++ b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js @@ -90,52 +90,4 @@ describe("[Payout] Cards", () => { cy.retrievePayoutCallTest(globalState); }); }); - - context("Payout Card with Manual Fulfill - Create Intent + Confirm", () => { - let should_continue = true; // variable that will be used to skip tests if a previous test fails - - it("create-payout-call", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "card_pm" - ]["Create"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createConfirmPayoutTest( - createPayoutBody, - req_data, - res_data, - false, - false, - globalState - ); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("confirm-payout-call", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "card_pm" - ]["Confirm"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.updatePayoutCallTest({}, req_data, res_data, false, globalState); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("fulfill-payout-call-test", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "card_pm" - ]["Fulfill"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.fulfillPayoutCallTest({}, req_data, res_data, globalState); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("retrieve-payout-call-test", () => { - cy.retrievePayoutCallTest(globalState); - }); - }); }); diff --git a/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js index 9001cb212b08..76b1581a12fa 100644 --- a/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js +++ b/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js @@ -143,100 +143,4 @@ describe("[Payout] [Bank Transfer - SEPA]", () => { cy.retrievePayoutCallTest(globalState); }); }); - - context("[Payout] [Bank transfer - SEPA] Manual Confirm", () => { - let should_continue = true; // variable that will be used to skip tests if a previous test fails - - it("confirm-payout-call-with-manual-confirm-test", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "bank_transfer_pm" - ]["sepa"]["Create"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createConfirmPayoutTest( - createPayoutBody, - req_data, - res_data, - false, - true, - globalState - ); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("confirm-payout-call", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "bank_transfer_pm" - ]["sepa"]["Confirm"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.updatePayoutCallTest({}, req_data, res_data, false, globalState); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("fulfill-payout-call-test", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "bank_transfer_pm" - ]["sepa"]["Fulfill"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.fulfillPayoutCallTest({}, req_data, res_data, globalState); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("retrieve-payout-call-test", () => { - cy.retrievePayoutCallTest(globalState); - }); - }); - - context("[Payout] [Bank transfer - SEPA] Manual", () => { - let should_continue = true; // variable that will be used to skip tests if a previous test fails - - it("create-payout-call", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "bank_transfer_pm" - ]["sepa"]["Create"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.createConfirmPayoutTest( - createPayoutBody, - req_data, - res_data, - false, - false, - globalState - ); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("confirm-payout-call", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "bank_transfer_pm" - ]["sepa"]["Confirm"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.updatePayoutCallTest({}, req_data, res_data, false, globalState); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("fulfill-payout-call-test", () => { - let data = utils.getConnectorDetails(globalState.get("connectorId"))[ - "bank_transfer_pm" - ]["sepa"]["Fulfill"]; - let req_data = data["Request"]; - let res_data = data["Response"]; - cy.fulfillPayoutCallTest({}, req_data, res_data, globalState); - if (should_continue) - should_continue = utils.should_continue_further(res_data); - }); - - it("retrieve-payout-call-test", () => { - cy.retrievePayoutCallTest(globalState); - }); - }); }); From 67edb1f9996cfd6af6fb1553a5a94c1b5c95e581 Mon Sep 17 00:00:00 2001 From: PiX <69745008+pixincreate@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:40:23 +0530 Subject: [PATCH 2/2] fix hooks --- .../e2e/PayoutTest/00003-CardTest.cy.js | 19 +++++++++++++------ .../e2e/PayoutTest/00004-BankTransfer.cy.js | 18 ++++++++++++------ .../e2e/PayoutTest/00005-SavePayout.cy.js | 12 ++++++++++++ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js index c048180a5c0b..1dc96e4bd2b8 100644 --- a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js +++ b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js @@ -22,14 +22,15 @@ describe("[Payout] Cards", () => { cy.task("setGlobalState", globalState.data); }); - beforeEach(function () { - if (!should_continue) { - this.skip(); - } - }); - context("Payout Card with Auto Fulfill", () => { let should_continue = true; // variable that will be used to skip tests if a previous test fails + + beforeEach(function () { + if (!should_continue) { + this.skip(); + } + }); + it("confirm-payout-call-with-auto-fulfill-test", () => { let data = utils.getConnectorDetails(globalState.get("connectorId"))[ "card_pm" @@ -57,6 +58,12 @@ describe("[Payout] Cards", () => { context("Payout Card with Manual Fulfill - Create Confirm", () => { let should_continue = true; // variable that will be used to skip tests if a previous test fails + beforeEach(function () { + if (!should_continue) { + this.skip(); + } + }); + it("confirm-payout-call-with-manual-fulfill-test", () => { let data = utils.getConnectorDetails(globalState.get("connectorId"))[ "card_pm" diff --git a/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js index 76b1581a12fa..5a623b77501b 100644 --- a/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js +++ b/cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js @@ -74,15 +74,15 @@ describe("[Payout] [Bank Transfer - SEPA]", () => { cy.task("setGlobalState", globalState.data); }); - beforeEach(function () { - if (!should_continue) { - this.skip(); - } - }); - context("[Payout] [Bank transfer - SEPA] Auto Fulfill", () => { let should_continue = true; // variable that will be used to skip tests if a previous test fails + beforeEach(function () { + if (!should_continue) { + this.skip(); + } + }); + it("confirm-payout-call-with-auto-fulfill-test", () => { let data = utils.getConnectorDetails(globalState.get("connectorId"))[ "bank_transfer_pm" @@ -110,6 +110,12 @@ describe("[Payout] [Bank Transfer - SEPA]", () => { context("[Payout] [Bank transfer - SEPA] Manual Fulfill", () => { let should_continue = true; // variable that will be used to skip tests if a previous test fails + beforeEach(function () { + if (!should_continue) { + this.skip(); + } + }); + it("confirm-payout-call-with-manual-fulfill-test", () => { let data = utils.getConnectorDetails(globalState.get("connectorId"))[ "bank_transfer_pm" diff --git a/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js index 222ecc57ba98..f945a9b5a336 100644 --- a/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js +++ b/cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js @@ -84,6 +84,12 @@ describe("[Payout] Saved Card", () => { () => { let should_continue = true; // variable that will be used to skip tests if a previous test fails + beforeEach(function () { + if (!should_continue) { + this.skip(); + } + }); + it("create customer", () => { cy.createCustomerCallTest(customerCreateBody, globalState); }); @@ -216,6 +222,12 @@ describe("[Payout] Saved Bank transfer", () => { () => { let should_continue = true; // variable that will be used to skip tests if a previous test fails + beforeEach(function () { + if (!should_continue) { + this.skip(); + } + }); + it("create customer", () => { cy.createCustomerCallTest(customerCreateBody, globalState); });