uber / nebula.gl

A suite of 3D-enabled data editing overlays, suitable for deck.gl
https://nebula.gl/
Other
686 stars 166 forks source link

mousemove events while testing in Playwright not having any effect. #882

Closed schroedermarc closed 1 year ago

schroedermarc commented 1 year ago

I am trying to use Playwright to test several interactions in the Nebula/Deck based app I'm working on. I can successfully test click based interactions once I know the screen pixels of objects, but if we know an edit handle is at pixel (x,y) the recommended sequence of:

page.mouse.move(x, y);
page.mouse.down();
page.mouse.move(x + dx, y + dy);
page.mouse.up():

Does not produce the expected result.

Expected: The edit handle at (x,y) is moved to (x + dx, y + dy). Actual: The edit handle stays in the same location.

I can confirm that without the second move command, if a mouse.up() immediately follows mouse.down() the click works as expected, so I've isolated it to the move event. However, reading the source code I'm wondering if there's some complexities with the mousemove event I'm not accounting for. In general I'd like a dependable way to test dragging features and edit handles with a testing suite like Playwright.

schroedermarc commented 1 year ago

I figured out my own issue. It might be helpful to others so I'll close it and leave a comment here. If you're using Playwright to simulate dragging you have to use the steps parameter in the mouse.move event. It defaults to 1 and that isn't enough.