Method: PageObject::Accessors#button
- Defined in:
- lib/page-object/accessors.rb
#button(name, identifier = {:index => 0}, &block) ⇒ Object
adds three methods - one to click a button, another to return the button element, and another to check the button’s existence.
458 459 460 461 462 463 464 |
# File 'lib/page-object/accessors.rb', line 458 def (name, identifier={:index => 0}, &block) standard_methods(name, identifier, 'button_for', &block) define_method(name) do return platform. identifier.clone unless block_given? self.send("#{name}_element").click end end |