Skip to content

Instantly share code, notes, and snippets.

@JonRowe
Created January 18, 2013 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonRowe/4561553 to your computer and use it in GitHub Desktop.
Save JonRowe/4561553 to your computer and use it in GitHub Desktop.
The Drag & Drop Challenge.... Can you automate this? I can't... Have tried: phantomjs, capybara-webkit, selenium (firefox & chrome)...
describe 'dragging and dropping', type: :js do
let(:manually) { page.driver.browser.action }
specify do
visit 'http://html5demos.com/drag'
find('#two').drag_to find('#bin')
#doesn't work so try...
Capybara.current_driver = :selenium
# I've tried both firefox and chrome...
visit 'http://html5demos.com/drag'
manually.click_and_hold find('#two').native
manually.move_by -200, 0
manually.release
manually.perform
page.should_not have_css '#two'
#still doesn't work :(
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment