lib/symbiont/web_objects/text_field.rb in symbiont-0.1.2 vs lib/symbiont/web_objects/text_field.rb in symbiont-0.1.3
- old
+ new
@@ -1,9 +1,24 @@
module Symbiont
module WebObjects
class TextField < WebObject
-
+ # Get the value of a text field.
+ def value
+ @web_object.value
+ end
+
+ # Set the value of a text field.
+ def value=(value)
+ @web_object.set value
+ end
+
+ # Append text to a text field.
+ def append(text)
+ @web_object.send_keys text
+ 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
\ No newline at end of file
+end # module: Symbiont