Puedes escribir algo como:
cy.request({ body: {}, failOnStatusCode: false, }).then((res) => { if (res.status == 404) { cy.log(JSON.stringify(res.body)) //prints the response body cy.log(res.body.name) //prints name cy.log(res.body.message) //prints message } else { //Do Something else } })Puede usar el evento fallido para registrar su respuesta si algún criterio falla.
cy.request({ ... }) .then(res => { Cypress.once('fail', (error, runnable) => { cy.log(JSON.stringify(res)) throw error // throw error to have test still fail }) expect(... expect(... expect(... })