Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Support the step option for the Locator.dragTo method #32609

Open
romanresh opened this issue Sep 13, 2024 · 2 comments
Open

[Feature]: Support the step option for the Locator.dragTo method #32609

romanresh opened this issue Sep 13, 2024 · 2 comments

Comments

@romanresh
Copy link

🚀 Feature Request

By default, the Locator.dragTo method raises one intermediate mousemove event.
We need to set the steps option to increase number of intermediate mousemove events as it's implemented in the Mouse.Move method options.

Example

Set the non-default steps option:

await source.dragTo(target, { steps: 3 });

Motivation

There are a few cases:

  1. In some components, dragging starts only after a few intermediate mousemove events with holding mousedown to prevent unintended changes.
  2. Sometimes, during the dragging action some elements should catch dragging above them before dragging is finished on the end point.
@dgozman
Copy link
Contributor

dgozman commented Sep 13, 2024

@romanresh While we consider this feature request for prioritization, you can probably work around it by calling page.mouse.down()/move()/up() and passing steps there.

@romanresh
Copy link
Author

@romanresh While we consider this feature request for prioritization, you can probably work around it by calling page.mouse.down()/move()/up() and passing steps there.

Yes, thank you, we use this WA in our tests.

It makes tests less stable because the drag event also makes a few checks before performing drag and drop: stabilize element, visibility and others. So, it's also important to call the Locator.dragTo(.., { trial: true }) before down/move/up.

All these actions allow to test our scenarios, but the result trace log contains too much excess information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants