Skip to content

Commit

Permalink
Add example tests for the drag and drop behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels Dequeker committed Aug 26, 2015
1 parent 021be6a commit eccf109
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions e2e/basic-example/basic-example.js
Expand Up @@ -30,4 +30,18 @@ describe('the Basic example page', function () {
});
});
});

describe('the dragging and dropping of nodes', function () {
it('should allow moving a node below another node', function () {
// TODO
});

it('should allow adding a node to another node to make it a child-node', function () {
// TODO
});

it('should allow removing a child-node from a node to put it on the same tree level', function () {
// TODO
});
});
});

1 comment on commit eccf109

@jmcollin78
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to make a Drag and Drop work with Protractor but i'm facing a problem I cannot figure out.
The drag seems to be too fast and ui-tree doesn't trigger any change. This is like if the move part of the drag and drop is not done.
Example of code is:

browser.actions().dragAndDrop(browser.findElement(by.css(sourceNodeCss)), {x : -50, y: 0 }).perform();

But if you make some extra step in the move it's works. Example:

browser.actions().mouseMove(browser.findElement(by.css(sourceNodeCss))).mouseDown().mouseMove({x:-10, y:0}).mouseMove({x:-10, y:0}).mouseMove({x:-10, y:0}).mouseMove({x:-10, y:0}).mouseMove({x:-10, y:0}).perform();

I hope this helps.

Please sign in to comment.