nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

moveToElement optional arguments #1250

Closed edoardocavazza closed 7 years ago

edoardocavazza commented 7 years ago

The moveToElement alias to moveTo requires 2 arguments (offsetX and offsetY) that are not required by the original method.

beatfactor commented 7 years ago

moveToElement is not an alias, it takes a selector as first argument while moveTo takes a selenium/webdriver web element - https://www.w3.org/TR/webdriver/#elements.

edoardocavazza commented 7 years ago

It's what is written in the documentation here: http://nightwatchjs.org/api/moveToElement.html. BTW, the point is that in http://nightwatchjs.org/api/moveTo.html the xoffset and yoffset params have this behavior:

If not specified, the mouse will move to the middle of the element.

while in the moveToElement they are required. I just thought that this discrepancy could be a bug because it prevents to point the middle of an element using a selector.

I have workarounded this for the moment using .moveToElement(<sel>, undefined, undefined)

beatfactor commented 7 years ago

I see. Yeah, that's true. Feel free to re-open this if you believe it should be fixed, but please add more details because as it is it's not very clear. See the contributing guidelines.