class Wrapybara::Link
Attributes
element[R]
how[R]
identifier[R]
scope[R]
Public Class Methods
new(identifier, scope = default_scope, how = default_how)
click to toggle source
# File lib/wrapybara/elements/link.rb, line 7 def initialize(identifier, scope = default_scope, how = default_how) @identifier = identifier @how = how @scope = scope xpath = "//a[@href='#{identifier}' or @id='#{identifier}' or @title='#{identifier}' or contains(normalize-space(), '#{identifier}')]" @element = get_element(xpath, scope) end
Public Instance Methods
click()
click to toggle source
# File lib/wrapybara/elements/link.rb, line 23 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/link.rb, line 15 def should_exist super "Expected a link #{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/link.rb, line 19 def should_not_exist super "Did not expect a link #{self.element_identifier}' to exist" end