You can create your custom drag&drop using buttonDown and buttonUp methods:
dragAndDrop(element, x = 0, y = 0) {
element.moveTo();
browser.buttonDown(0);
element.moveTo(x, y);
browser.buttonUp(0);
}
You can use otherElement.moveTo();
insted of element.moveTo(x, y);
in order to move to specific element.
Also you can use performActions()
function, like this:
const dragAndDrop = (element, x = 0, y = 0) => {
const location = getElementLocation(element);
browser.performActions([
{
type: 'pointer',
id: 'finger1',
parameters: { pointerType: 'mouse' },
actions: [
{ type: 'pointerMove', duration: 0, x: location.x, y: location.y },
{ type: 'pointerDown', button: 0 },
{ type: 'pointerMove', duration: 0, x: location.x + x, y: location.y + y },
{ type: 'pointerUp', button: 0 },
],
},
]);
};