class Selenium::WebDriver::Interactions::InputDevice

Attributes

actions[R]
name[R]

Public Class Methods

new(name = nil) click to toggle source
# File lib/selenium/webdriver/common/interactions/input_device.rb, line 27
def initialize(name = nil)
  @name = name || SecureRandom.uuid
  @actions = []
end

Public Instance Methods

add_action(action) click to toggle source
# File lib/selenium/webdriver/common/interactions/input_device.rb, line 32
def add_action(action)
  raise TypeError, "#{action.inspect} is not a valid action" unless action.class < Interaction

  @actions << action
end
clear_actions() click to toggle source
# File lib/selenium/webdriver/common/interactions/input_device.rb, line 38
def clear_actions
  @actions.clear
end
create_pause(duration = 0) click to toggle source
# File lib/selenium/webdriver/common/interactions/input_device.rb, line 42
def create_pause(duration = 0)
  add_action(Pause.new(self, duration))
end
no_actions?() click to toggle source
# File lib/selenium/webdriver/common/interactions/input_device.rb, line 46
def no_actions? # Determine if only pauses are present
  actions = @actions.reject { |action| action.type == Interaction::PAUSE }
  actions.empty?
end