class Applitools::Selenium::Keyboard
@!visibility private
Attributes
Public Class Methods
Source
# File lib/applitools/selenium/keyboard.rb, line 12 def initialize(driver, keyboard) @driver = driver @keyboard = keyboard end
Creates a new Applitools::Selenium::Keyboard
instance.
@param [Applitools::Selenium::Driver] driver The driver instance. @param [Selenium::WebDriver::Keyboard] keyboard The keyboard instance.
Public Instance Methods
Source
# File lib/applitools/selenium/keyboard.rb, line 32 def press(key) keyboard.press(key) end
Press the key.
@param [String] key The key to press.
Source
# File lib/applitools/selenium/keyboard.rb, line 39 def release(key) keyboard.release(key) end
Release the key.
@param [String] key The key to release.
Source
# File lib/applitools/selenium/keyboard.rb, line 20 def send_keys(*keys) active_element = Applitools::Selenium::Element.new(driver, driver.switch_to.active_element) current_control = active_element.region Selenium::WebDriver::Keys.encode(keys).each do |key| driver.user_inputs << Applitools::Base::TextTrigger.new(key.to_s, current_control) end keyboard.send_keys(*keys) end
Types the keys into a text box.
@param [Array] keys The keys to type into the text box.