cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.43k stars 3.14k forks source link

Add "duration" property to interception.response object #20681

Open radekBednarik opened 2 years ago

radekBednarik commented 2 years ago

What would you like?

Hi there, I have a use case, that during my tests, I would like to (need to) custom log response time of specific requests that I am intercepting.

Currently, I can obtain response time only from yielded response object which is provided by cy.request() method.

But I do not want to do another request just to get this information.

I just want to wait for given request using cy.intercept() then wait for the response and the retrieve the response time via some property of the interception.response object.

Thanks for your great work and have a nice day!

Why is this needed?

I need to log response times of some backend apis to have a proof, that some of them have bad performance, even for testing environment. These logs would be needed by the backend team to focus on these issues and improve performance.

I do not want to write specific tests just for pinging API.

I want to monitor api responses during frontend tests using cy.intercept and log the information of the response time.

Other

No response

DrJume commented 1 year ago

It would be immensly helpful!

ugurcanh commented 1 year ago

Still we are waiting for this enhancement. Is there any update? @emilyrohrbough