I try to intercept two similar requests but two different responses in delay between each responses.
- send a first request to the /endpoint with delay in response like 3000ms
- second request to the same /endpoint with delay in response 1000ms
both requests have different response, something difficult to overwrite interceptor here
cy.intercept('POST', '/validate', (req) => {
req.reply({
delay: 3000,
fixture: 'invalidData.json'
});
})
cy.intercept('POST', '/validate', (req) => {
req.reply({
delay: 1000,
fixture: 'validData.json'
});
})