Module: Cucumber::Rails::Capybara::JavascriptEmulation

Included in:
Capybara::RackTest::Node
Defined in:
lib/cucumber/rails/capybara/javascript_emulation.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
# File 'lib/cucumber/rails/capybara/javascript_emulation.rb', line 5

def self.included(base)
  base.class_eval do
    alias_method :click_without_javascript_emulation, :click
    alias_method :click, :click_with_javascript_emulation
  end
end

Instance Method Details

#click_with_javascript_emulationObject



12
13
14
15
16
17
18
# File 'lib/cucumber/rails/capybara/javascript_emulation.rb', line 12

def click_with_javascript_emulation
  if link_with_non_get_http_method?
    ::Capybara::RackTest::Form.new(driver, js_form(element_node.document, self[:href], emulated_method)).submit(self)
  else
    click_without_javascript_emulation
  end
end