Module: Capybara::Selenium::Node::Html5Drag

Defined in:
lib/capybara/selenium/extensions/html5_drag.rb

Instance Method Summary collapse

Instance Method Details

#drag_to(element, delay: 0.05) ⇒ Object

Implement methods to emulate HTML5 drag and drop



7
8
9
10
11
12
13
14
15
# File 'lib/capybara/selenium/extensions/html5_drag.rb', line 7

def drag_to(element, delay: 0.05)
  driver.execute_script MOUSEDOWN_TRACKER
  scroll_if_needed { browser_action.click_and_hold(native).perform }
  if driver.evaluate_script(LEGACY_DRAG_CHECK, self)
    perform_legacy_drag(element)
  else
    perform_html5_drag(element, delay)
  end
end