Cypress · Middle · Question 72 of 77

What does cy.focused() yield?

Show the answer

Correct answer: The element that currently has focus

Explanation

Combined with key presses, it checks that focus moves where expected, for example into an opened dialog.

Further reading

Problem with a question

Cypress · Middle · question 72

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz