Intercept and log all API responses with statusCode in errors #26007
Replies: 1 comment
-
I'm using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm wandering if someone have an efficient solution for what I'm trying to do. While running a spec with several tests, sometimes API calls respond with errors (Status 500, or 504, or sometimes 400).
I'd like to catch all this API errors and log them (including the headers, body, etc) in order to have a correct understanding of what happens. Why? Because I miss informations when running in CI and I'd like to see that it's not my tests that are failing, but backend not able to respond.
I can intercept all the call with
cy.intercept
but I don't want to fall in performance issues and add more flakyness because of this.What is the best approach? Thanks for your help and suggestions! And sorry if there is an existing similar discussions, I didn't find it. Most of the time, there is a blog or video post made by Gleb Bahmutov but not this time :)
Beta Was this translation helpful? Give feedback.
All reactions