You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
drag and left_mouse skip cursor positioning when a coordinate is 0 (screen edge) #7079
drag and left_mouse in skyvern/webeye/actions/handler_utils.py gate the move-to-start on a truthiness check:
asyncdefdrag(page, start_x=None, start_y=None, path=None):
ifstart_xandstart_y: # 0 is falsyawaitEventStrategyFactory.move_cursor(page, start_x, start_y)
...
asyncdefleft_mouse(page, x, y, direction):
ifxandy: # 0 is falsyawaitEventStrategyFactory.move_cursor(page, x, y)
A coordinate of 0 (the top or left screen edge) is falsy, so the cursor is never moved before mouse.down(). The drag or click then fires at wherever the cursor happened to be, not at the requested edge coordinate. drag even uses is not None for the very same start_x/start_y a few lines later (setting last_x/last_y and the final sync_cursor_position), which shows the intended check.
Expected
Coordinate 0 is a valid position and should move the cursor. Use is not None so only a missing coordinate skips the move.
Reproduce
Calling drag(page, start_x=0, start_y=5) never invokes move_cursor, so the drag starts from the previous cursor position instead of (0, 5). Same for left_mouse(page, 0, 0, "down").
I have a fix plus tests ready and will open a PR that references this issue.
Activity