Method: Capybara::Node::Element#trigger

Defined in:
lib/capybara/node/element.rb

#trigger(event) ⇒ Capybara::Node::Element

Trigger any event on the current element, for example mouseover or focus events. Not supported with the Selenium driver, and SHOULDN’T BE USED IN TESTING unless you fully understand why you’re using it, that it can allow actions a user could never perform, and that it may completely invalidate your test.

Parameters:

  • event (String)

    The name of the event to trigger

Returns:


390
391
392
393
# File 'lib/capybara/node/element.rb', line 390

def trigger(event)
  synchronize { base.trigger(event) }
  self
end