I am trying to modify an existing fixture and then override a response with the modified fixture.
I'm able to override the response with predefined fixture or modify the actual response, but I cant do them both at the same time.
For example the actual response can be modified:
cy.intercept("POST", "response", (req) => {
req.continue((res) => {
res.body.result..... = false;
res.send();
});
});
Also I am using this to override responses using a fixture:
Cypress.Commands.add("override", (url: string, fixture: string) => {
cy.intercept(
'url',
fixtureName.json
);
});
I can use cy.readFile() to read the fixture and cy.writeFile() to modify it but I do not want to use this solution.
Thank you in advance