mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
update robotgo test code, add more test
This commit is contained in:
parent
53a882d7fd
commit
ab149287dd
@ -28,12 +28,12 @@ func TestGetVer(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMoveMouse(t *testing.T) {
|
func TestMoveMouse(t *testing.T) {
|
||||||
MoveMouse(10, 10)
|
MoveMouse(20, 20)
|
||||||
MilliSleep(10)
|
MilliSleep(10)
|
||||||
x, y := GetMousePos()
|
x, y := GetMousePos()
|
||||||
|
|
||||||
tt.Equal(t, 10, x)
|
tt.Equal(t, 20, x)
|
||||||
tt.Equal(t, 10, y)
|
tt.Equal(t, 20, y)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMoveMouseSmooth(t *testing.T) {
|
func TestMoveMouseSmooth(t *testing.T) {
|
||||||
@ -46,10 +46,17 @@ func TestMoveMouseSmooth(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDragMouse(t *testing.T) {
|
func TestDragMouse(t *testing.T) {
|
||||||
DragMouse(20, 20)
|
DragMouse(500, 500)
|
||||||
MilliSleep(10)
|
MilliSleep(10)
|
||||||
x, y := GetMousePos()
|
x, y := GetMousePos()
|
||||||
|
|
||||||
tt.Equal(t, 20, x)
|
tt.Equal(t, 500, x)
|
||||||
tt.Equal(t, 20, y)
|
tt.Equal(t, 500, y)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestScrollMouse(t *testing.T) {
|
||||||
|
ScrollMouse(120, "up")
|
||||||
|
MilliSleep(100)
|
||||||
|
|
||||||
|
Scroll(210, 210)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user