Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6d2fedf7
Commit
6d2fedf7
authored
May 31, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make simulateDrag duration configurable
parent
dfebcc7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
spec/features/boards/issue_ordering_spec.rb
spec/features/boards/issue_ordering_spec.rb
+4
-3
spec/support/helpers/drag_to_helper.rb
spec/support/helpers/drag_to_helper.rb
+2
-2
No files found.
spec/features/boards/issue_ordering_spec.rb
View file @
6d2fedf7
...
...
@@ -35,7 +35,7 @@ describe 'Issue Boards', :js do
end
it
'moves un-ordered issue to top of list'
do
drag
(
from_index:
3
,
to_index:
0
)
drag
(
from_index:
3
,
to_index:
0
,
duration:
1180
)
wait_for_requests
...
...
@@ -156,12 +156,13 @@ describe 'Issue Boards', :js do
end
end
def
drag
(
selector:
'.board-list'
,
list_from_index:
1
,
from_index:
0
,
to_index:
0
,
list_to_index:
1
)
def
drag
(
selector:
'.board-list'
,
list_from_index:
1
,
from_index:
0
,
to_index:
0
,
list_to_index:
1
,
duration:
1000
)
drag_to
(
selector:
selector
,
scrollable:
'#board-app'
,
list_from_index:
list_from_index
,
from_index:
from_index
,
to_index:
to_index
,
list_to_index:
list_to_index
)
list_to_index:
list_to_index
,
duration:
duration
)
end
end
spec/support/helpers/drag_to_helper.rb
View file @
6d2fedf7
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
}
}});"
)
def
drag_to
(
list_from_index:
0
,
from_index:
0
,
to_index:
0
,
list_to_index:
0
,
selector:
''
,
scrollable:
'body'
,
duration:
1000
)
evaluate_script
(
"simulateDrag({scrollable: $('
#{
scrollable
}
').get(0),
duration:
#{
duration
}
,
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
while
drag_active?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment