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

Regression: clicking a request in the log no longer displays request/response body #17656

Closed
JessefSpecialisterren opened this issue Aug 9, 2021 · 5 comments · Fixed by #18207
Assignees
Labels
type: regression A bug that didn't appear until a specific Cy version release v8.2.0 🐛 Issue present since 8.2.0

Comments

@JessefSpecialisterren
Copy link

Current behavior

After updating to Cypress 8.2.0, request and/or response bodies are no longer displayed in the console when clicking on certain requests in the log. Example:

image

The selected request has both a request body and a response body, but the information displayed in the console suggests that it has neither. Expanding the XmlHttpRequest object does show the response body, but not the request body. This is both misleading and inconvenient when examining requests.

Note that this issue does not seem to affect all requests, but those it does affect, it seems to affect consistently.

Desired behavior

In Cypress 8.1.0, the request and response bodies are clearly shown in the console output:

image

Test code to reproduce

it('', () => {
  cy.visit('http://automationpractice.com/index.php?controller=authentication&back=my-account')
  cy.get('#email_create').type('a@b{enter}')
})

When the test has finished, open the console and click the POST 200 /index.php request at the bottom of the runner log. Note that I do not own or control this website. It appears to be flaky sometimes; if that happens, please try again after a few minutes.

Cypress Version

8.2.0

Other

No response

@flotwig flotwig self-assigned this Aug 9, 2021
@jennifer-shehane jennifer-shehane added type: regression A bug that didn't appear until a specific Cy version release v8.2.0 🐛 Issue present since 8.2.0 stage: needs investigating Someone from Cypress needs to look at this labels Aug 9, 2021
@cypress-bot cypress-bot bot added stage: to do stage: work in progress There is an open PR for this issue [WIP] and removed stage: needs investigating Someone from Cypress needs to look at this stage: to do labels Aug 9, 2021
@Narretz
Copy link
Contributor

Narretz commented Sep 22, 2021

@flotwig any news on this? With fetch, I don't see an option to print the response body at all at the moment (from the cypress ui)

@flotwig
Copy link
Contributor

flotwig commented Sep 22, 2021

@Narretz Even after this fix, response bodies will only be available for XHRs and requests intercepted with cy.intercept(), to match parity with the previously existing functionality.

You are best off using the "Network" tab of the Developer Tools to inspect request/response bodies if your requests do not fit those 2 cases.

Due to how Cypress works, it's a bit of additional work to get the request/response bodies for all requests in the browser. Even with that work being done, there could be a negative performance impact that would have to be debugged. I'm not saying it's not possible or important to add what you're asking for, but just that it's a significant chunk of work to add and it's not part of this fix.

@Narretz
Copy link
Contributor

Narretz commented Sep 23, 2021

Thanks @flotwig, I didn't realize fetch wasn't logged previously. Still a bit of a bummer that it is still special cased in some circumstances.

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress There is an open PR for this issue [WIP] labels Sep 29, 2021
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Sep 30, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 30, 2021

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2021

Released in 8.6.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v8.2.0 🐛 Issue present since 8.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants