How can I use cy.intercept to stub two requests of the same name but return two different bodies?

Viewed 2648

I'm using cy.intercept('GET', '/details', {fixture: '/details.json'}).as('details')to stub a request when loading a page which populates a form. However on that page the form can be edited and a new request is made once the edit is completed, what is the best way to stub the second request of the same name but change the body to the updated information?

1 Answers

Op decided to use cy.server() and cy.route() and this solved the problem.

Related