嗨,用于拖动的HTML代码是:

  <div class="btn-event"
   dnd-type="'newEvent'" dnd-draggable="event"
   dnd-effect-allowed="copy" dnd-copied="">
  <div class="icon">
  <i class='demo'></i>
  </div>
  <span class="label" title="Object Name">
  {{O.name}}
  </span>
  </div>


删除的代码是:

  <div class="row slot-body"
  dnd-list="sequenceSlot.events"
  dnd-allowed-types="['newEvent']"
  dnd-drop="Drop(event, index, item, external, type, dropped item)"
  dnd-dragover="Drop.validate(event, index, type)">


我们应该通过dragabble搜索吗?还是通过CSS?

最佳答案

使用dragAndDrop()操作方法,例如:

browser.actions().dragAndDrop(
    element(by.css("div[dnd-draggable]")),
    element(by.css("div[dnd-dragover]"))
).perform();

关于javascript - 如何使用 Protractor 为e2e模拟拖放功能?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31651117/

10-09 22:20