In Cypress, I’m able to intercept HTTP call and return arbitrary HttpResponse
by using intercept
command:
cy.intercept("POST", 'some/url', {
statusCode: 200,
// etc.
});
Is it possible to similarly prepare response in a form of HttpProgressEvent
?
I developed file upload using this tutorial, specifically
const req = new HttpRequest('GET', 'someUrl, {
reportProgress: true
});
this.http.request(req)
.subscribe(...); //here all the handling stuff is located
and since the file is quite large, I’d like to see some loading marker in the UI and also to test, that it is displayed, using Cypress.