Skip to content

feat(locator): Locator.dragTo(Locator) for HTML5 drag-and-drop - #101

Merged
shossain786 merged 1 commit into
masterfrom
feat/locator-drag-to
Oct 2, 2026
Merged

shossain786 merged 1 commit into
masterfrom
feat/locator-drag-to

Conversation

@shossain786

Copy link
Copy Markdown
Contributor

Closes #50

What

Locator.dragTo(Locator target): tries native Actions.dragAndDrop first. A one-shot drop listener on the target detects whether the drop landed; if not, it replays dragstart → dragenter → dragover → drop → dragend with a shared synthetic DataTransfer. Both locators are waited for/re-resolved; LocatorException if either never resolves.

Verification

  • New LocatorDragToTest (4 tests: native path, fallback path, unresolved target, unresolved source). Fails to compile without the change, passes with it.
  • Full suite: 551 tests, 0 failures.
  • Real headless Chrome against an HTML5 DnD page: native drop detected, and the synthetic script on its own sets the target text from dataTransfer.
  • Not verified: Firefox, or a browser where native drag really is ignored.

🤖 Generated with Claude Code

Native Actions.dragAndDrop first; if no drop event reached the target,
replay dragstart/dragenter/dragover/drop/dragend with a synthetic
DataTransfer. Both elements are waited for and re-resolved.

Closes #50

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@shossain786
shossain786 merged commit be54e9b into master Oct 2, 2026
2 checks passed
@shossain786
shossain786 deleted the feat/locator-drag-to branch October 2, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Locator.dragTo(Locator) for HTML5 drag-and-drop

1 participant