Right now I'm using the selenium driver with Capybara, but I'd like to switch to using Poltergeist. A lot of the interface I'm testing, though, involves dragging and dropping elements in particular locations on the page. I've written the following method for dragging and dropping, which works in selenium:
def drag_drop(page, draggable, droppable, xoffset, yoffset)
driver = page.driver.browser
driver.mouse.move_to(draggable.native, draggable.native.size.height / 2, draggable.native.size.width / 2)
driver.mouse.down
driver.mouse.move_to(droppable.native, droppable.native.size.height / 2 + yoffset, droppable.native.size.width / 2 + xoffset)
driver.mouse.up
end
How would I go about writing something like this in poltergeist?
drag_to
it doesn't register as having landed in the appropriate area. – Humanitarianism