Class: Fluent::WebElements::TextField

Inherits:
WebElement
  • Object
show all
Defined in:
lib/fluent/web_elements/text_field.rb

Instance Attribute Summary

Attributes inherited from WebElement

#web_element

Instance Method Summary collapse

Methods inherited from WebElement

#class_name, #click, #disabled?, #enabled?, #style, #text

Constructor Details

#initialize(web_element, platform) ⇒ TextField

Returns a new instance of TextField.



5
6
7
8
# File 'lib/fluent/web_elements/text_field.rb', line 5

def initialize(web_element, platform)
  @web_element = web_element
  include_platform_specifics_for platform
end

Instance Method Details

#append(text) ⇒ Object



10
11
12
# File 'lib/fluent/web_elements/text_field.rb', line 10

def append(text)
  web_element.send_keys(text)
end

#include_platform_specifics_for(platform) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/fluent/web_elements/text_field.rb', line 14

def include_platform_specifics_for(platform)
  super
  if platform[:platform] == :watir_webdriver
    require 'fluent/platform_watir/platform_web_elements/text_field'
    self.class.send :include, Fluent::Platforms::WatirWebDriver::TextField
  end
end