microsoft / microsoft/playwright

[Feature] Add drag'n drop support to codegen

Open
#19,892 25 comments 46 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-codegen
Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

**Context:**
- Playwright Version: 1.29.1
- Operating System: Windows
- Node.js version: 16.15.1
- Browser: Chromium

**Describe the bug**

Step to reproduce
1. Run ´npx playwright codegen´
2. In the automated browser window, go to https://www.w3schools.com/html/html5_draganddrop.asp
3. Try to drag the logo in the first box to the second box

The inspector window only registers `click` event on the selector where the mouse was released. No `dragTo` event was registered
Is there any way to achieve this?

![chrome_JGgqMjXdUt](https://user-images.githubusercontent.com/19611757/210782223-3efce5d6-08bd-477e-bffa-efb8516ae1e1.gif)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running `npx playwright codegen` and reproducing the drag operation at the linked W3Schools page in Chromium. Trace how codegen records mouse interactions and compare the result with the expected `dragTo` action. Done means the inspector recognizes the drag-and-drop gesture and generates an appropriate action instead of only a click.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.