Skip to content
masterclass Buddy

Cypress · Method

cy.trigger

cy.trigger() dispatches a DOM event on an element, window, or document. Use it when an event handler needs an event that commands such as click() or type() do not fire.

Last updated

Syntax

.trigger(eventName)
.trigger(eventName, position)
.trigger(eventName, options)
.trigger(eventName, x, y)
.trigger(eventName, position, options)
.trigger(eventName, x, y, options)

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

Subscribe
  • cy.click()
  • cy.type()
  • cy.press()
  • cy.hover()
  • cy.viewport()
  • cy.spy()

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