webdriverio icon indicating copy to clipboard operation
webdriverio copied to clipboard

[💡 Feature]: Add/return back possibility to click and moveTo outside the given element

Open taninnazar opened this issue 1 year ago • 1 comments

Is your feature request related to a problem?

Sometimes we need to click outside of the element or move the mouse out of the element. Previously, it was possible by passing xOffset and yOffset, while el.click({x:..., y:...}) or el.moveTo({x:..., y:...}) which were greater than the element's width or height. After the code changes for this feature https://github.com/webdriverio/webdriverio/issues/11544 clicking or moving outside the element throws an error and the test fails. So, the idea is to return this possibility.

Describe the solution you'd like.

Approaches that were suggested by Christian which I agree with:

  • remove the error being thrown
  • add a flag to allow clicking and moving outside of the element

Describe alternatives you've considered.

No response

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

taninnazar avatar Feb 07 '24 07:02 taninnazar

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

wdio-bot avatar Feb 07 '24 16:02 wdio-bot

the reason why we've added the check was to exclude possible errors with pointer out of bounds. because x offset can be enormous and move pointer to out of viewport, it'll be definitely an error out of bounds. but using offset imply that person is being used offset understand that he's doing. and some of errors anyway will be there like 'goes outside of element' or 'out of bounds'

I believe it makes sense and suggest to use the option - remove the error being thrown and replace it to 'info' message

udarrr avatar Feb 24 '24 12:02 udarrr

A fix for this has been merged and release.

christian-bromann avatar Mar 03 '24 23:03 christian-bromann