-
Notifications
You must be signed in to change notification settings - Fork 232
Update to Async Mouse
#1594
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update to Async Mouse
#1594
Conversation
74f05b2
to
1eaab62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
A bit of confusion for me on why mouseMove
is also mentioned in mouseDown
and mouseUp
.
|
||
# down([options]) | ||
|
||
Dispatches a `mousedown` event on the mouse's current position. Mouse can be moved to a different position using [`mouse.move()`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/mouse/move). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to elaborate a little why a user might want to downClick and move (dragging an element i assume)? Otherwise it doesn't make sense to mention mouseMove here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's related to this issue. Previously, down
and up
were accepting x
and y
coordinates, which was incorrect.
down
and up
are closely related to move
because without a move
, users will only be able to click (well, down
or up
) on the same part of the virtual screen.
As tested here, so, they first move
and then use one of down
or up
to click to the x
and y
coordinates. That's why move
is related.
But I can expand the doc's explanation similar to what I've done above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I retyped it like so 128c37e. It might be "slightly" better why these APIs are related.
|
||
# up([options]) | ||
|
||
Dispatches a `mouseup` event on the mouse's current position. Mouse can be moved to a different position using [`mouse.move()`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/mouse/move). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it makes sense to mention mouseMove
here. What's the link between the two APIs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained here: #1594 (comment).
7e11581
to
e6dc7ce
Compare
down and up are closely related to move because without a move, users will only be able to click (well, down or up) on the same part of the virtual screen.
What?
Update relevant
Mouse
methods from sync to async.Checklist
npm start
command locally and verified that the changes look good.docs/sources/next
folder of the documentation.docs/sources/v{most_recent_release}
folder of the documentation.Related PR(s)/Issue(s)
Updates: grafana/xk6-browser#1306
Closes: grafana/xk6-browser#766