mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-18 22:28:38 -05:00
1.6 KiB
1.6 KiB
title, comments, description
| title | comments | description |
|---|---|---|
| not | true |
Remove DOM elements from the set of DOM elements. Opposite of cy.filter()
| Returns | the new DOM element(s) found by the command. |
| Timeout | cy.not will retry for the duration of the defaultCommandTimeout |
cy.not( selector )
Remove the element(s) by it's selector from the elements
Options
Pass in an options object to change the default behavior of cy.not.
cy.not( selector, options )
| Option | Default | Notes |
|---|---|---|
log |
true |
whether to display command in command log |
timeout |
defaultCommandTimeout |
Total time to retry getting the element |
Selector Usage
Filter the current subject to the elements that do not have class active.
cy.get('.left-nav>.nav').find('>li').not('.active')
Command Log
Find all buttons that are not of type submit
cy.get('form').find('button').not('[type="submit"]')
The commands above will display in the command log as:
When clicking on not within the command log, the console outputs the following: