class Selenium::WebDriver::Interactions::TypingInteraction
Actions related to pressing keys.
@api private
Attributes
Public Class Methods
Source
# File lib/selenium/webdriver/common/interactions/typing_interaction.rb, line 32 def initialize(source, type, key) super(source) @type = assert_type(type) @key = Keys.encode_key(key) end
Calls superclass method
Selenium::WebDriver::Interactions::Interaction::new
Public Instance Methods
Source
# File lib/selenium/webdriver/common/interactions/typing_interaction.rb, line 38 def assert_source(source) raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? KeyInput end
Source
# File lib/selenium/webdriver/common/interactions/typing_interaction.rb, line 42 def assert_type(type) raise TypeError, "#{type.inspect} is not a valid key subtype" unless KeyInput::SUBTYPES.key? type KeyInput::SUBTYPES[type] end
Source
# File lib/selenium/webdriver/common/interactions/typing_interaction.rb, line 48 def encode {type: @type, value: @key} end