One of the network requests made by the browser has a payload like:
Before the request is sent I want to change the amount, but leave the rest of the payload unchanged.
I have tried the below 2 methods to achieve this just to see what happens, but as expected, neither worked:
cy.intercept('POST', '/*/payment', (req) => {
req.body.amount = "2100"
})
cy.intercept('POST', '/*/payment', {
body:{
amount: "2100",
},
})
