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

Does not show more than one .should('contain') assertion when chained after .should('be.visible') #16006

Closed
filipsnopek opened this issue Apr 15, 2021 · 4 comments · Fixed by #16218

Comments

@filipsnopek
Copy link

filipsnopek commented Apr 15, 2021

Current behavior

Test runner shows misleading info when more than one .should('contain') assertion is chained after .should('be.visible')
Consider following code

 cy.get('[data-cy=mobile-payments-template]')
        .should('be.visible')
        .should('contain', 'Something')
        .should('contain', '+420 737 799 983');

This is displayed incorrectly in Test runner (notice the replaced to contain Something with to be visible)
image

When I delete the should('be.visible') assertion, it's displayed properly
image

Desired behavior

Display to contain Something
image

Test code to reproduce

Versions

6.8.0

@sainthkh sainthkh added stage: ready for work The issue is reproducible and in scope topic: assertions ✔️ labels Apr 16, 2021
@sainthkh
Copy link
Contributor

Confirmed that it doesn't work on 7.0.1.

index.html

<html lang="en">
  <body>
    <div id="x">Something +123</div>
  </body>
</html>

test.js

it('test', () => {
  cy.visit('index.html')

  cy.get('#x')
  .should('be.visible')
  .should('contain', 'Something')
  .should('contain', '+123')
})

@jennifer-shehane
Copy link
Member

I went back to version 5.2.0, it looks like it's displayed this way for a while.

@jennifer-shehane jennifer-shehane changed the title [6.8.0] Test runner - Misleading info when more than one .should('contain') assertion is chained after .should('be.visible') Does not show more than one .should('contain') assertion when chained after .should('be.visible') Apr 22, 2021
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress stage: needs review The PR code is done & tested, needs review labels Apr 27, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 29, 2021

The code for this is done in cypress-io/cypress#16218, 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 Apr 29, 2021
@jennifer-shehane
Copy link
Member

Released in 7.3.0.

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

@cypress-io cypress-io locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants