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

Assertions failures on DOM elements show unexpected diffs when they weren't retried #6723

Closed
chrisbreiding opened this issue Mar 13, 2020 · 3 comments · Fixed by #6724 or Flygsand/site#83
Assignees

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Mar 13, 2020

Current behavior:

When an assertion involving a dom element retried fails, it shows a diff that includes an ugly dom object.

When an assertion involving a DOM element was NOT retried, the assertion would include the very ugly serialized object in stdout reporters.

Screen Shot 2020-03-13 at 3 21 42 PM
Screen Shot 2020-03-13 at 3 21 54 PM

Note that this doesn't happen if the assertion is retried (with cy.should()).

Desired behavior:

Failing dom assertions should never show a serialized DOM object diff.

Test code to reproduce

it('dom - fails without retry', () => {
  cy.get('body').then(($body) => {
    expect($body).to.have.class('foo')
  })
})

Versions

Cypress 4.1.0

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 13, 2020

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

@chrisbreiding chrisbreiding mentioned this issue Mar 13, 2020
3 tasks
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Mar 16, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Mar 17, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 17, 2020

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

@brian-mann brian-mann changed the title Diff should not be shown when expected or actual is a dom element Assertions failures on DOM elements show unexpected diffs when they weren't retried Mar 30, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 30, 2020

Released in 4.3.0.

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

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

2 participants