Does cypress support chained not? #9598
Answered
by
jennifer-shehane
quad5
asked this question in
Questions and Help
-
Code:
It works in browser's console as: |
Beta Was this translation helpful? Give feedback.
Answered by
jennifer-shehane
Dec 11, 2020
Replies: 1 comment
-
Yes, it does support chaining multiple nots.
<html>
<body>
<div class="foo">Foo
<div class="bar type-more">Foo 1</div>
<div class="bar hide">Foo 2</div>
<div class="bar">Foo 3</div>
<div class="bar type-more">Foo 4</div>
<div class="bar hide">Foo 5</div>
</div>
<div class="baz">Baz
<div class="bar">Foo 1</div>
<div class="bar">Foo 2</div>
<div class="bar">Foo 3</div>
<div class="bar">Foo 4</div>
<div class="bar">Foo 5</div>
</div>
</body>
</html>
it('test', () => {
cy.visit('index.html');
cy.get('.foo')
.find('.bar')
.not('.hide')
.not('.type-more')
.should('contain', 'Foo 3')
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jennifer-shehane
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it does support chaining multiple nots.
index.html
spec.js