Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cypress replace response part

it('Should have the correct values in monthly', () => {
    cy.intercept('POST', `**/full`, (req) => {
      req.continue(res => {
        res.body.data.monthly = 5000;
        res.send(res);
      })
    });
    cy.fixture('calculator/monthlyRepayment.json').as('fixtures:monthlyRepayment');
    cy.route('POST', `**/full`, '@fixtures:monthlyRepayment').as(`request:fullData`);

    cy.get('[data-test="calculator:monthlyRepayment"]').should('contain', '$5000.00');
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cypress #replace #response #part
ADD COMMENT
Topic
Name
3+2 =