diff --git a/cypress-tests/cypress/e2e/card-flow-e2e-test.cy.ts b/cypress-tests/cypress/e2e/card-flow-e2e-test.cy.ts index 3a2ac50b6..f6769d708 100644 --- a/cypress-tests/cypress/e2e/card-flow-e2e-test.cy.ts +++ b/cypress-tests/cypress/e2e/card-flow-e2e-test.cy.ts @@ -1,6 +1,7 @@ import * as testIds from "../../../src/Utilities/TestUtils.bs"; import { getClientURL } from "../support/utils"; - +import { createPaymentBody } from "../support/utils"; +import { changeObjectKeyValue } from "../support/utils"; describe("Card payment flow test", () => { @@ -9,11 +10,13 @@ describe("Card payment flow test", () => { let getIframeBody : () => Cypress.Chainable>; let iframeSelector = "#orca-payment-element-iframeRef-orca-elements-payment-element-payment-element"; - beforeEach(() => { - getIframeBody = () => cy.iframe(iframeSelector); + // changeObjectKeyValue(createPaymentBody,"profile_id","YOUR_PROFILE_ID") - cy.createPaymentIntent(secretKey).then(()=>{ + + beforeEach(() => { + getIframeBody = () => cy.iframe(iframeSelector); + cy.createPaymentIntent(secretKey,createPaymentBody).then(()=>{ cy.getGlobalState("clientSecret").then((clientSecret)=>{ cy.visit(getClientURL(clientSecret,publishableKey)); diff --git a/cypress-tests/cypress/support/commands.ts b/cypress-tests/cypress/support/commands.ts index e86bdc6c5..9f92541c0 100644 --- a/cypress-tests/cypress/support/commands.ts +++ b/cypress-tests/cypress/support/commands.ts @@ -147,7 +147,7 @@ Cypress.Commands.add( ); -Cypress.Commands.add("createPaymentIntent", (secretKey:string) => { +Cypress.Commands.add("createPaymentIntent", (secretKey:string,createPaymentBody:any) => { return cy .request({ method: "POST", diff --git a/cypress-tests/cypress/support/types.ts b/cypress-tests/cypress/support/types.ts index b847d7a8c..0152c59d3 100644 --- a/cypress-tests/cypress/support/types.ts +++ b/cypress-tests/cypress/support/types.ts @@ -24,7 +24,7 @@ declare global { testDynamicFields( customerData: CustomerData, testIdsToRemoveArr: string[], isThreeDSEnabled: boolean ): Chainable> - createPaymentIntent(secretKey:string): Chainable> + createPaymentIntent(secretKey:string,createPaymentBody:Record ): Chainable> getGlobalState(key: string): Chainable> } } diff --git a/cypress-tests/cypress/support/utils.ts b/cypress-tests/cypress/support/utils.ts index 99c09e7f4..f7b555a5b 100644 --- a/cypress-tests/cypress/support/utils.ts +++ b/cypress-tests/cypress/support/utils.ts @@ -65,6 +65,11 @@ export const createPaymentBody ={ country_code: "+91", }, }, + +} + +export const changeObjectKeyValue=(object:Record ,key:string,value:string)=>{ + object[key]=value } export const confirmBody = {