0

As many of you know HTML5 drag and drop testing is not supported by protractor tests in AngularJS.

I got this drag-drop-helper.js on the net to simulate this drag and drop functionality. But when I tried to use it in my test spec by importing as node module

var dragdrop = require('./drag-drop-helper.js');

I'm getting the following error

jquery not found

How to solve this issue?

UI_Brain
  • 93
  • 1
  • 9
  • You would need to dynamically load jquery and your drag and drop helper, see more at: http://stackoverflow.com/questions/29381233/how-to-simulate-html5-drag-and-drop-in-selenium-webdriver-in-python. Hope you can apply that solution to protractor. – alecxe May 27 '15 at 12:41
  • Alecxe! I have seen this solution, but not able to apply this to protractor – UI_Brain May 28 '15 at 10:52

1 Answers1

0

Its not that well documented but the protractor API to look at lives under the browser object. Here's a link to the code which after a few reads becomes quite useful:

https://code.google.com/p/selenium/source/browse/javascript/webdriver/actionsequence.js

You typically use it as follows:

browser
    .actions()
    .dragAndDrop(element(by.css(".queen")),{x:100,y:200})
    .perform();

See the dragAndDrop method in the link supplied for definitions :-)

Kieran Ryan
  • 593
  • 2
  • 8
  • 18