0👍
To spy over a response, you can use the route command instead of spy.
https://docs.cypress.io/api/commands/route.html
it('Example Test', function () {
cy.visit('https://stackoverflow.com/');
cy.server(); // cy.server needs to be invoked first in order to use cy.route command
cy.route({
url: `**/your/request/path/**`,
method: 'POST',
onResponse: (xhr) => {
console.log(xhr);
// here you can assert on xhr.response.body values
}
});
});
- [Vuejs]-I want simple array not [__ob__: Observer]
- [Vuejs]-Chart.js is not Dynamically Updating when the firebase databse is updating. (Vue.js)
Source:stackexchange.com