-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Drag and Drop is confusing. Document better, or create a better syntax to work with it #1205
Comments
What about: /**
* Schedules an ElementFinder's new dragAndDrop({x: x, y: y}) action sequence.
* @return {!webdriver.promise.Promise} A promise that will
* be resolved when the element is drag and dropped.
*/
ElementFinder.prototype.dragAndDrop = function(x, y) {
return browser.actions().dragAndDrop(this,
{ x: x, y: y }).perform();
}; |
@elgalu I like that. I still think we'll need documentation for other cases though (eventually someone will have to do a mouseMove or something), so in either case unless we want to completely wrap every possible thing in the action sequence (which I don't think we do) we'll need better documentation on how the methods under |
I say let's wrap it all!! :) elm.dragAndDrop(10, 50).mouseDown().mouseUp().click(); // and so on.. |
How about just
That way you can test that the behavior while the drag is occurring is correct, e.g.: elem1.dragTo(elem2);
expect(container).to.eventually.have.class('pointer')
elem1.drop(); Of course, elem2 could be either an element or an {x:,y:} offset pair. |
I try to use dragAndDrop with protractor and I would like to know if you could add the following function :
Indeed, there's no function allowing user to drag and drop an element into another one at a specific offset. thanks |
@juliemr |
@BarTsouri you can contribute by making possible stuff like elm.doubleClick();
elm.mouseMove();
elm1.dragAndDrop(elm2);
elm.dragAndDrop(10, 50);
elm.dragAndDrop(10, 50).mouseDown().mouseUp().click(); // and so on.. And updating related documentation. |
Any advance on this topic ? |
We're not going to make any API changes. However, I'll do the following
|
Using an action sequence is hard, and causes a lot of confusion. Let's discuss how to make this easier.
The text was updated successfully, but these errors were encountered: