spec/pageobjects/core_page_object.rb
def drag_and_drop_js(source, target)
    jquery = Rails.root.join('spec/js_helpers/jquery-3.3.1.min.js').read
    dnd = Rails.root.join('spec/js_helpers/drag_and_drop_helper.js').read

    Capybara.current_session.driver.browser.execute_script(jquery)
    Capybara.current_session.driver.browser.execute_script(dnd)
    Capybara.current_session.driver.browser.execute_script("$('#{source}').simulateDragDrop({ dropTarget: '#{target}'});")
  end
# based on js helper and jquery
based on js helper and jquery
based on js helper and jquery
def drag_and_drop_js(source, target)
    jquery = Rails.root.join('spec/js_helpers/jquery-3.3.1.min.js').read
    dnd = Rails.root.join('spec/js_helpers/drag_and_drop_helper.js').read
    Capybara.current_session.driver.browser.execute_script(jquery)
    Capybara.current_session.driver.browser.execute_script(dnd)
    Capybara.current_session.driver.browser.execute_script("$('#{source}').simulateDragDrop({ dropTarget: '#{target}'});")
  end
def drag_and_drop_js ( source , target ) jquery = Rails . root . join ( 'spec/js_helpers/jquery-3.3.1.min.js' ) . read dnd = Rails . root . join ( 'spec/js_helpers/drag_and_drop_helper.js' ) . read Capybara . current_session . driver . browser . execute_script ( jquery ) Capybara . current_session . driver . browser . execute_script ( dnd ) Capybara . current_session . driver . browser . execute_script ( "$('#{source}').simulateDragDrop({ dropTarget: '#{target}'});" ) end
based on js helper and jquery
based on js helper and jquery
source
target