Skip to content

Commit

Permalink
add html example to .not assertion (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValerieThoma authored and jennifer-shehane committed Jun 5, 2018
1 parent 6c8c18e commit ef02b3e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/api/commands/not.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,18 @@ Option | Default | Description

***Yield the elements that do not have class `active`.***

```html
<ul>
<li>Home</li>
<li class='active'>About</li>
<li>Services</li>
<li>Pricing</li>
<li>Contact</li>
</ul>
```

```javascript
cy.get('.left-nav>li').not('.active').should('not.have.class', 'active') // true
cy.get('ul>li').not('.active').should('have.length', 4) // true
```

# Rules
Expand Down

0 comments on commit ef02b3e

Please sign in to comment.