class Wrapybara::FileField
Public Class Methods
new(identifier, scope = default_scope, how = default_how)
click to toggle source
# File lib/wrapybara/elements/file_field.rb, line 5 def initialize(identifier, scope = default_scope, how = default_how) @identifier = identifier @how = how @scope = scope xpath = XPath::HTML.file_field(identifier) @element = get_element(xpath, scope) end
Public Instance Methods
attach_file(path)
click to toggle source
# File lib/wrapybara/elements/file_field.rb, line 13 def attach_file(path) self.should_exist # Capybara method @element.set(path) end
should_exist()
click to toggle source
Calls superclass method
Wrapybara::Element#should_exist
# File lib/wrapybara/elements/file_field.rb, line 19 def should_exist super "Expected a file field #{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/file_field.rb, line 23 def should_not_exist super "Did not expect a file field #{self.element_identifier}' to exist" end