drag and drop - protractor clickanddrug on canvas -


i need automate signature on canvas. when used cucumber used canvas.click_and_drop_by , when try perform using protractor read have use action sequence. how do if i'm using page-objects?

this canvas:

<canvas class="pad float-left" height="100" width="290" title=""></canvas>

this page-object:

function mypage() {      this.firstsignature = element(by.css('.pad')[0]);        this.sign = function() {          var offset = {x:30, y:30};          browser.actions().              mousemove(this.firstsignature, offset).              mousedown().              mousemove(45,45).              mouseup().              performaction();      };  }    module.exports = mypage;

how can make drag work?

there special draganddrop() method:

browser.actions().draganddrop(this.firstsignature, {x: 45, y: 45}).perform(); 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -