Describe the bug
We're trying to simulate UI-tests and have a drag and drop function implemented in our game which we are trying to test via scene runner and it seems like the functions for simulate_mouse_button_press() & simulate_mouse_move() are not doing anything while set_mouse_pos() is working as we assume.
When simulating the mouse button press (hold) on a scene runner, it doesn't trigger the get_drag_data() (and also _gui_input() by the looks of it) function of a child even when moving the mouse manually. We assume this is because simulate_mouse_button_press() doesn't actually hold the mouse button down. When checking against Input.is_mouse_button_pressed(BUTTON_LEFT) it also returns false.
When simulating the mouse movement on a scene runner the _gui_input function of the scene gets called but the mouse position doesn't update in the viewport.
Steps to Reproduce
For this functionality the test must be started with "Debug Tests" and the window has to be not minimized otherwise the set_mouse_pos() function doesn't update the mouse in the viewport either.
Mouse Press
Open project from below
Start test test_mouse_press() of res://test/PanelContainerTest.gd with Debug Tests
Move the mouse on top of a Panel or the Button
See that the Game Node prints Left mouse button was pressed! but the Panel doesn't
See that, when doing the same for the Button, it also doesn't register the simulated press
Mouse Movement
Open project from below
Start test test_simulate_mouse_move() of res://test/PanelContainerTest.gd with Debug Tests
See that the expected mouse position (300, 300) doesn't match the actual mouse position (100, 100)
The used Godot version: 3.5.1
OS including version: Windows 10
Describe the bug We're trying to simulate UI-tests and have a drag and drop function implemented in our game which we are trying to test via scene runner and it seems like the functions for
simulate_mouse_button_press()
&simulate_mouse_move()
are not doing anything whileset_mouse_pos()
is working as we assume.get_drag_data()
(and also_gui_input()
by the looks of it) function of a child even when moving the mouse manually. We assume this is becausesimulate_mouse_button_press()
doesn't actually hold the mouse button down. When checking againstInput.is_mouse_button_pressed(BUTTON_LEFT)
it also returnsfalse
._gui_input
function of the scene gets called but the mouse position doesn't update in the viewport.Steps to Reproduce For this functionality the test must be started with "Debug Tests" and the window has to be not minimized otherwise the
set_mouse_pos()
function doesn't update the mouse in the viewport either.Mouse Press
test_mouse_press()
ofres://test/PanelContainerTest.gd
withDebug Tests
Left mouse button was pressed!
but the Panel doesn'tMouse Movement
test_simulate_mouse_move()
ofres://test/PanelContainerTest.gd
withDebug Tests
Minimal reproduction project: Uploaded project: https://github.com/MonaCage/gdunit-mouse-sim