Permalink
Browse files

add Browser#textarea(s) method

  • Loading branch information...
jarmo committed Jan 28, 2012
1 parent cf5e320 commit a449d300f6cc5f75d9b720fdd12b1a6c00d10ae5
Showing with 18 additions and 3 deletions.
  1. +1 −1 watir/lib/watir/collections.rb
  2. +17 −2 watir/lib/watir/input_elements.rb
@@ -23,7 +23,7 @@ class SelectLists < InputElementCollections
def element_tag; 'SELECT'; end
end
- %w[Button FileField Radio TextField Hidden].each do |element|
+ %w[Button FileField Radio TextField TextArea Hidden].each do |element|
module_eval %Q{
class #{element}s < InputElementCollections; end
}
@@ -335,6 +335,10 @@ def abhors_typing #:nodoc:
self
end
+ def label
+ @container.label(:for => name).text
+ end
+
private
# Type the characters in the specified string (value) one by one.
@@ -375,8 +379,19 @@ def limit_to_maxlength(value)
value
end
- def label
- @container.label(:for => name).text
+ end
+
+ class TextArea < TextField
+ INPUT_TYPES = ["textarea"]
+
+ Watir::Container.module_eval do
+ def textareas(how={}, what=nil)
+ TextAreas.new(self, how, what)
+ end
+
+ def textarea(how={}, what=nil)
+ TextArea.new(self, how, what)
+ end
end
end

0 comments on commit a449d30

Please sign in to comment.