Class: Capybara::Mechanize::Node

Inherits:
RackTest::Node
  • Object
show all
Defined in:
lib/capybara/mechanize/node.rb

Instance Method Summary collapse

Instance Method Details

#clickObject



2
3
4
5
6
7
8
9
# File 'lib/capybara/mechanize/node.rb', line 2

def click
  if tag_name == 'a'
    super
  elsif (tag_name == 'input' and %w(submit image).include?(type)) or
      ((tag_name == 'button') and type.nil? or type == "submit")
    Capybara::Mechanize::Form.new(driver, form).submit(self)
  end
end