class Wrapybara::Button
Public Class Methods
new(identifier, scope = default_scope, how = default_how)
click to toggle source
# File lib/wrapybara/elements/button.rb, line 5 def initialize(identifier, scope = default_scope, how = default_how) @identifier = identifier @how = how @scope = scope xpath = XPath::HTML.button(identifier) @element = get_element(xpath, scope) end
Public Instance Methods
click()
click to toggle source
# File lib/wrapybara/elements/button.rb, line 21 def click self.should_exist # Capybara method @element.click end
should_exist()
click to toggle source
Calls superclass method
Wrapybara::Element#should_exist
# File lib/wrapybara/elements/button.rb, line 13 def should_exist super "Expected a button #{self.element_identifier} to exist" end
should_not_exist()
click to toggle source
Calls superclass method
Wrapybara::Element#should_not_exist
# File lib/wrapybara/elements/button.rb, line 17 def should_not_exist super "Did not expect a button #{self.element_identifier}' to exist" end