Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.intercept() does not provide statusCode and response body in GUI #18757

Closed
filiphric opened this issue Nov 2, 2021 · 4 comments · Fixed by #20535
Closed

.intercept() does not provide statusCode and response body in GUI #18757

filiphric opened this issue Nov 2, 2021 · 4 comments · Fixed by #20535

Comments

@filiphric
Copy link

Current behavior

I’m having trouble with intercepting a request in my application. I should be able to look into the response body, but it is not visible. Status code is 0. I can see the proper response and status code about once in 100 times, not sure what exactly causes it to appear. But I can see that the dot is grey instead of being blue in the GUI.
Screenshot 2021-11-02 at 22 35 08

Desired behavior

No response

Test code to reproduce

https://github.com/filiphric/trelloapp-vue-vite-ts/blob/failing-to-load-response-body/cypress/integration/example.spec.ts

Cypress Version

8.7.0

Other

No response

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Nov 2, 2021

The status code within the XHR in our own console log expansion shows as 200. I bet there's some falsey check or something somewhere that's making this convert to 0 in our logs.

Or some race condition where it's not defined at the right spot because it does log correctly as 200 sometimes.

Screen Shot 2021-11-02 at 4 11 04 PM

@Igarfinkle
Copy link

I'm also having this issue. Is there a workaround? A way to look at the XMLHttpRequest object for a request that Cypress thinks never completes?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 15, 2022

The code for this is done in cypress-io/cypress#20535, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Mar 15, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 28, 2022

Released in 9.5.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.5.3, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants