Cypress · Junior · Question 21 of 75
How do you assert an element is NOT on the page?
- 1
.should('be.null') - 2
.should('be.missing') - 3
.should('not.exist')
Show the answer
Correct answer: .should('not.exist')
Explanation
not.exist passes when the query finds nothing. not.be.visible is different: the element exists but is hidden.