mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
fix cucumber story for drag and drop for dependencies. Was broken since last change of drop target to a hidden img that appears when dragging starts
not a trivial one to fix :-)
This commit is contained in:
parent
238bf97a27
commit
8dbf790810
2 changed files with 8 additions and 3 deletions
|
|
@ -122,7 +122,7 @@ module TodosHelper
|
|||
:title => 'Drag onto another action to make it depend on that action',
|
||||
:class => 'grip') +
|
||||
image_tag('blank.png', :width => 16, :height => 16, :border => 0,
|
||||
:title => "Drop an action to make it depend on this action", :class => 'successor_target')
|
||||
:id => "successor_target_#{@todo.id}", :title => "Drop an action to make it depend on this action", :class => 'successor_target')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,13 @@ When /^I drag "(.*)" to "(.*)"$/ do |dragged, target|
|
|||
drag_id = Todo.find_by_description(dragged).id
|
||||
drop_id = Todo.find_by_description(target).id
|
||||
drag_name = "xpath=//div[@id='line_todo_#{drag_id}']//img[@class='grip']"
|
||||
drop_name = "xpath=//div[@id='line_todo_#{drop_id}']//div[@class='description']"
|
||||
|
||||
drop_name = "xpath=//div[@id='line_todo_#{drop_id}']//img[@id='successor_target_#{drop_id}']"
|
||||
|
||||
# the target img is hidden until drag starts. We need to show the img or the
|
||||
# xpath will not find it
|
||||
js="$('img#successor_target_#{drop_id}').show();"
|
||||
selenium.get_eval "(function() {with(this) {#{js}}}).call(selenium.browserbot.getCurrentWindow());"
|
||||
|
||||
selenium.drag_and_drop_to_object(drag_name, drop_name)
|
||||
|
||||
arrow = "xpath=//div[@id='line_todo_#{drop_id}']/div/a[@class='show_successors']/img"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue