lib/symbiont/web_objects/text_field.rb in symbiont-0.1.8 vs lib/symbiont/web_objects/text_field.rb in symbiont-0.1.9
- old
+ new
@@ -1,40 +1,31 @@
module Symbiont
module WebObjects
class TextField < WebObject
- def initialize(web_object, platform)
+ def initialize(web_object)
@web_object = web_object
- include_platform_specifics_for(platform)
end
- def append(text)
- web_object.send_keys text
+ def value
+ web_object.value
end
- def self.usable_selectors_for_watir
- super + [:title, :value, :text, :label]
+ def value=(value)
+ web_object.set value
end
- def self.usable_selectors_for_selenium
- super + [:title, :value, :text, :label]
+ def append(text)
+ web_object.send_keys text
end
- def include_platform_specifics_for(platform)
- super
- if platform[:platform] == :watir_webdriver
- require 'symbiont/platform_watir/web_objects/text_field'
- self.class.send :include, Symbiont::Platforms::WatirWebDriver::TextField
- elsif platform[:platform] == :selenium_webdriver
- require 'symbiont/platform_selenium/web_objects/text_field'
- self.class.send :include, Symbiont::Platforms::SeleniumWebDriver::TextField
- else
- raise ArgumentError, "The platform #{platform[:platform]} appears to be unsupported."
- end
+ def self.usable_selectors
+ super + [:title, :value, :text, :label]
end
end # class: TextField
::Symbiont::WebObjects.class_for_type[:text] = ::Symbiont::WebObjects::TextField
::Symbiont::WebObjects.class_for_type[:password] = ::Symbiont::WebObjects::TextField
+
end # module: WebObjects
end # module: Symbiont