How can I log a "request.body" from cypress interceptor. Here is the code
beforeEach(() => {
cy.log("---- -- Running beforeEach");
cy.intercept("POST", "/graphql", (req) => {
cy.log("-- --- -- loging from interceptor", req.body);
return req;
});
});
I get this error :
Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
If I remove cy.log no errors are raised. So how can I log this? This runs on CI.
Will use https://github.com/flotwig/cypress-log-to-output plugin if no other way.