I have a list of elements so i want to write a function to drag those elements into a container that builds up an object. At the moment in my protractor tests I have found the element. The element is present and is displayed. The only place I'm running into problems is when I try to translate or drag and drop its position on the screen. At the moment i'm using
browser.actions().dragAndDrop(element1.getWebElement(), { x: -500, y: 20 }).perform();
In order to try drag it -500px to the left and 20px down i've also tried the following
browser.actions()
.mouseDown(element1, {x:10, y:10}) //this show the hovered tool tip
.mouseMove(element1, {x:11, y:11}) //do this to make it "grab" the element
.mouseMove(element2, {x:50, y:50}) //translate its position into the container
.mouseUp()
.preform();
browser.sleep(3000)//allow time for it to drag and the animation to complete.
I'm not sure if i'm using the move elements wrong or if I have the wrong elements so any help would be appreciated.
Thanks.