Cypress · Method
cy.filter
cy.filter() keeps only the elements in the current DOM subject that match a selector or pass a test function. It is a retryable query, so more Cypress commands can be chained after it.
Last updated
- Since
- 12.0.0
Syntax
.filter(selector)
.filter(selector, options)
.filter(fn)
.filter(fn, options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
.not().find().contains().first()