Protractor/Jasmine drag and drop only grabbing text not the element

别来无恙 提交于 2019-12-07 17:45:22

问题


I have a Protractor/Jasmine E2E Automation test that is to drag and drop a couple of collapsible panels to change the order and just verify they the elements have been moved.

I'm currently running latest versions of Protractor, Jasmine, and webdrivers (tests run in IE 11)

EDIT: Found out we're using ng-dragula to perform the drag and drops. I'm assuming protractor just isn't playing nicely with this. I'll do more digging about it, but still curious to know if there's a work around. /end edit

This function used to work, and I have since tried a handful of variations of it:

browser.actions().
   mouseMove(dragFromElement).
   mouseDown().
   mouseMove(dropToElement).
   mouseUp().
   perform();

browser.actions().
   dragAndDrop(dragFromElement, dropToElement).
   perform();

I've also tried with .getWebElement() appended to the element tag, getting each elements location and doing a mouse click, move, drop to those locations, and trying various actionSequences instead of actions().

Basically all of the above will highlight the text of the elements like it's clicking behind the panels and does not actually grab the element and drag/drop it.

Curious to know if this is a known problem or if there's a possible solution for my issue.

What i'm working with is:

<core-drag-and-drop-panel _nghost-wod-4="">
  <div class="sortable-panels" _ngcontent-wod-4="">
    <div id="elementId_10" class="draggableDiv" _ngcontent-wod-4="" aria-dropeffect="move" aria-grabbed="false">
    <div id="elementId_12" class="draggableDiv" _ngcontent-wod-4="" aria-dropeffect="move" aria-grabbed="false">
    <div id="elementId_1" class="draggableDiv" _ngcontent-wod-4="" aria-dropeffect="move" aria-grabbed="false">
 </div>
</core-drag-and-drop-panel>

来源:https://stackoverflow.com/questions/41618134/protractor-jasmine-drag-and-drop-only-grabbing-text-not-the-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!