From 490911c64b71ba030693dfad01f268b858ed1063 Mon Sep 17 00:00:00 2001 From: PiX <69745008+pixincreate@users.noreply.github.com> Date: Mon, 2 Dec 2024 20:16:25 +0530 Subject: [PATCH] refactor: do not hard code configs --- .../PaymentTest/00026-IncrementalAuth.cy.js | 22 +++---------------- .../cypress/e2e/PaymentUtils/Cybersource.js | 9 +++++++- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js index f96c8dad2e20..e281fc0a2f7a 100644 --- a/cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js +++ b/cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js @@ -33,7 +33,6 @@ describe.skip("[Payment] Incremental Auth", () => { const newData = { ...data, - Configs: { CONNECTOR_CREDENTIAL: { value: "connector_2" } }, Request: { ...data.Request, request_incremental_authorization: true, @@ -55,12 +54,7 @@ describe.skip("[Payment] Incremental Auth", () => { "card_pm" ]["SaveCardUseNo3DSManualCaptureOffSession"]; - const newData = { - ...data, - Configs: { CONNECTOR_CREDENTIAL: { value: "connector_2" } }, - }; - - cy.confirmCallTest(fixtures.confirmBody, newData, true, globalState); + cy.confirmCallTest(fixtures.confirmBody, data, true, globalState); if (shouldContinue) shouldContinue = utils.should_continue_further(data); }); @@ -100,14 +94,9 @@ describe.skip("[Payment] Incremental Auth", () => { "card_pm" ]["PaymentIntentOffSession"]; - const newData = { - ...data, - Configs: { CONNECTOR_CREDENTIAL: { value: "connector_2" } }, - }; - cy.createPaymentIntentTest( fixtures.createPaymentBody, - newData, + data, "no_three_ds", "manual", globalState @@ -120,14 +109,9 @@ describe.skip("[Payment] Incremental Auth", () => { "card_pm" ]["SaveCardUseNo3DSManualCaptureOffSession"]; - const newData = { - ...data, - Configs: { CONNECTOR_CREDENTIAL: { value: "connector_2" } }, - }; - cy.saveCardConfirmCallTest( fixtures.saveCardConfirmBody, - newData, + data, globalState ); diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js index 9fc9653f0fe0..6d8c42d54ebc 100644 --- a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js +++ b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js @@ -107,6 +107,12 @@ export const connectorDetails = { }, }, PaymentIntentOffSession: { + Configs: { + CONNECTOR_CREDENTIAL: { + specName: "incrementalAuth", + value: "connector_2", + }, + }, Request: { currency: "USD", amount: 6500, @@ -719,7 +725,8 @@ export const connectorDetails = { SaveCardUseNo3DSManualCaptureOffSession: { Configs: { CONNECTOR_CREDENTIAL: { - value: "connector_1", + specName: "incrementalAuth", + value: "connector_2", }, }, Request: {