1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Use wait_for in drag method

This commit is contained in:
CJ Kihlbom and Jonas Nicklas and Jonas Nicklas 2009-12-14 15:30:51 +01:00 committed by Jonas Nicklas
parent 3eea2c2639
commit 962a66b1e0

View file

@ -44,9 +44,9 @@ module Capybara
end
def drag(source_locator, target_locator)
source = find(source_locator)
source = wait_for(source_locator)
raise Capybara::ElementNotFound, "drag source '#{source_locator}' not found on page" unless source
target = find(target_locator)
target = wait_for(target_locator)
raise Capybara::ElementNotFound, "drag target '#{target_locator}' not found on page" unless target
source.drag_to(target)
end