diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2017-02-08 23:31:17 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-02-08 23:31:17 +0000 |
commit | 882027bd7ca7bbe5c2850e671971657324f1499a (patch) | |
tree | bcc744ee025988872634846d44a872cd40bf6f95 /spec/support | |
parent | a6a3df644e39554097bc30b017005d89431336e6 (diff) | |
parent | 653c23b9c23b6af8c57b45e7d5444e1ca6d34d9a (diff) | |
download | gitlab-ce-882027bd7ca7bbe5c2850e671971657324f1499a.tar.gz |
Merge branch 'remove-jquery-ui-sortable' into 'master'
Removed jQuery UI sortable
See merge request !8478
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/drag_to_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/drag_to_helper.rb b/spec/support/drag_to_helper.rb new file mode 100644 index 00000000000..0c0659d3ecd --- /dev/null +++ b/spec/support/drag_to_helper.rb @@ -0,0 +1,13 @@ +module DragTo + def drag_to(list_from_index: 0, from_index: 0, to_index: 0, list_to_index: 0, selector: '', scrollable: 'body') + evaluate_script("simulateDrag({scrollable: $('#{scrollable}').get(0), from: {el: $('#{selector}').eq(#{list_from_index}).get(0), index: #{from_index}}, to: {el: $('#{selector}').eq(#{list_to_index}).get(0), index: #{to_index}}});") + + Timeout.timeout(Capybara.default_max_wait_time) do + loop until drag_active? + end + end + + def drag_active? + page.evaluate_script('window.SIMULATE_DRAG_ACTIVE').zero? + end +end |