diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-06 16:52:18 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-02-06 11:28:16 +0000 |
commit | 653c23b9c23b6af8c57b45e7d5444e1ca6d34d9a (patch) | |
tree | 72318ea3ae9f968d0f3de2be36ea91786a984ffc /spec/support | |
parent | 572fb0be9b1d45437b7c0ed1000399657f471ec7 (diff) | |
download | gitlab-ce-653c23b9c23b6af8c57b45e7d5444e1ca6d34d9a.tar.gz |
Removed jQuery UI sortableremove-jquery-ui-sortable
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 |