Method: PageObject::Accessors#paragraph
- Defined in:
- lib/page-object/accessors.rb
#paragraph(name, identifier = {:index => 0}, &block) ⇒ Object Also known as: p
adds three methods - one to retrieve the text of a paragraph, another to retrieve a paragraph element, and another to check the paragraph’s existence.
988 989 990 991 992 993 994 |
# File 'lib/page-object/accessors.rb', line 988 def paragraph(name, identifier={:index => 0}, &block) standard_methods(name, identifier, 'paragraph_for', &block) define_method(name) do return platform.paragraph_text_for identifier.clone unless block_given? self.send("#{name}_element").text end end |