Joeri Timmermans has posted a tutorial to his site showing how you can test drag-and-drop functionality with a combination of the Behat BDD testing tool and the Guzzle HTTP library.
As you could see in previous posts I'm working on a large application for Intracto where they want a lot of fancy visuals and this turned into a mess when it came to write behat tests. This post will help you test position moving with drag and drop.
In his case he was working with a chapter layout that allows for the rearranging of chapters to update their order. The process is then broken up into a few different steps:
- Creating a new context feature for Behat (based on this example)
- Making a custom action that makes it easier to move the chapter entries around by just providing positions
- Calling the move in the Behat test itself
The tricky part here is that the actual test is made for the behavior but the behavior itself is making an API call to rearrange the pages. The test is making this same call and evaluating the result. It's not actually interacting with the page as you might be able to do with something like PhantomJs however.