Skip to content
masterclass Buddy

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.

Subscribe
  • .not()
  • .find()
  • .contains()
  • .first()

Source: cy.filter() | Cypress API Documentation. Checked 2026-11-03.