Bruno Bruzzano
Bruno Bruzzano

Reputation: 477

Intern:Leadfoot - testing drag-n-drop

I have a webapp that uses dojo widgets and drag-n-drop functionalities and I'm using Intern in order to test it. Now I want to test the drag-n-drop mechanism, and for this I hoped to use the Leadfoot's helper, DragAndDrop.js

As seen in the script's example, here my code:

return new DragAndDrop(remote)
    .findByXpath(source)
    .dragFrom()
    .end()
    .findByXpath(target)
    .dragTo()

I have the return statement because this code is part of a promise chain.

However, it seems to be not working and I do not get any kind of errors|exceptions, neither in the browser neither in selenium neither on intern side. Honestly, I have no idea where to start from. Any suggestion? May I provide further information?

Upvotes: 0

Views: 276

Answers (1)

Linh Nguyen
Linh Nguyen

Reputation: 1138

Have you tried

            return remote.findByXpath(target)
                .then(function(targetNode){
                    return remote.findByXpath(source)
                        .moveMouseTo(1,1)
                        .pressMouseButton().sleep(500)
                        .moveMouseTo(targetNode).sleep(500)
                        .releaseMouseButton();
                });

Note: sleep isn't necessary, I put it here so that you can see clearer the actions

Upvotes: 0

Related Questions