Method: PageObject::Accessors#text_area
- Defined in:
- lib/page-object/accessors.rb
#text_area(name, identifier = {:index => 0}, &block) ⇒ Object Also known as: textarea
adds four methods to the page object - one to set text in a text area, another to retrieve text from a text area, another to return the text area element, and another to check the text area’s existence.
270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/page-object/accessors.rb', line 270 def text_area(name, identifier={:index => 0}, &block) standard_methods(name, identifier, 'text_area_for', &block) define_method(name) do return platform.text_area_value_for identifier.clone unless block_given? self.send("#{name}_element").value end define_method("#{name}=") do |value| return platform.text_area_value_set(identifier.clone, value) unless block_given? self.send("#{name}_element").value = value end end |