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

We should stringify an empty jQuery element better #14279

Labels
pkg/driver This is due to an issue in the packages/driver directory type: error message

Comments

@bahmutov
Copy link
Contributor

When throwing an error, I see the following

Screen Shot 2020-12-22 at 2 29 22 PM

Which is due to code in $utils.stringifyActual(subject)

Debugging this I see an empty jQuery element.

Screen Shot 2020-12-22 at 2 29 14 PM

We can definitely report a better message instead of {}

I will create a better reproducible example, right now this happens inside a custom command

@jennifer-shehane jennifer-shehane added type: error message stage: ready for work The issue is reproducible and in scope pkg/driver This is due to an issue in the packages/driver directory labels Dec 23, 2020
@sainthkh
Copy link
Contributor

Below is the reproducible example:

it('throws when not passed DOM element as subject', () => {
  cy.visit('fixtures/dom.html')
  cy.noop(cy.$$('#should-not-exist')).scrollTo('250px')
})

Screenshot from 2021-01-27 17-36-01

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 24, 2021

The code for this is done in cypress-io/cypress#14769, 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 Mar 15, 2021

Released in 6.7.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.