Playwright: drag and drop

Created on 25 Feb 2020  路  5Comments  路  Source: microsoft/playwright

Drag and drop should work with playwright. Using the existing mouse apis should generate working dragstart, drag, and drop events. There should also be new APIs to simulate dropping in external content, and to inspect content dragged from the web page.

v1.7

All 5 comments

Chromium

I had a patch that tries to do this years ago. Maybe I can revive it? It ended up touching a lot of layers.
https://chromium-review.googlesource.com/c/chromium/src/+/1340803

WebKit

Blocked on WPE not having drag and drop enabled. I'll have to enable it first before deciding how to mock it with playwright.

Firefox

I haven't investigated firefox yet.

Is it possible to drag and drop at this stage?

Is there a way to drag and drop an element to a particular location on the page? I want to be able to drag and drop either horizontally or vertically by a certain pixels. The current dragAnddrop() method brings the dragger back to its original position as I'm not able to drag it enough to drop it in placeholder.

Hi ! i wanna know if there is a solution to test drag and drop angular with playwright.
I tried to use this code:
await page.dispatchEvent('#target', 'a', { draggableElem });
but it didn't work !
any help plz !
i'm using angular 9 / playwright 1.3.0

Any update on this? when drag & drop is planned to be implemented?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pdehaan picture pdehaan  路  3Comments

arjunattam picture arjunattam  路  4Comments

etnbrd picture etnbrd  路  4Comments

myobie picture myobie  路  3Comments

shirshak55 picture shirshak55  路  3Comments