Created
May 15, 2016 20:00
-
-
Save rjurado01/975e9116fde531483cd57c3d5e9a11c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test drag and drop of jquery-ui-sortable with capybara | |
# based on: http://heywill.com/blog/2012/12/15/using-capybara-to-drag-a-jquery-ui-sortable-onto-a-jquery-ui-droppable | |
offset = page.evaluate_script("$('#sortable').offset()") | |
top = offset['top'] + 20 | |
left = offset['left'] | |
page.execute_script("$('body').append('<div id=\"test\" style=\"position: fixed; top: #{top}px; left: #{left}px; width: 10px; height: 10px;\"></div>');") | |
element = page.find("#item_#{item.id}") | |
test_element = page.find('#test') | |
element.drag_to(test_element) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment