Skip to content
masterclass Buddy

Cypress · Matcher

be.focused

Gets the DOM element that currently has focus. It retries until the element and chained assertions are ready, or until the timeout expires.

Last updated

Since
0.20.0

Syntax

cy.focused()
cy.focused(options)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • .blur()
  • .focus()
  • cy.press()
  • focus assertion

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