Current behavior:
When I use the not.contain assertion chained off of .contains(), it falsely fails. I suspect this is some regression introduced in #5653 cc @sainthkh
3.8.3

4.0.0

Desired behavior:
The div does not contain the text new and should pass.
Test code to reproduce
index.html
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div>actions.spec.js</div>
</body>
</html>
This test falsely fails ❌
it('repro', () => {
cy.visit('index.html')
cy.contains('actions.spec.js')
.should('not.contain', 'new')
})
This test passes though ✅
This makes me believe it has to do with the return value of cy.contains()
it('repro', () => {
cy.visit('index.html')
cy.get('div')
.should('not.contain', 'new') // passes
})
And this passes though ✅
it('repro', () => {
cy.visit('index.html')
cy.contains('actions.spec.js').then((el) => {
}).should('not.contain', 'new') // passes
})
Versions
Cypress 4.0.0
Current behavior:
When I use the
not.containassertion chained off of.contains(), it falsely fails. I suspect this is some regression introduced in #5653 cc @sainthkh3.8.3
4.0.0
Desired behavior:
The
divdoes not contain the textnewand should pass.Test code to reproduce
index.htmlThis test falsely fails ❌
This test passes though ✅
This makes me believe it has to do with the return value of
cy.contains()And this passes though ✅
Versions
Cypress 4.0.0