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

Fix source maps / code frame for cy.origin with dependencies #23365

Closed
chrisbreiding opened this issue Aug 16, 2022 · 2 comments · Fixed by #24367
Closed

Fix source maps / code frame for cy.origin with dependencies #23365

chrisbreiding opened this issue Aug 16, 2022 · 2 comments · Fixed by #24367
Assignees

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Aug 16, 2022

What would you like?

Currently, if there's a test failure inside the cy.origin() callback and it requires dependencies, the error code frame shows the object the callback is replaced with and not the original source code. We need to connect the extracted callback with the source code through source maps and ensure the code frame shows the original source.

The following code:

cy.visit('/fixtures/primary-origin.html')
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
cy.origin('http://foobar.com:3500', () => {
  Cypress.require('./does-not-exist')
})

yields the following error/code frame:

Image

Why is this needed?

It's important for debugging failures to see the original source code. It's confusing to see this artifact the source callback is replaced with instead of the callback itself.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 28, 2022

The code for this is done in cypress-io/cypress#24367, 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 Oct 28, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 10, 2022

Released in 11.0.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 10, 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.

3 participants