Cypress Type Command Supported Elements and Events

Profile picture for user arilio666

Cypress type command has some of the supported elements and events. In this article, we will see those.

Elements:

HTML with <body>, <textarea>, tabindex, contenteditable, and also <input> with a defined 'type' attribute such as text, password, email, number, date, week, month, time, datetime-local, search, url, tel, etc.
These are interactable with type, and cypress gives the nod to it.

Events:

Events supported by type command are keydown, keypress, beforeinput, textinput, input, and keyup. Once the unresponsive element is in focus, the cypress can fire these supported events they have for type command.
An event called change is fired when {enter} is pressed or whenever it loses focus.

Conclusion:

These are the supported elements and events by cypress for type command.