File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,32 @@ test('Move the mouse smoothly.', function(t)
58
58
t . ok ( robot . moveMouseSmooth ( "0" , "0" ) === 1 , 'move mouse to ("0", "0").' ) ;
59
59
60
60
} ) ;
61
+
62
+ test ( 'Click the mouse.' , function ( t )
63
+ {
64
+ t . plan ( 8 ) ;
65
+ t . ok ( robot . mouseClick ( ) , 'click the mouse (no button specified).' ) ;
66
+ t . ok ( robot . mouseClick ( "left" ) === 1 , 'click the left mouse button.' ) ;
67
+ t . ok ( robot . mouseClick ( "middle" ) === 1 , 'click the middle mouse button.' ) ;
68
+ t . ok ( robot . mouseClick ( "right" ) === 1 , 'click the right mouse button.' ) ;
69
+
70
+ t . ok ( robot . mouseClick ( "left" , 1 ) , 'double click the left mouse button.' ) ;
71
+
72
+ t . throws ( function ( )
73
+ {
74
+ robot . mouseClick ( "party" ) ;
75
+ } , / I n v a l i d m o u s e / , 'click an incorrect mouse button (party).' ) ;
76
+
77
+ t . throws ( function ( )
78
+ {
79
+ robot . mouseClick ( "0" ) ;
80
+ } , / I n v a l i d m o u s e / , 'click an incorrect mouse button (0).' ) ;
81
+
82
+ t . throws ( function ( )
83
+ {
84
+ robot . mouseClick ( "left" , 0 , "test" ) ;
85
+ } , / I n v a l i d n u m b e r / , 'click the mouse with an extra argument.' ) ;
86
+
61
87
} ) ;
62
88
63
89
test ( 'Drag the mouse.' , function ( t )
You can’t perform that action at this time.
0 commit comments